new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.subscribeOn = void 0;
|
||||
var lift_1 = require("../util/lift");
|
||||
function subscribeOn(scheduler, delay) {
|
||||
if (delay === void 0) { delay = 0; }
|
||||
return lift_1.operate(function (source, subscriber) {
|
||||
subscriber.add(scheduler.schedule(function () { return source.subscribe(subscriber); }, delay));
|
||||
});
|
||||
}
|
||||
exports.subscribeOn = subscribeOn;
|
||||
//# sourceMappingURL=subscribeOn.js.map
|
||||
@@ -0,0 +1,20 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright 2022 Andrey Sitnik <andrey@sitnik.ru> and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,40 @@
|
||||
import { FileLike } from "./FileLike.js";
|
||||
/**
|
||||
* A `string` or `File` that represents a single value from a set of `FormData` key-value pairs.
|
||||
*/
|
||||
export type FormDataEntryValue = string | FileLike;
|
||||
/**
|
||||
* This interface reflects minimal shape of the FormData
|
||||
*/
|
||||
export interface FormDataLike {
|
||||
/**
|
||||
* Appends a new value onto an existing key inside a FormData object,
|
||||
* or adds the key if it does not already exist.
|
||||
*
|
||||
* The difference between `set()` and `append()` is that if the specified key already exists, `set()` will overwrite all existing values with the new one, whereas `append()` will append the new value onto the end of the existing set of values.
|
||||
*
|
||||
* @param name The name of the field whose data is contained in `value`.
|
||||
* @param value The field's value. This can be [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob)
|
||||
or [`File`](https://developer.mozilla.org/en-US/docs/Web/API/File). If none of these are specified the value is converted to a string.
|
||||
* @param fileName The filename reported to the server, when a Blob or File is passed as the second parameter. The default filename for Blob objects is "blob". The default filename for File objects is the file's filename.
|
||||
*/
|
||||
append(name: string, value: unknown, fileName?: string): void;
|
||||
/**
|
||||
* Returns all the values associated with a given key from within a `FormData` object.
|
||||
*
|
||||
* @param {string} name A name of the value you want to retrieve.
|
||||
*
|
||||
* @returns An array of `FormDataEntryValue` whose key matches the value passed in the `name` parameter. If the key doesn't exist, the method returns an empty list.
|
||||
*/
|
||||
getAll(name: string): FormDataEntryValue[];
|
||||
/**
|
||||
* Returns an [`iterator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols) allowing to go through the `FormData` key/value pairs.
|
||||
* The key of each pair is a string; the value is a [`FormDataValue`](https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue).
|
||||
*/
|
||||
entries(): Generator<[string, FormDataEntryValue]>;
|
||||
/**
|
||||
* An alias for FormDataLike#entries()
|
||||
*/
|
||||
[Symbol.iterator](): Generator<[string, FormDataEntryValue]>;
|
||||
readonly [Symbol.toStringTag]: string;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
{
|
||||
"name": "object-hash",
|
||||
"version": "3.0.0",
|
||||
"description": "Generate hashes from javascript objects in node and the browser.",
|
||||
"homepage": "https://github.com/puleos/object-hash",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/puleos/object-hash"
|
||||
},
|
||||
"keywords": [
|
||||
"object",
|
||||
"hash",
|
||||
"sha1",
|
||||
"md5"
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/puleos/object-hash/issues"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "node ./node_modules/.bin/mocha test",
|
||||
"prepublish": "gulp dist"
|
||||
},
|
||||
"author": "Scott Puleo <puleos@gmail.com>",
|
||||
"files": [
|
||||
"index.js",
|
||||
"dist/object_hash.js"
|
||||
],
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"browserify": "^16.2.3",
|
||||
"gulp": "^4.0.0",
|
||||
"gulp-browserify": "^0.5.1",
|
||||
"gulp-coveralls": "^0.1.4",
|
||||
"gulp-exec": "^3.0.1",
|
||||
"gulp-istanbul": "^1.1.3",
|
||||
"gulp-jshint": "^2.0.0",
|
||||
"gulp-mocha": "^5.0.0",
|
||||
"gulp-rename": "^1.2.0",
|
||||
"gulp-replace": "^1.0.0",
|
||||
"gulp-uglify": "^3.0.0",
|
||||
"jshint": "^2.8.0",
|
||||
"jshint-stylish": "^2.1.0",
|
||||
"karma": "^4.2.0",
|
||||
"karma-chrome-launcher": "^2.2.0",
|
||||
"karma-mocha": "^1.3.0",
|
||||
"mocha": "^6.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"main": "./index.js",
|
||||
"browser": "./dist/object_hash.js"
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { innerFrom } from './innerFrom';
|
||||
export function defer(observableFactory) {
|
||||
return new Observable((subscriber) => {
|
||||
innerFrom(observableFactory()).subscribe(subscriber);
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=defer.js.map
|
||||
@@ -0,0 +1,17 @@
|
||||
export function addQueryParameters(url, parameters) {
|
||||
const separator = /\?/.test(url) ? "&" : "?";
|
||||
const names = Object.keys(parameters);
|
||||
if (names.length === 0) {
|
||||
return url;
|
||||
}
|
||||
return (url +
|
||||
separator +
|
||||
names
|
||||
.map((name) => {
|
||||
if (name === "q") {
|
||||
return ("q=" + parameters.q.split("+").map(encodeURIComponent).join("+"));
|
||||
}
|
||||
return `${name}=${encodeURIComponent(parameters[name])}`;
|
||||
})
|
||||
.join("&"));
|
||||
}
|
||||
@@ -0,0 +1,209 @@
|
||||
import assertString from './util/assertString';
|
||||
/* eslint-disable max-len */
|
||||
|
||||
var phones = {
|
||||
'am-AM': /^(\+?374|0)((10|[9|7][0-9])\d{6}$|[2-4]\d{7}$)/,
|
||||
'ar-AE': /^((\+?971)|0)?5[024568]\d{7}$/,
|
||||
'ar-BH': /^(\+?973)?(3|6)\d{7}$/,
|
||||
'ar-DZ': /^(\+?213|0)(5|6|7)\d{8}$/,
|
||||
'ar-LB': /^(\+?961)?((3|81)\d{6}|7\d{7})$/,
|
||||
'ar-EG': /^((\+?20)|0)?1[0125]\d{8}$/,
|
||||
'ar-IQ': /^(\+?964|0)?7[0-9]\d{8}$/,
|
||||
'ar-JO': /^(\+?962|0)?7[789]\d{7}$/,
|
||||
'ar-KW': /^(\+?965)([569]\d{7}|41\d{6})$/,
|
||||
'ar-LY': /^((\+?218)|0)?(9[1-6]\d{7}|[1-8]\d{7,9})$/,
|
||||
'ar-MA': /^(?:(?:\+|00)212|0)[5-7]\d{8}$/,
|
||||
'ar-OM': /^((\+|00)968)?(9[1-9])\d{6}$/,
|
||||
'ar-PS': /^(\+?970|0)5[6|9](\d{7})$/,
|
||||
'ar-SA': /^(!?(\+?966)|0)?5\d{8}$/,
|
||||
'ar-SY': /^(!?(\+?963)|0)?9\d{8}$/,
|
||||
'ar-TN': /^(\+?216)?[2459]\d{7}$/,
|
||||
'az-AZ': /^(\+994|0)(10|5[015]|7[07]|99)\d{7}$/,
|
||||
'bs-BA': /^((((\+|00)3876)|06))((([0-3]|[5-6])\d{6})|(4\d{7}))$/,
|
||||
'be-BY': /^(\+?375)?(24|25|29|33|44)\d{7}$/,
|
||||
'bg-BG': /^(\+?359|0)?8[789]\d{7}$/,
|
||||
'bn-BD': /^(\+?880|0)1[13456789][0-9]{8}$/,
|
||||
'ca-AD': /^(\+376)?[346]\d{5}$/,
|
||||
'cs-CZ': /^(\+?420)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
|
||||
'da-DK': /^(\+?45)?\s?\d{2}\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
||||
'de-DE': /^((\+49|0)1)(5[0-25-9]\d|6([23]|0\d?)|7([0-57-9]|6\d))\d{7,9}$/,
|
||||
'de-AT': /^(\+43|0)\d{1,4}\d{3,12}$/,
|
||||
'de-CH': /^(\+41|0)([1-9])\d{1,9}$/,
|
||||
'de-LU': /^(\+352)?((6\d1)\d{6})$/,
|
||||
'dv-MV': /^(\+?960)?(7[2-9]|9[1-9])\d{5}$/,
|
||||
'el-GR': /^(\+?30|0)?6(8[5-9]|9(?![26])[0-9])\d{7}$/,
|
||||
'el-CY': /^(\+?357?)?(9(9|6)\d{6})$/,
|
||||
'en-AI': /^(\+?1|0)264(?:2(35|92)|4(?:6[1-2]|76|97)|5(?:3[6-9]|8[1-4])|7(?:2(4|9)|72))\d{4}$/,
|
||||
'en-AU': /^(\+?61|0)4\d{8}$/,
|
||||
'en-AG': /^(?:\+1|1)268(?:464|7(?:1[3-9]|[28]\d|3[0246]|64|7[0-689]))\d{4}$/,
|
||||
'en-BM': /^(\+?1)?441(((3|7)\d{6}$)|(5[0-3][0-9]\d{4}$)|(59\d{5}$))/,
|
||||
'en-BS': /^(\+?1[-\s]?|0)?\(?242\)?[-\s]?\d{3}[-\s]?\d{4}$/,
|
||||
'en-GB': /^(\+?44|0)7\d{9}$/,
|
||||
'en-GG': /^(\+?44|0)1481\d{6}$/,
|
||||
'en-GH': /^(\+233|0)(20|50|24|54|27|57|26|56|23|28|55|59)\d{7}$/,
|
||||
'en-GY': /^(\+592|0)6\d{6}$/,
|
||||
'en-HK': /^(\+?852[-\s]?)?[456789]\d{3}[-\s]?\d{4}$/,
|
||||
'en-MO': /^(\+?853[-\s]?)?[6]\d{3}[-\s]?\d{4}$/,
|
||||
'en-IE': /^(\+?353|0)8[356789]\d{7}$/,
|
||||
'en-IN': /^(\+?91|0)?[6789]\d{9}$/,
|
||||
'en-JM': /^(\+?876)?\d{7}$/,
|
||||
'en-KE': /^(\+?254|0)(7|1)\d{8}$/,
|
||||
'en-SS': /^(\+?211|0)(9[1257])\d{7}$/,
|
||||
'en-KI': /^((\+686|686)?)?( )?((6|7)(2|3|8)[0-9]{6})$/,
|
||||
'en-KN': /^(?:\+1|1)869(?:46\d|48[89]|55[6-8]|66\d|76[02-7])\d{4}$/,
|
||||
'en-LS': /^(\+?266)(22|28|57|58|59|27|52)\d{6}$/,
|
||||
'en-MT': /^(\+?356|0)?(99|79|77|21|27|22|25)[0-9]{6}$/,
|
||||
'en-MU': /^(\+?230|0)?\d{8}$/,
|
||||
'en-NA': /^(\+?264|0)(6|8)\d{7}$/,
|
||||
'en-NG': /^(\+?234|0)?[789]\d{9}$/,
|
||||
'en-NZ': /^(\+?64|0)[28]\d{7,9}$/,
|
||||
'en-PG': /^(\+?675|0)?(7\d|8[18])\d{6}$/,
|
||||
'en-PK': /^((00|\+)?92|0)3[0-6]\d{8}$/,
|
||||
'en-PH': /^(09|\+639)\d{9}$/,
|
||||
'en-RW': /^(\+?250|0)?[7]\d{8}$/,
|
||||
'en-SG': /^(\+65)?[3689]\d{7}$/,
|
||||
'en-SL': /^(\+?232|0)\d{8}$/,
|
||||
'en-TZ': /^(\+?255|0)?[67]\d{8}$/,
|
||||
'en-UG': /^(\+?256|0)?[7]\d{8}$/,
|
||||
'en-US': /^((\+1|1)?( |-)?)?(\([2-9][0-9]{2}\)|[2-9][0-9]{2})( |-)?([2-9][0-9]{2}( |-)?[0-9]{4})$/,
|
||||
'en-ZA': /^(\+?27|0)\d{9}$/,
|
||||
'en-ZM': /^(\+?26)?09[567]\d{7}$/,
|
||||
'en-ZW': /^(\+263)[0-9]{9}$/,
|
||||
'en-BW': /^(\+?267)?(7[1-8]{1})\d{6}$/,
|
||||
'es-AR': /^\+?549(11|[2368]\d)\d{8}$/,
|
||||
'es-BO': /^(\+?591)?(6|7)\d{7}$/,
|
||||
'es-CO': /^(\+?57)?3(0(0|1|2|4|5)|1\d|2[0-4]|5(0|1))\d{7}$/,
|
||||
'es-CL': /^(\+?56|0)[2-9]\d{1}\d{7}$/,
|
||||
'es-CR': /^(\+506)?[2-8]\d{7}$/,
|
||||
'es-CU': /^(\+53|0053)?5\d{7}/,
|
||||
'es-DO': /^(\+?1)?8[024]9\d{7}$/,
|
||||
'es-HN': /^(\+?504)?[9|8|3|2]\d{7}$/,
|
||||
'es-EC': /^(\+?593|0)([2-7]|9[2-9])\d{7}$/,
|
||||
'es-ES': /^(\+?34)?[6|7]\d{8}$/,
|
||||
'es-PE': /^(\+?51)?9\d{8}$/,
|
||||
'es-MX': /^(\+?52)?(1|01)?\d{10,11}$/,
|
||||
'es-NI': /^(\+?505)\d{7,8}$/,
|
||||
'es-PA': /^(\+?507)\d{7,8}$/,
|
||||
'es-PY': /^(\+?595|0)9[9876]\d{7}$/,
|
||||
'es-SV': /^(\+?503)?[67]\d{7}$/,
|
||||
'es-UY': /^(\+598|0)9[1-9][\d]{6}$/,
|
||||
'es-VE': /^(\+?58)?(2|4)\d{9}$/,
|
||||
'et-EE': /^(\+?372)?\s?(5|8[1-4])\s?([0-9]\s?){6,7}$/,
|
||||
'fa-IR': /^(\+?98[\-\s]?|0)9[0-39]\d[\-\s]?\d{3}[\-\s]?\d{4}$/,
|
||||
'fi-FI': /^(\+?358|0)\s?(4[0-6]|50)\s?(\d\s?){4,8}$/,
|
||||
'fj-FJ': /^(\+?679)?\s?\d{3}\s?\d{4}$/,
|
||||
'fo-FO': /^(\+?298)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
||||
'fr-BF': /^(\+226|0)[67]\d{7}$/,
|
||||
'fr-BJ': /^(\+229)\d{8}$/,
|
||||
'fr-CD': /^(\+?243|0)?(8|9)\d{8}$/,
|
||||
'fr-CM': /^(\+?237)6[0-9]{8}$/,
|
||||
'fr-FR': /^(\+?33|0)[67]\d{8}$/,
|
||||
'fr-GF': /^(\+?594|0|00594)[67]\d{8}$/,
|
||||
'fr-GP': /^(\+?590|0|00590)[67]\d{8}$/,
|
||||
'fr-MQ': /^(\+?596|0|00596)[67]\d{8}$/,
|
||||
'fr-PF': /^(\+?689)?8[789]\d{6}$/,
|
||||
'fr-RE': /^(\+?262|0|00262)[67]\d{8}$/,
|
||||
'he-IL': /^(\+972|0)([23489]|5[012345689]|77)[1-9]\d{6}$/,
|
||||
'hu-HU': /^(\+?36|06)(20|30|31|50|70)\d{7}$/,
|
||||
'id-ID': /^(\+?62|0)8(1[123456789]|2[1238]|3[1238]|5[12356789]|7[78]|9[56789]|8[123456789])([\s?|\d]{5,11})$/,
|
||||
'ir-IR': /^(\+98|0)?9\d{9}$/,
|
||||
'it-IT': /^(\+?39)?\s?3\d{2} ?\d{6,7}$/,
|
||||
'it-SM': /^((\+378)|(0549)|(\+390549)|(\+3780549))?6\d{5,9}$/,
|
||||
'ja-JP': /^(\+81[ \-]?(\(0\))?|0)[6789]0[ \-]?\d{4}[ \-]?\d{4}$/,
|
||||
'ka-GE': /^(\+?995)?(79\d{7}|5\d{8})$/,
|
||||
'kk-KZ': /^(\+?7|8)?7\d{9}$/,
|
||||
'kl-GL': /^(\+?299)?\s?\d{2}\s?\d{2}\s?\d{2}$/,
|
||||
'ko-KR': /^((\+?82)[ \-]?)?0?1([0|1|6|7|8|9]{1})[ \-]?\d{3,4}[ \-]?\d{4}$/,
|
||||
'ky-KG': /^(\+?7\s?\+?7|0)\s?\d{2}\s?\d{3}\s?\d{4}$/,
|
||||
'lt-LT': /^(\+370|8)\d{8}$/,
|
||||
'lv-LV': /^(\+?371)2\d{7}$/,
|
||||
'mg-MG': /^((\+?261|0)(2|3)\d)?\d{7}$/,
|
||||
'mn-MN': /^(\+|00|011)?976(77|81|88|91|94|95|96|99)\d{6}$/,
|
||||
'my-MM': /^(\+?959|09|9)(2[5-7]|3[1-2]|4[0-5]|6[6-9]|7[5-9]|9[6-9])[0-9]{7}$/,
|
||||
'ms-MY': /^(\+?60|0)1(([0145](-|\s)?\d{7,8})|([236-9](-|\s)?\d{7}))$/,
|
||||
'mz-MZ': /^(\+?258)?8[234567]\d{7}$/,
|
||||
'nb-NO': /^(\+?47)?[49]\d{7}$/,
|
||||
'ne-NP': /^(\+?977)?9[78]\d{8}$/,
|
||||
'nl-BE': /^(\+?32|0)4\d{8}$/,
|
||||
'nl-NL': /^(((\+|00)?31\(0\))|((\+|00)?31)|0)6{1}\d{8}$/,
|
||||
'nl-AW': /^(\+)?297(56|59|64|73|74|99)\d{5}$/,
|
||||
'nn-NO': /^(\+?47)?[49]\d{7}$/,
|
||||
'pl-PL': /^(\+?48)? ?[5-8]\d ?\d{3} ?\d{2} ?\d{2}$/,
|
||||
'pt-BR': /^((\+?55\ ?[1-9]{2}\ ?)|(\+?55\ ?\([1-9]{2}\)\ ?)|(0[1-9]{2}\ ?)|(\([1-9]{2}\)\ ?)|([1-9]{2}\ ?))((\d{4}\-?\d{4})|(9[1-9]{1}\d{3}\-?\d{4}))$/,
|
||||
'pt-PT': /^(\+?351)?9[1236]\d{7}$/,
|
||||
'pt-AO': /^(\+244)\d{9}$/,
|
||||
'ro-MD': /^(\+?373|0)((6(0|1|2|6|7|8|9))|(7(6|7|8|9)))\d{6}$/,
|
||||
'ro-RO': /^(\+?40|0)\s?7\d{2}(\/|\s|\.|-)?\d{3}(\s|\.|-)?\d{3}$/,
|
||||
'ru-RU': /^(\+?7|8)?9\d{9}$/,
|
||||
'si-LK': /^(?:0|94|\+94)?(7(0|1|2|4|5|6|7|8)( |-)?)\d{7}$/,
|
||||
'sl-SI': /^(\+386\s?|0)(\d{1}\s?\d{3}\s?\d{2}\s?\d{2}|\d{2}\s?\d{3}\s?\d{3})$/,
|
||||
'sk-SK': /^(\+?421)? ?[1-9][0-9]{2} ?[0-9]{3} ?[0-9]{3}$/,
|
||||
'sq-AL': /^(\+355|0)6[789]\d{6}$/,
|
||||
'sr-RS': /^(\+3816|06)[- \d]{5,9}$/,
|
||||
'sv-SE': /^(\+?46|0)[\s\-]?7[\s\-]?[02369]([\s\-]?\d){7}$/,
|
||||
'tg-TJ': /^(\+?992)?[5][5]\d{7}$/,
|
||||
'th-TH': /^(\+66|66|0)\d{9}$/,
|
||||
'tr-TR': /^(\+?90|0)?5\d{9}$/,
|
||||
'tk-TM': /^(\+993|993|8)\d{8}$/,
|
||||
'uk-UA': /^(\+?38|8)?0\d{9}$/,
|
||||
'uz-UZ': /^(\+?998)?(6[125-79]|7[1-69]|88|9\d)\d{7}$/,
|
||||
'vi-VN': /^((\+?84)|0)((3([2-9]))|(5([25689]))|(7([0|6-9]))|(8([1-9]))|(9([0-9])))([0-9]{7})$/,
|
||||
'zh-CN': /^((\+|00)86)?(1[3-9]|9[28])\d{9}$/,
|
||||
'zh-TW': /^(\+?886\-?|0)?9\d{8}$/,
|
||||
'dz-BT': /^(\+?975|0)?(17|16|77|02)\d{6}$/,
|
||||
'ar-YE': /^(((\+|00)9677|0?7)[0137]\d{7}|((\+|00)967|0)[1-7]\d{6})$/,
|
||||
'ar-EH': /^(\+?212|0)[\s\-]?(5288|5289)[\s\-]?\d{5}$/,
|
||||
'fa-AF': /^(\+93|0)?(2{1}[0-8]{1}|[3-5]{1}[0-4]{1})(\d{7})$/
|
||||
};
|
||||
/* eslint-enable max-len */
|
||||
// aliases
|
||||
|
||||
phones['en-CA'] = phones['en-US'];
|
||||
phones['fr-CA'] = phones['en-CA'];
|
||||
phones['fr-BE'] = phones['nl-BE'];
|
||||
phones['zh-HK'] = phones['en-HK'];
|
||||
phones['zh-MO'] = phones['en-MO'];
|
||||
phones['ga-IE'] = phones['en-IE'];
|
||||
phones['fr-CH'] = phones['de-CH'];
|
||||
phones['it-CH'] = phones['fr-CH'];
|
||||
export default function isMobilePhone(str, locale, options) {
|
||||
assertString(str);
|
||||
|
||||
if (options && options.strictMode && !str.startsWith('+')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Array.isArray(locale)) {
|
||||
return locale.some(function (key) {
|
||||
// https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md#ignoring-code-for-coverage-purposes
|
||||
// istanbul ignore else
|
||||
if (phones.hasOwnProperty(key)) {
|
||||
var phone = phones[key];
|
||||
|
||||
if (phone.test(str)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
} else if (locale in phones) {
|
||||
return phones[locale].test(str); // alias falsey locale as 'any'
|
||||
} else if (!locale || locale === 'any') {
|
||||
for (var key in phones) {
|
||||
// istanbul ignore else
|
||||
if (phones.hasOwnProperty(key)) {
|
||||
var phone = phones[key];
|
||||
|
||||
if (phone.test(str)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
throw new Error("Invalid locale '".concat(locale, "'"));
|
||||
}
|
||||
export var locales = Object.keys(phones);
|
||||
@@ -0,0 +1,7 @@
|
||||
var path = require('path');
|
||||
|
||||
function rebaseToFrom(option) {
|
||||
return option ? path.resolve(option) : process.cwd();
|
||||
}
|
||||
|
||||
module.exports = rebaseToFrom;
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('isSymbol', require('../isSymbol'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
export interface LookupMatcherResult {
|
||||
locale: string;
|
||||
extension?: string;
|
||||
nu?: string;
|
||||
}
|
||||
//# sourceMappingURL=types.d.ts.map
|
||||
@@ -0,0 +1,287 @@
|
||||
const debug = require('../internal/debug')
|
||||
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
|
||||
const { re, t } = require('../internal/re')
|
||||
|
||||
const parseOptions = require('../internal/parse-options')
|
||||
const { compareIdentifiers } = require('../internal/identifiers')
|
||||
class SemVer {
|
||||
constructor (version, options) {
|
||||
options = parseOptions(options)
|
||||
|
||||
if (version instanceof SemVer) {
|
||||
if (version.loose === !!options.loose &&
|
||||
version.includePrerelease === !!options.includePrerelease) {
|
||||
return version
|
||||
} else {
|
||||
version = version.version
|
||||
}
|
||||
} else if (typeof version !== 'string') {
|
||||
throw new TypeError(`Invalid Version: ${version}`)
|
||||
}
|
||||
|
||||
if (version.length > MAX_LENGTH) {
|
||||
throw new TypeError(
|
||||
`version is longer than ${MAX_LENGTH} characters`
|
||||
)
|
||||
}
|
||||
|
||||
debug('SemVer', version, options)
|
||||
this.options = options
|
||||
this.loose = !!options.loose
|
||||
// this isn't actually relevant for versions, but keep it so that we
|
||||
// don't run into trouble passing this.options around.
|
||||
this.includePrerelease = !!options.includePrerelease
|
||||
|
||||
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
|
||||
|
||||
if (!m) {
|
||||
throw new TypeError(`Invalid Version: ${version}`)
|
||||
}
|
||||
|
||||
this.raw = version
|
||||
|
||||
// these are actually numbers
|
||||
this.major = +m[1]
|
||||
this.minor = +m[2]
|
||||
this.patch = +m[3]
|
||||
|
||||
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
||||
throw new TypeError('Invalid major version')
|
||||
}
|
||||
|
||||
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
||||
throw new TypeError('Invalid minor version')
|
||||
}
|
||||
|
||||
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
||||
throw new TypeError('Invalid patch version')
|
||||
}
|
||||
|
||||
// numberify any prerelease numeric ids
|
||||
if (!m[4]) {
|
||||
this.prerelease = []
|
||||
} else {
|
||||
this.prerelease = m[4].split('.').map((id) => {
|
||||
if (/^[0-9]+$/.test(id)) {
|
||||
const num = +id
|
||||
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
||||
return num
|
||||
}
|
||||
}
|
||||
return id
|
||||
})
|
||||
}
|
||||
|
||||
this.build = m[5] ? m[5].split('.') : []
|
||||
this.format()
|
||||
}
|
||||
|
||||
format () {
|
||||
this.version = `${this.major}.${this.minor}.${this.patch}`
|
||||
if (this.prerelease.length) {
|
||||
this.version += `-${this.prerelease.join('.')}`
|
||||
}
|
||||
return this.version
|
||||
}
|
||||
|
||||
toString () {
|
||||
return this.version
|
||||
}
|
||||
|
||||
compare (other) {
|
||||
debug('SemVer.compare', this.version, this.options, other)
|
||||
if (!(other instanceof SemVer)) {
|
||||
if (typeof other === 'string' && other === this.version) {
|
||||
return 0
|
||||
}
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
if (other.version === this.version) {
|
||||
return 0
|
||||
}
|
||||
|
||||
return this.compareMain(other) || this.comparePre(other)
|
||||
}
|
||||
|
||||
compareMain (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
return (
|
||||
compareIdentifiers(this.major, other.major) ||
|
||||
compareIdentifiers(this.minor, other.minor) ||
|
||||
compareIdentifiers(this.patch, other.patch)
|
||||
)
|
||||
}
|
||||
|
||||
comparePre (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
// NOT having a prerelease is > having one
|
||||
if (this.prerelease.length && !other.prerelease.length) {
|
||||
return -1
|
||||
} else if (!this.prerelease.length && other.prerelease.length) {
|
||||
return 1
|
||||
} else if (!this.prerelease.length && !other.prerelease.length) {
|
||||
return 0
|
||||
}
|
||||
|
||||
let i = 0
|
||||
do {
|
||||
const a = this.prerelease[i]
|
||||
const b = other.prerelease[i]
|
||||
debug('prerelease compare', i, a, b)
|
||||
if (a === undefined && b === undefined) {
|
||||
return 0
|
||||
} else if (b === undefined) {
|
||||
return 1
|
||||
} else if (a === undefined) {
|
||||
return -1
|
||||
} else if (a === b) {
|
||||
continue
|
||||
} else {
|
||||
return compareIdentifiers(a, b)
|
||||
}
|
||||
} while (++i)
|
||||
}
|
||||
|
||||
compareBuild (other) {
|
||||
if (!(other instanceof SemVer)) {
|
||||
other = new SemVer(other, this.options)
|
||||
}
|
||||
|
||||
let i = 0
|
||||
do {
|
||||
const a = this.build[i]
|
||||
const b = other.build[i]
|
||||
debug('prerelease compare', i, a, b)
|
||||
if (a === undefined && b === undefined) {
|
||||
return 0
|
||||
} else if (b === undefined) {
|
||||
return 1
|
||||
} else if (a === undefined) {
|
||||
return -1
|
||||
} else if (a === b) {
|
||||
continue
|
||||
} else {
|
||||
return compareIdentifiers(a, b)
|
||||
}
|
||||
} while (++i)
|
||||
}
|
||||
|
||||
// preminor will bump the version up to the next minor release, and immediately
|
||||
// down to pre-release. premajor and prepatch work the same way.
|
||||
inc (release, identifier) {
|
||||
switch (release) {
|
||||
case 'premajor':
|
||||
this.prerelease.length = 0
|
||||
this.patch = 0
|
||||
this.minor = 0
|
||||
this.major++
|
||||
this.inc('pre', identifier)
|
||||
break
|
||||
case 'preminor':
|
||||
this.prerelease.length = 0
|
||||
this.patch = 0
|
||||
this.minor++
|
||||
this.inc('pre', identifier)
|
||||
break
|
||||
case 'prepatch':
|
||||
// If this is already a prerelease, it will bump to the next version
|
||||
// drop any prereleases that might already exist, since they are not
|
||||
// relevant at this point.
|
||||
this.prerelease.length = 0
|
||||
this.inc('patch', identifier)
|
||||
this.inc('pre', identifier)
|
||||
break
|
||||
// If the input is a non-prerelease version, this acts the same as
|
||||
// prepatch.
|
||||
case 'prerelease':
|
||||
if (this.prerelease.length === 0) {
|
||||
this.inc('patch', identifier)
|
||||
}
|
||||
this.inc('pre', identifier)
|
||||
break
|
||||
|
||||
case 'major':
|
||||
// If this is a pre-major version, bump up to the same major version.
|
||||
// Otherwise increment major.
|
||||
// 1.0.0-5 bumps to 1.0.0
|
||||
// 1.1.0 bumps to 2.0.0
|
||||
if (
|
||||
this.minor !== 0 ||
|
||||
this.patch !== 0 ||
|
||||
this.prerelease.length === 0
|
||||
) {
|
||||
this.major++
|
||||
}
|
||||
this.minor = 0
|
||||
this.patch = 0
|
||||
this.prerelease = []
|
||||
break
|
||||
case 'minor':
|
||||
// If this is a pre-minor version, bump up to the same minor version.
|
||||
// Otherwise increment minor.
|
||||
// 1.2.0-5 bumps to 1.2.0
|
||||
// 1.2.1 bumps to 1.3.0
|
||||
if (this.patch !== 0 || this.prerelease.length === 0) {
|
||||
this.minor++
|
||||
}
|
||||
this.patch = 0
|
||||
this.prerelease = []
|
||||
break
|
||||
case 'patch':
|
||||
// If this is not a pre-release version, it will increment the patch.
|
||||
// If it is a pre-release it will bump up to the same patch version.
|
||||
// 1.2.0-5 patches to 1.2.0
|
||||
// 1.2.0 patches to 1.2.1
|
||||
if (this.prerelease.length === 0) {
|
||||
this.patch++
|
||||
}
|
||||
this.prerelease = []
|
||||
break
|
||||
// This probably shouldn't be used publicly.
|
||||
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
||||
case 'pre':
|
||||
if (this.prerelease.length === 0) {
|
||||
this.prerelease = [0]
|
||||
} else {
|
||||
let i = this.prerelease.length
|
||||
while (--i >= 0) {
|
||||
if (typeof this.prerelease[i] === 'number') {
|
||||
this.prerelease[i]++
|
||||
i = -2
|
||||
}
|
||||
}
|
||||
if (i === -1) {
|
||||
// didn't increment anything
|
||||
this.prerelease.push(0)
|
||||
}
|
||||
}
|
||||
if (identifier) {
|
||||
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
|
||||
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
|
||||
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
||||
if (isNaN(this.prerelease[1])) {
|
||||
this.prerelease = [identifier, 0]
|
||||
}
|
||||
} else {
|
||||
this.prerelease = [identifier, 0]
|
||||
}
|
||||
}
|
||||
break
|
||||
|
||||
default:
|
||||
throw new Error(`invalid increment argument: ${release}`)
|
||||
}
|
||||
this.format()
|
||||
this.raw = this.version
|
||||
return this
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = SemVer
|
||||
@@ -0,0 +1,33 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v2.0.1](https://github.com/es-shims/es-set-tostringtag/compare/v2.0.0...v2.0.1) - 2023-01-05
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Fix] move `has` to prod deps [`#2`](https://github.com/es-shims/es-set-tostringtag/issues/2)
|
||||
|
||||
### Commits
|
||||
|
||||
- [Dev Deps] update `@ljharb/eslint-config` [`b9eecd2`](https://github.com/es-shims/es-set-tostringtag/commit/b9eecd23c10b7b43ba75089ac8ff8cc6b295798b)
|
||||
|
||||
## [v2.0.0](https://github.com/es-shims/es-set-tostringtag/compare/v1.0.0...v2.0.0) - 2022-12-21
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] refactor tests [`168dcfb`](https://github.com/es-shims/es-set-tostringtag/commit/168dcfbb535c279dc48ccdc89419155125aaec18)
|
||||
- [Breaking] do not set toStringTag if it is already set [`226ab87`](https://github.com/es-shims/es-set-tostringtag/commit/226ab874192c625d9e5f0e599d3f60d2b2aa83b5)
|
||||
- [New] add `force` option to set even if already set [`1abd4ec`](https://github.com/es-shims/es-set-tostringtag/commit/1abd4ecb282f19718c4518284b0293a343564505)
|
||||
|
||||
## v1.0.0 - 2022-12-21
|
||||
|
||||
### Commits
|
||||
|
||||
- Initial implementation, tests, readme [`a0e1147`](https://github.com/es-shims/es-set-tostringtag/commit/a0e11473f79a233b46374525c962ea1b4d42418a)
|
||||
- Initial commit [`ffd4aff`](https://github.com/es-shims/es-set-tostringtag/commit/ffd4afffbeebf29aff0d87a7cfc3f7844e09fe68)
|
||||
- npm init [`fffe5bd`](https://github.com/es-shims/es-set-tostringtag/commit/fffe5bd1d1146d084730a387a9c672371f4a8fff)
|
||||
- Only apps should have lockfiles [`d363871`](https://github.com/es-shims/es-set-tostringtag/commit/d36387139465623e161a15dbd39120537f150c62)
|
||||
@@ -0,0 +1,49 @@
|
||||
const aliases = ['stdin', 'stdout', 'stderr'];
|
||||
|
||||
const hasAlias = options => aliases.some(alias => options[alias] !== undefined);
|
||||
|
||||
export const normalizeStdio = options => {
|
||||
if (!options) {
|
||||
return;
|
||||
}
|
||||
|
||||
const {stdio} = options;
|
||||
|
||||
if (stdio === undefined) {
|
||||
return aliases.map(alias => options[alias]);
|
||||
}
|
||||
|
||||
if (hasAlias(options)) {
|
||||
throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${aliases.map(alias => `\`${alias}\``).join(', ')}`);
|
||||
}
|
||||
|
||||
if (typeof stdio === 'string') {
|
||||
return stdio;
|
||||
}
|
||||
|
||||
if (!Array.isArray(stdio)) {
|
||||
throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
|
||||
}
|
||||
|
||||
const length = Math.max(stdio.length, aliases.length);
|
||||
return Array.from({length}, (value, index) => stdio[index]);
|
||||
};
|
||||
|
||||
// `ipc` is pushed unless it is already present
|
||||
export const normalizeStdioNode = options => {
|
||||
const stdio = normalizeStdio(options);
|
||||
|
||||
if (stdio === 'ipc') {
|
||||
return 'ipc';
|
||||
}
|
||||
|
||||
if (stdio === undefined || typeof stdio === 'string') {
|
||||
return [stdio, stdio, stdio, 'ipc'];
|
||||
}
|
||||
|
||||
if (stdio.includes('ipc')) {
|
||||
return stdio;
|
||||
}
|
||||
|
||||
return [...stdio, 'ipc'];
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
# Plugins
|
||||
|
||||
Plugins extend the functionality of Mousetrap. To use a plugin just include the plugin after mousetrap.
|
||||
|
||||
```html
|
||||
<script src="mousetrap.js"></script>
|
||||
<script src="mousetrap-record.js"></script>
|
||||
```
|
||||
|
||||
## Bind dictionary
|
||||
|
||||
Allows you to make multiple bindings in a single ``Mousetrap.bind`` call.
|
||||
|
||||
## Global bind
|
||||
|
||||
Allows you to set global bindings that work even inside of input fields.
|
||||
|
||||
## Pause/unpause
|
||||
|
||||
Allows you to temporarily prevent Mousetrap events from firing.
|
||||
|
||||
## Record
|
||||
|
||||
Allows you to capture a keyboard shortcut or sequence defined by a user.
|
||||
@@ -0,0 +1,12 @@
|
||||
import Node from './shared/Node';
|
||||
import Expression from './shared/Expression';
|
||||
import Component from '../Component';
|
||||
import TemplateScope from './shared/TemplateScope';
|
||||
import { TemplateNode } from '../../interfaces';
|
||||
import Element from './Element';
|
||||
export default class Animation extends Node {
|
||||
type: 'Animation';
|
||||
name: string;
|
||||
expression: Expression;
|
||||
constructor(component: Component, parent: Element, scope: TemplateScope, info: TemplateNode);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>expandApplyAtRules
|
||||
});
|
||||
function partitionRules(root) {
|
||||
if (!root.walkAtRules) return;
|
||||
let applyParents = new Set();
|
||||
root.walkAtRules("apply", (rule)=>{
|
||||
applyParents.add(rule.parent);
|
||||
});
|
||||
if (applyParents.size === 0) {
|
||||
return;
|
||||
}
|
||||
for (let rule of applyParents){
|
||||
let nodeGroups = [];
|
||||
let lastGroup = [];
|
||||
for (let node of rule.nodes){
|
||||
if (node.type === "atrule" && node.name === "apply") {
|
||||
if (lastGroup.length > 0) {
|
||||
nodeGroups.push(lastGroup);
|
||||
lastGroup = [];
|
||||
}
|
||||
nodeGroups.push([
|
||||
node
|
||||
]);
|
||||
} else {
|
||||
lastGroup.push(node);
|
||||
}
|
||||
}
|
||||
if (lastGroup.length > 0) {
|
||||
nodeGroups.push(lastGroup);
|
||||
}
|
||||
if (nodeGroups.length === 1) {
|
||||
continue;
|
||||
}
|
||||
for (let group of [
|
||||
...nodeGroups
|
||||
].reverse()){
|
||||
let clone = rule.clone({
|
||||
nodes: []
|
||||
});
|
||||
clone.append(group);
|
||||
rule.after(clone);
|
||||
}
|
||||
rule.remove();
|
||||
}
|
||||
}
|
||||
function expandApplyAtRules() {
|
||||
return (root)=>{
|
||||
partitionRules(root);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"path-is-absolute","version":"1.0.1","files":{"license":{"checkedAt":1678883668052,"integrity":"sha512-rnnnpCCaRRrva3j3sLiBcOeiIzUSasNFUiv06v4IGNpYZarhUHxdwCJO+FRUjHId+ahDcYIvNtUMvNl/qUbu6Q==","mode":420,"size":1119},"package.json":{"checkedAt":1678883672418,"integrity":"sha512-IhelNAiFepmsncBcCbBVWAif1Lx0UBSERSv1E+8QCCWdnpWI7oJGVATNE+CTEFppMsG3erLUQwLA5Kq+AkXS5A==","mode":420,"size":733},"index.js":{"checkedAt":1678883672418,"integrity":"sha512-qBuLyosHHR1rhtuGeoMlKMX7ZVB6Gi5vw5MGrb09eV2pMqxzvie799SW9wJC8H3FhlcDPSyp2FtSDCfAHpMiwg==","mode":420,"size":611},"readme.md":{"checkedAt":1678883672418,"integrity":"sha512-65TCpQkvWIw4kunpD3lsF3BE+63v1D5pUd3H7bDqAtygIuAdV6Fuf+Q+h3gF2T1hDk/C5+GBaM8n00+BiNv9EA==","mode":420,"size":1153}}}
|
||||
@@ -0,0 +1,40 @@
|
||||
interface WildcardMatchOptions {
|
||||
/** Separator to be used to split patterns and samples into segments */
|
||||
separator?: string | boolean;
|
||||
/** Flags to pass to the RegExp */
|
||||
flags?: string;
|
||||
}
|
||||
interface isMatch {
|
||||
/**
|
||||
* Tests if a sample string matches the pattern(s)
|
||||
*
|
||||
* ```js
|
||||
* isMatch('foo') //=> true
|
||||
* ```
|
||||
*/
|
||||
(sample: string): boolean;
|
||||
/** Compiled regular expression */
|
||||
regexp: RegExp;
|
||||
/** Original pattern or array of patterns that was used to compile the RegExp */
|
||||
pattern: string | string[];
|
||||
/** Options that were used to compile the RegExp */
|
||||
options: WildcardMatchOptions;
|
||||
}
|
||||
declare function isMatch(regexp: RegExp, sample: string): boolean;
|
||||
/**
|
||||
* Compiles one or more glob patterns into a RegExp and returns an isMatch function.
|
||||
* The isMatch function takes a sample string as its only argument and returns `true`
|
||||
* if the string matches the pattern(s).
|
||||
*
|
||||
* ```js
|
||||
* wildcardMatch('src/*.js')('src/index.js') //=> true
|
||||
* ```
|
||||
*
|
||||
* ```js
|
||||
* const isMatch = wildcardMatch('*.example.com', '.')
|
||||
* isMatch('foo.example.com') //=> true
|
||||
* isMatch('foo.bar.com') //=> false
|
||||
* ```
|
||||
*/
|
||||
declare function wildcardMatch(pattern: string | string[], options?: string | boolean | WildcardMatchOptions): isMatch;
|
||||
export { wildcardMatch as default };
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bufferToggle.js","sourceRoot":"","sources":["../../../../src/internal/operators/bufferToggle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AA6C9C,MAAM,UAAU,YAAY,CAC1B,QAA4B,EAC5B,eAAmD;IAEnD,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,MAAM,OAAO,GAAU,EAAE,CAAC;QAG1B,SAAS,CAAC,QAAQ,CAAC,CAAC,SAAS,CAC3B,wBAAwB,CACtB,UAAU,EACV,CAAC,SAAS,EAAE,EAAE;YACZ,MAAM,MAAM,GAAQ,EAAE,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAGrB,MAAM,mBAAmB,GAAG,IAAI,YAAY,EAAE,CAAC;YAE/C,MAAM,UAAU,GAAG,GAAG,EAAE;gBACtB,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBAC3B,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;gBACxB,mBAAmB,CAAC,WAAW,EAAE,CAAC;YACpC,CAAC,CAAC;YAGF,mBAAmB,CAAC,GAAG,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,wBAAwB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;QACnI,CAAC,EACD,IAAI,CACL,CACF,CAAC;QAEF,MAAM,CAAC,SAAS,CACd,wBAAwB,CACtB,UAAU,EACV,CAAC,KAAK,EAAE,EAAE;YAER,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;gBAC5B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACpB;QACH,CAAC,EACD,GAAG,EAAE;YAEH,OAAO,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE;gBACzB,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,EAAG,CAAC,CAAC;aACnC;YACD,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC,CACF,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "lru-cache",
|
||||
"description": "A cache object that deletes the least-recently-used items.",
|
||||
"version": "5.1.1",
|
||||
"author": "Isaac Z. Schlueter <i@izs.me>",
|
||||
"keywords": [
|
||||
"mru",
|
||||
"lru",
|
||||
"cache"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "tap test/*.js --100 -J",
|
||||
"snap": "TAP_SNAPSHOT=1 tap test/*.js -J",
|
||||
"coveragerport": "tap --coverage-report=html",
|
||||
"preversion": "npm test",
|
||||
"postversion": "npm publish",
|
||||
"postpublish": "git push origin --all; git push origin --tags"
|
||||
},
|
||||
"main": "index.js",
|
||||
"repository": "git://github.com/isaacs/node-lru-cache.git",
|
||||
"devDependencies": {
|
||||
"benchmark": "^2.1.4",
|
||||
"tap": "^12.1.0"
|
||||
},
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"yallist": "^3.0.2"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import { SourceMapConsumer } from 'source-map-js'
|
||||
|
||||
import { ProcessOptions } from './postcss.js'
|
||||
|
||||
/**
|
||||
* Source map information from input CSS.
|
||||
* For example, source map after Sass compiler.
|
||||
*
|
||||
* This class will automatically find source map in input CSS or in file system
|
||||
* near input file (according `from` option).
|
||||
*
|
||||
* ```js
|
||||
* const root = parse(css, { from: 'a.sass.css' })
|
||||
* root.input.map //=> PreviousMap
|
||||
* ```
|
||||
*/
|
||||
export default class PreviousMap {
|
||||
/**
|
||||
* Was source map inlined by data-uri to input CSS.
|
||||
*/
|
||||
inline: boolean
|
||||
|
||||
/**
|
||||
* `sourceMappingURL` content.
|
||||
*/
|
||||
annotation?: string
|
||||
|
||||
/**
|
||||
* Source map file content.
|
||||
*/
|
||||
text?: string
|
||||
|
||||
/**
|
||||
* The directory with source map file, if source map is in separated file.
|
||||
*/
|
||||
root?: string
|
||||
|
||||
/**
|
||||
* The CSS source identifier. Contains `Input#file` if the user
|
||||
* set the `from` option, or `Input#id` if they did not.
|
||||
*/
|
||||
file?: string
|
||||
|
||||
/**
|
||||
* Path to source map file.
|
||||
*/
|
||||
mapFile?: string
|
||||
|
||||
/**
|
||||
* @param css Input CSS source.
|
||||
* @param opts Process options.
|
||||
*/
|
||||
constructor(css: string, opts?: ProcessOptions)
|
||||
|
||||
/**
|
||||
* Create a instance of `SourceMapGenerator` class
|
||||
* from the `source-map` library to work with source map information.
|
||||
*
|
||||
* It is lazy method, so it will create object only on first call
|
||||
* and then it will use cache.
|
||||
*
|
||||
* @return Object with source map information.
|
||||
*/
|
||||
consumer(): SourceMapConsumer
|
||||
|
||||
/**
|
||||
* Does source map contains `sourcesContent` with input source text.
|
||||
*
|
||||
* @return Is `sourcesContent` present.
|
||||
*/
|
||||
withContent(): boolean
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
# brace-expansion
|
||||
|
||||
[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
|
||||
as known from sh/bash, in JavaScript.
|
||||
|
||||
[](http://travis-ci.org/juliangruber/brace-expansion)
|
||||
[](https://www.npmjs.org/package/brace-expansion)
|
||||
[](https://greenkeeper.io/)
|
||||
|
||||
[](https://ci.testling.com/juliangruber/brace-expansion)
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var expand = require('brace-expansion');
|
||||
|
||||
expand('file-{a,b,c}.jpg')
|
||||
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
|
||||
|
||||
expand('-v{,,}')
|
||||
// => ['-v', '-v', '-v']
|
||||
|
||||
expand('file{0..2}.jpg')
|
||||
// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
|
||||
|
||||
expand('file-{a..c}.jpg')
|
||||
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
|
||||
|
||||
expand('file{2..0}.jpg')
|
||||
// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
|
||||
|
||||
expand('file{0..4..2}.jpg')
|
||||
// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
|
||||
|
||||
expand('file-{a..e..2}.jpg')
|
||||
// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
|
||||
|
||||
expand('file{00..10..5}.jpg')
|
||||
// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
|
||||
|
||||
expand('{{A..C},{a..c}}')
|
||||
// => ['A', 'B', 'C', 'a', 'b', 'c']
|
||||
|
||||
expand('ppp{,config,oe{,conf}}')
|
||||
// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var expand = require('brace-expansion');
|
||||
```
|
||||
|
||||
### var expanded = expand(str)
|
||||
|
||||
Return an array of all possible and valid expansions of `str`. If none are
|
||||
found, `[str]` is returned.
|
||||
|
||||
Valid expansions are:
|
||||
|
||||
```js
|
||||
/^(.*,)+(.+)?$/
|
||||
// {a,b,...}
|
||||
```
|
||||
|
||||
A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
|
||||
|
||||
```js
|
||||
/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
|
||||
// {x..y[..incr]}
|
||||
```
|
||||
|
||||
A numeric sequence from `x` to `y` inclusive, with optional increment.
|
||||
If `x` or `y` start with a leading `0`, all the numbers will be padded
|
||||
to have equal length. Negative numbers and backwards iteration work too.
|
||||
|
||||
```js
|
||||
/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
|
||||
// {x..y[..incr]}
|
||||
```
|
||||
|
||||
An alphabetic sequence from `x` to `y` inclusive, with optional increment.
|
||||
`x` and `y` must be exactly one character, and if given, `incr` must be a
|
||||
number.
|
||||
|
||||
For compatibility reasons, the string `${` is not eligible for brace expansion.
|
||||
|
||||
## Installation
|
||||
|
||||
With [npm](https://npmjs.org) do:
|
||||
|
||||
```bash
|
||||
npm install brace-expansion
|
||||
```
|
||||
|
||||
## Contributors
|
||||
|
||||
- [Julian Gruber](https://github.com/juliangruber)
|
||||
- [Isaac Z. Schlueter](https://github.com/isaacs)
|
||||
|
||||
## Sponsors
|
||||
|
||||
This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
|
||||
|
||||
Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
|
||||
|
||||
## License
|
||||
|
||||
(MIT)
|
||||
|
||||
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,23 @@
|
||||
const numeric = /^[0-9]+$/
|
||||
const compareIdentifiers = (a, b) => {
|
||||
const anum = numeric.test(a)
|
||||
const bnum = numeric.test(b)
|
||||
|
||||
if (anum && bnum) {
|
||||
a = +a
|
||||
b = +b
|
||||
}
|
||||
|
||||
return a === b ? 0
|
||||
: (anum && !bnum) ? -1
|
||||
: (bnum && !anum) ? 1
|
||||
: a < b ? -1
|
||||
: 1
|
||||
}
|
||||
|
||||
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)
|
||||
|
||||
module.exports = {
|
||||
compareIdentifiers,
|
||||
rcompareIdentifiers,
|
||||
}
|
||||
@@ -0,0 +1,484 @@
|
||||
var hasInherit = require('./has-inherit');
|
||||
var everyValuesPair = require('./every-values-pair');
|
||||
var findComponentIn = require('./find-component-in');
|
||||
var isComponentOf = require('./is-component-of');
|
||||
var isMergeableShorthand = require('./is-mergeable-shorthand');
|
||||
var overridesNonComponentShorthand = require('./overrides-non-component-shorthand');
|
||||
var sameVendorPrefixesIn = require('./vendor-prefixes').same;
|
||||
|
||||
var compactable = require('../compactable');
|
||||
var deepClone = require('../clone').deep;
|
||||
var restoreWithComponents = require('../restore-with-components');
|
||||
var shallowClone = require('../clone').shallow;
|
||||
|
||||
var restoreFromOptimizing = require('../../restore-from-optimizing');
|
||||
|
||||
var Token = require('../../../tokenizer/token');
|
||||
var Marker = require('../../../tokenizer/marker');
|
||||
|
||||
var serializeProperty = require('../../../writer/one-time').property;
|
||||
|
||||
function wouldBreakCompatibility(property, validator) {
|
||||
for (var i = 0; i < property.components.length; i++) {
|
||||
var component = property.components[i];
|
||||
var descriptor = compactable[component.name];
|
||||
var canOverride = descriptor && descriptor.canOverride || canOverride.sameValue;
|
||||
|
||||
var _component = shallowClone(component);
|
||||
_component.value = [[Token.PROPERTY_VALUE, descriptor.defaultValue]];
|
||||
|
||||
if (!everyValuesPair(canOverride.bind(null, validator), _component, component)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function overrideIntoMultiplex(property, by) {
|
||||
by.unused = true;
|
||||
|
||||
turnIntoMultiplex(by, multiplexSize(property));
|
||||
property.value = by.value;
|
||||
}
|
||||
|
||||
function overrideByMultiplex(property, by) {
|
||||
by.unused = true;
|
||||
property.multiplex = true;
|
||||
property.value = by.value;
|
||||
}
|
||||
|
||||
function overrideSimple(property, by) {
|
||||
by.unused = true;
|
||||
property.value = by.value;
|
||||
}
|
||||
|
||||
function override(property, by) {
|
||||
if (by.multiplex)
|
||||
overrideByMultiplex(property, by);
|
||||
else if (property.multiplex)
|
||||
overrideIntoMultiplex(property, by);
|
||||
else
|
||||
overrideSimple(property, by);
|
||||
}
|
||||
|
||||
function overrideShorthand(property, by) {
|
||||
by.unused = true;
|
||||
|
||||
for (var i = 0, l = property.components.length; i < l; i++) {
|
||||
override(property.components[i], by.components[i], property.multiplex);
|
||||
}
|
||||
}
|
||||
|
||||
function turnIntoMultiplex(property, size) {
|
||||
property.multiplex = true;
|
||||
|
||||
if (compactable[property.name].shorthand) {
|
||||
turnShorthandValueIntoMultiplex(property, size);
|
||||
} else {
|
||||
turnLonghandValueIntoMultiplex(property, size);
|
||||
}
|
||||
}
|
||||
|
||||
function turnShorthandValueIntoMultiplex(property, size) {
|
||||
var component;
|
||||
var i, l;
|
||||
|
||||
for (i = 0, l = property.components.length; i < l; i++) {
|
||||
component = property.components[i];
|
||||
|
||||
if (!component.multiplex) {
|
||||
turnLonghandValueIntoMultiplex(component, size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function turnLonghandValueIntoMultiplex(property, size) {
|
||||
var descriptor = compactable[property.name];
|
||||
var withRealValue = descriptor.intoMultiplexMode == 'real';
|
||||
var withValue = descriptor.intoMultiplexMode == 'real' ?
|
||||
property.value.slice(0) :
|
||||
(descriptor.intoMultiplexMode == 'placeholder' ? descriptor.placeholderValue : descriptor.defaultValue);
|
||||
var i = multiplexSize(property);
|
||||
var j;
|
||||
var m = withValue.length;
|
||||
|
||||
for (; i < size; i++) {
|
||||
property.value.push([Token.PROPERTY_VALUE, Marker.COMMA]);
|
||||
|
||||
if (Array.isArray(withValue)) {
|
||||
for (j = 0; j < m; j++) {
|
||||
property.value.push(withRealValue ? withValue[j] : [Token.PROPERTY_VALUE, withValue[j]]);
|
||||
}
|
||||
} else {
|
||||
property.value.push(withRealValue ? withValue : [Token.PROPERTY_VALUE, withValue]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function multiplexSize(component) {
|
||||
var size = 0;
|
||||
|
||||
for (var i = 0, l = component.value.length; i < l; i++) {
|
||||
if (component.value[i][1] == Marker.COMMA)
|
||||
size++;
|
||||
}
|
||||
|
||||
return size + 1;
|
||||
}
|
||||
|
||||
function lengthOf(property) {
|
||||
var fakeAsArray = [
|
||||
Token.PROPERTY,
|
||||
[Token.PROPERTY_NAME, property.name]
|
||||
].concat(property.value);
|
||||
return serializeProperty([fakeAsArray], 0).length;
|
||||
}
|
||||
|
||||
function moreSameShorthands(properties, startAt, name) {
|
||||
// Since we run the main loop in `compactOverrides` backwards, at this point some
|
||||
// properties may not be marked as unused.
|
||||
// We should consider reverting the order if possible
|
||||
var count = 0;
|
||||
|
||||
for (var i = startAt; i >= 0; i--) {
|
||||
if (properties[i].name == name && !properties[i].unused)
|
||||
count++;
|
||||
if (count > 1)
|
||||
break;
|
||||
}
|
||||
|
||||
return count > 1;
|
||||
}
|
||||
|
||||
function overridingFunction(shorthand, validator) {
|
||||
for (var i = 0, l = shorthand.components.length; i < l; i++) {
|
||||
if (!anyValue(validator.isUrl, shorthand.components[i]) && anyValue(validator.isFunction, shorthand.components[i])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function anyValue(fn, property) {
|
||||
for (var i = 0, l = property.value.length; i < l; i++) {
|
||||
if (property.value[i][1] == Marker.COMMA)
|
||||
continue;
|
||||
|
||||
if (fn(property.value[i][1]))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function wouldResultInLongerValue(left, right) {
|
||||
if (!left.multiplex && !right.multiplex || left.multiplex && right.multiplex)
|
||||
return false;
|
||||
|
||||
var multiplex = left.multiplex ? left : right;
|
||||
var simple = left.multiplex ? right : left;
|
||||
var component;
|
||||
|
||||
var multiplexClone = deepClone(multiplex);
|
||||
restoreFromOptimizing([multiplexClone], restoreWithComponents);
|
||||
|
||||
var simpleClone = deepClone(simple);
|
||||
restoreFromOptimizing([simpleClone], restoreWithComponents);
|
||||
|
||||
var lengthBefore = lengthOf(multiplexClone) + 1 + lengthOf(simpleClone);
|
||||
|
||||
if (left.multiplex) {
|
||||
component = findComponentIn(multiplexClone, simpleClone);
|
||||
overrideIntoMultiplex(component, simpleClone);
|
||||
} else {
|
||||
component = findComponentIn(simpleClone, multiplexClone);
|
||||
turnIntoMultiplex(simpleClone, multiplexSize(multiplexClone));
|
||||
overrideByMultiplex(component, multiplexClone);
|
||||
}
|
||||
|
||||
restoreFromOptimizing([simpleClone], restoreWithComponents);
|
||||
|
||||
var lengthAfter = lengthOf(simpleClone);
|
||||
|
||||
return lengthBefore <= lengthAfter;
|
||||
}
|
||||
|
||||
function isCompactable(property) {
|
||||
return property.name in compactable;
|
||||
}
|
||||
|
||||
function noneOverrideHack(left, right) {
|
||||
return !left.multiplex &&
|
||||
(left.name == 'background' || left.name == 'background-image') &&
|
||||
right.multiplex &&
|
||||
(right.name == 'background' || right.name == 'background-image') &&
|
||||
anyLayerIsNone(right.value);
|
||||
}
|
||||
|
||||
function anyLayerIsNone(values) {
|
||||
var layers = intoLayers(values);
|
||||
|
||||
for (var i = 0, l = layers.length; i < l; i++) {
|
||||
if (layers[i].length == 1 && layers[i][0][1] == 'none')
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function intoLayers(values) {
|
||||
var layers = [];
|
||||
|
||||
for (var i = 0, layer = [], l = values.length; i < l; i++) {
|
||||
var value = values[i];
|
||||
if (value[1] == Marker.COMMA) {
|
||||
layers.push(layer);
|
||||
layer = [];
|
||||
} else {
|
||||
layer.push(value);
|
||||
}
|
||||
}
|
||||
|
||||
layers.push(layer);
|
||||
return layers;
|
||||
}
|
||||
|
||||
function overrideProperties(properties, withMerging, compatibility, validator) {
|
||||
var mayOverride, right, left, component;
|
||||
var overriddenComponents;
|
||||
var overriddenComponent;
|
||||
var overridingComponent;
|
||||
var overridable;
|
||||
var i, j, k;
|
||||
|
||||
propertyLoop:
|
||||
for (i = properties.length - 1; i >= 0; i--) {
|
||||
right = properties[i];
|
||||
|
||||
if (!isCompactable(right))
|
||||
continue;
|
||||
|
||||
if (right.block)
|
||||
continue;
|
||||
|
||||
mayOverride = compactable[right.name].canOverride;
|
||||
|
||||
traverseLoop:
|
||||
for (j = i - 1; j >= 0; j--) {
|
||||
left = properties[j];
|
||||
|
||||
if (!isCompactable(left))
|
||||
continue;
|
||||
|
||||
if (left.block)
|
||||
continue;
|
||||
|
||||
if (left.unused || right.unused)
|
||||
continue;
|
||||
|
||||
if (left.hack && !right.hack && !right.important || !left.hack && !left.important && right.hack)
|
||||
continue;
|
||||
|
||||
if (left.important == right.important && left.hack[0] != right.hack[0])
|
||||
continue;
|
||||
|
||||
if (left.important == right.important && (left.hack[0] != right.hack[0] || (left.hack[1] && left.hack[1] != right.hack[1])))
|
||||
continue;
|
||||
|
||||
if (hasInherit(right))
|
||||
continue;
|
||||
|
||||
if (noneOverrideHack(left, right))
|
||||
continue;
|
||||
|
||||
if (right.shorthand && isComponentOf(right, left)) {
|
||||
// maybe `left` can be overridden by `right` which is a shorthand?
|
||||
if (!right.important && left.important)
|
||||
continue;
|
||||
|
||||
if (!sameVendorPrefixesIn([left], right.components))
|
||||
continue;
|
||||
|
||||
if (!anyValue(validator.isFunction, left) && overridingFunction(right, validator))
|
||||
continue;
|
||||
|
||||
if (!isMergeableShorthand(right)) {
|
||||
left.unused = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
component = findComponentIn(right, left);
|
||||
mayOverride = compactable[left.name].canOverride;
|
||||
if (everyValuesPair(mayOverride.bind(null, validator), left, component)) {
|
||||
left.unused = true;
|
||||
}
|
||||
} else if (right.shorthand && overridesNonComponentShorthand(right, left)) {
|
||||
// `right` is a shorthand while `left` can be overriden by it, think `border` and `border-top`
|
||||
if (!right.important && left.important) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!sameVendorPrefixesIn([left], right.components)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!anyValue(validator.isFunction, left) && overridingFunction(right, validator)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
overriddenComponents = left.shorthand ?
|
||||
left.components:
|
||||
[left];
|
||||
|
||||
for (k = overriddenComponents.length - 1; k >= 0; k--) {
|
||||
overriddenComponent = overriddenComponents[k];
|
||||
overridingComponent = findComponentIn(right, overriddenComponent);
|
||||
mayOverride = compactable[overriddenComponent.name].canOverride;
|
||||
|
||||
if (!everyValuesPair(mayOverride.bind(null, validator), left, overridingComponent)) {
|
||||
continue traverseLoop;
|
||||
}
|
||||
}
|
||||
|
||||
left.unused = true;
|
||||
} else if (withMerging && left.shorthand && !right.shorthand && isComponentOf(left, right, true)) {
|
||||
// maybe `right` can be pulled into `left` which is a shorthand?
|
||||
if (right.important && !left.important)
|
||||
continue;
|
||||
|
||||
if (!right.important && left.important) {
|
||||
right.unused = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Pending more clever algorithm in #527
|
||||
if (moreSameShorthands(properties, i - 1, left.name))
|
||||
continue;
|
||||
|
||||
if (overridingFunction(left, validator))
|
||||
continue;
|
||||
|
||||
if (!isMergeableShorthand(left))
|
||||
continue;
|
||||
|
||||
component = findComponentIn(left, right);
|
||||
if (everyValuesPair(mayOverride.bind(null, validator), component, right)) {
|
||||
var disabledBackgroundMerging =
|
||||
!compatibility.properties.backgroundClipMerging && component.name.indexOf('background-clip') > -1 ||
|
||||
!compatibility.properties.backgroundOriginMerging && component.name.indexOf('background-origin') > -1 ||
|
||||
!compatibility.properties.backgroundSizeMerging && component.name.indexOf('background-size') > -1;
|
||||
var nonMergeableValue = compactable[right.name].nonMergeableValue === right.value[0][1];
|
||||
|
||||
if (disabledBackgroundMerging || nonMergeableValue)
|
||||
continue;
|
||||
|
||||
if (!compatibility.properties.merging && wouldBreakCompatibility(left, validator))
|
||||
continue;
|
||||
|
||||
if (component.value[0][1] != right.value[0][1] && (hasInherit(left) || hasInherit(right)))
|
||||
continue;
|
||||
|
||||
if (wouldResultInLongerValue(left, right))
|
||||
continue;
|
||||
|
||||
if (!left.multiplex && right.multiplex)
|
||||
turnIntoMultiplex(left, multiplexSize(right));
|
||||
|
||||
override(component, right);
|
||||
left.dirty = true;
|
||||
}
|
||||
} else if (withMerging && left.shorthand && right.shorthand && left.name == right.name) {
|
||||
// merge if all components can be merged
|
||||
|
||||
if (!left.multiplex && right.multiplex)
|
||||
continue;
|
||||
|
||||
if (!right.important && left.important) {
|
||||
right.unused = true;
|
||||
continue propertyLoop;
|
||||
}
|
||||
|
||||
if (right.important && !left.important) {
|
||||
left.unused = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isMergeableShorthand(right)) {
|
||||
left.unused = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
for (k = left.components.length - 1; k >= 0; k--) {
|
||||
var leftComponent = left.components[k];
|
||||
var rightComponent = right.components[k];
|
||||
|
||||
mayOverride = compactable[leftComponent.name].canOverride;
|
||||
if (!everyValuesPair(mayOverride.bind(null, validator), leftComponent, rightComponent))
|
||||
continue propertyLoop;
|
||||
}
|
||||
|
||||
overrideShorthand(left, right);
|
||||
left.dirty = true;
|
||||
} else if (withMerging && left.shorthand && right.shorthand && isComponentOf(left, right)) {
|
||||
// border is a shorthand but any of its components is a shorthand too
|
||||
|
||||
if (!left.important && right.important)
|
||||
continue;
|
||||
|
||||
component = findComponentIn(left, right);
|
||||
mayOverride = compactable[right.name].canOverride;
|
||||
if (!everyValuesPair(mayOverride.bind(null, validator), component, right))
|
||||
continue;
|
||||
|
||||
if (left.important && !right.important) {
|
||||
right.unused = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
var rightRestored = compactable[right.name].restore(right, compactable);
|
||||
if (rightRestored.length > 1)
|
||||
continue;
|
||||
|
||||
component = findComponentIn(left, right);
|
||||
override(component, right);
|
||||
right.dirty = true;
|
||||
} else if (left.name == right.name) {
|
||||
// two non-shorthands should be merged based on understandability
|
||||
overridable = true;
|
||||
|
||||
if (right.shorthand) {
|
||||
for (k = right.components.length - 1; k >= 0 && overridable; k--) {
|
||||
overriddenComponent = left.components[k];
|
||||
overridingComponent = right.components[k];
|
||||
mayOverride = compactable[overridingComponent.name].canOverride;
|
||||
|
||||
overridable = overridable && everyValuesPair(mayOverride.bind(null, validator), overriddenComponent, overridingComponent);
|
||||
}
|
||||
} else {
|
||||
mayOverride = compactable[right.name].canOverride;
|
||||
overridable = everyValuesPair(mayOverride.bind(null, validator), left, right);
|
||||
}
|
||||
|
||||
if (left.important && !right.important && overridable) {
|
||||
right.unused = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!left.important && right.important && overridable) {
|
||||
left.unused = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!overridable) {
|
||||
continue;
|
||||
}
|
||||
|
||||
left.unused = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = overrideProperties;
|
||||
@@ -0,0 +1,28 @@
|
||||
import { ASTNode, Type, AnyType, Field } from "./lib/types";
|
||||
import { NodePath } from "./lib/node-path";
|
||||
import { namedTypes } from "./gen/namedTypes";
|
||||
import { builders } from "./gen/builders";
|
||||
import { Visitor } from "./gen/visitor";
|
||||
declare const astNodesAreEquivalent: {
|
||||
(a: any, b: any, problemPath?: any): boolean;
|
||||
assert(a: any, b: any): void;
|
||||
}, builders: builders, builtInTypes: {
|
||||
string: Type<string>;
|
||||
function: Type<Function>;
|
||||
array: Type<any[]>;
|
||||
object: Type<{
|
||||
[key: string]: any;
|
||||
}>;
|
||||
RegExp: Type<RegExp>;
|
||||
Date: Type<Date>;
|
||||
number: Type<number>;
|
||||
boolean: Type<boolean>;
|
||||
null: Type<null>;
|
||||
undefined: Type<undefined>;
|
||||
}, defineMethod: (name: any, func?: Function | undefined) => Function, eachField: (object: any, callback: (name: any, value: any) => any, context?: any) => void, finalize: () => void, getBuilderName: (typeName: any) => any, getFieldNames: (object: any) => string[], getFieldValue: (object: any, fieldName: any) => any, getSupertypeNames: (typeName: string) => string[], NodePath: import("./lib/node-path").NodePathConstructor, Path: import("./lib/path").PathConstructor, PathVisitor: import("./lib/path-visitor").PathVisitorConstructor, someField: (object: any, callback: (name: any, value: any) => any, context?: any) => boolean, Type: {
|
||||
or(...types: any[]): Type<any>;
|
||||
from<T>(value: any, name?: string | undefined): Type<T>;
|
||||
def(typeName: string): import("./lib/types").Def<any>;
|
||||
hasDef(typeName: string): boolean;
|
||||
}, use: <T>(plugin: import("./types").Plugin<T>) => T, visit: <M = {}>(node: ASTNode, methods?: Visitor<M> | undefined) => any;
|
||||
export { AnyType, ASTNode, astNodesAreEquivalent, builders, builtInTypes, defineMethod, eachField, Field, finalize, getBuilderName, getFieldNames, getFieldValue, getSupertypeNames, namedTypes, NodePath, Path, PathVisitor, someField, Type, use, visit, Visitor, };
|
||||
@@ -0,0 +1,2 @@
|
||||
if(typeof cptable === 'undefined') cptable = {};
|
||||
cptable[21025] = (function(){ var d = "\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a ђѓёєѕіїј[.<(+!&љњћќўџЪ№Ђ]$*);^-/ЃЁЄЅІЇЈЉ|,%_>?ЊЋЌЎЏюаб`:#@'=\"цabcdefghiдефгхийjklmnopqrклмнопя~stuvwxyzрстужвьызшэщчъЮАБЦДЕФГ{ABCDEFGHIХИЙКЛМ}JKLMNOPQRНОПЯРС\\§STUVWXYZТУЖВЬЫ0123456789ЗШЭЩЧ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
@@ -0,0 +1,2 @@
|
||||
declare function isThenable(value: any): boolean;
|
||||
export default isThenable;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"P Q R S T U V W","2":"C K L G M N O","1025":"X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h EC FC","260":"lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB"},D:{"1":"lB mB nB oB pB P Q R S T U V W","2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB","132":"ZB vB aB bB cB dB eB fB gB hB iB jB kB h","1025":"X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"2":"I v J D E F A B HC zB IC JC KC LC 0B","772":"C K L G qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"1":"aB bB cB dB eB fB gB hB iB jB kB h lB","2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB PC QC RC SC qB AC TC rB","132":"NB OB PB QB RB SB TB UB VB WB XB YB ZB","1025":"mB nB oB pB P Q R wB S T U V W X Y Z a b c d e"},G:{"2":"E zB UC BC VC WC XC YC ZC aC bC cC dC","772":"eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"2":"A B C qB AC rB","1025":"h"},L:{"1025":"H"},M:{"260":"H"},N:{"2":"A B"},O:{"2":"vC"},P:{"1":"g 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I wC xC yC","132":"zC 0C 0B"},Q:{"132":"1B"},R:{"1025":"9C"},S:{"2":"AD","260":"BD"}},B:7,C:"Feature Policy"};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Action.js","sourceRoot":"","sources":["../../../../src/internal/scheduler/Action.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAiB/C;IAA+B,0BAAY;IACzC,gBAAY,SAAoB,EAAE,IAAmD;eACnF,iBAAO;IACT,CAAC;IAWM,yBAAQ,GAAf,UAAgB,KAAS,EAAE,KAAiB;QAAjB,sBAAA,EAAA,SAAiB;QAC1C,OAAO,IAAI,CAAC;IACd,CAAC;IACH,aAAC;AAAD,CAAC,AAjBD,CAA+B,YAAY,GAiB1C"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"auditTime.js","sourceRoot":"","sources":["../../../../src/internal/operators/auditTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAkD5C,MAAM,UAAU,SAAS,CAAI,QAAgB,EAAE,SAAyC;IAAzC,0BAAA,EAAA,0BAAyC;IACtF,OAAO,KAAK,CAAC,cAAM,OAAA,KAAK,CAAC,QAAQ,EAAE,SAAS,CAAC,EAA1B,CAA0B,CAAC,CAAC;AACjD,CAAC"}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"name": "ms",
|
||||
"version": "2.1.2",
|
||||
"description": "Tiny millisecond conversion utility",
|
||||
"repository": "zeit/ms",
|
||||
"main": "./index",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"scripts": {
|
||||
"precommit": "lint-staged",
|
||||
"lint": "eslint lib/* bin/*",
|
||||
"test": "mocha tests.js"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "eslint:recommended",
|
||||
"env": {
|
||||
"node": true,
|
||||
"es6": true
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"npm run lint",
|
||||
"prettier --single-quote --write",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"eslint": "4.12.1",
|
||||
"expect.js": "0.3.1",
|
||||
"husky": "0.14.3",
|
||||
"lint-staged": "5.0.0",
|
||||
"mocha": "4.0.1"
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,83 @@
|
||||
import { timeData } from './time-data.generated';
|
||||
/**
|
||||
* Returns the best matching date time pattern if a date time skeleton
|
||||
* pattern is provided with a locale. Follows the Unicode specification:
|
||||
* https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns
|
||||
* @param skeleton date time skeleton pattern that possibly includes j, J or C
|
||||
* @param locale
|
||||
*/
|
||||
export function getBestPattern(skeleton, locale) {
|
||||
var skeletonCopy = '';
|
||||
for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {
|
||||
var patternChar = skeleton.charAt(patternPos);
|
||||
if (patternChar === 'j') {
|
||||
var extraLength = 0;
|
||||
while (patternPos + 1 < skeleton.length &&
|
||||
skeleton.charAt(patternPos + 1) === patternChar) {
|
||||
extraLength++;
|
||||
patternPos++;
|
||||
}
|
||||
var hourLen = 1 + (extraLength & 1);
|
||||
var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);
|
||||
var dayPeriodChar = 'a';
|
||||
var hourChar = getDefaultHourSymbolFromLocale(locale);
|
||||
if (hourChar == 'H' || hourChar == 'k') {
|
||||
dayPeriodLen = 0;
|
||||
}
|
||||
while (dayPeriodLen-- > 0) {
|
||||
skeletonCopy += dayPeriodChar;
|
||||
}
|
||||
while (hourLen-- > 0) {
|
||||
skeletonCopy = hourChar + skeletonCopy;
|
||||
}
|
||||
}
|
||||
else if (patternChar === 'J') {
|
||||
skeletonCopy += 'H';
|
||||
}
|
||||
else {
|
||||
skeletonCopy += patternChar;
|
||||
}
|
||||
}
|
||||
return skeletonCopy;
|
||||
}
|
||||
/**
|
||||
* Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)
|
||||
* of the given `locale` to the corresponding time pattern.
|
||||
* @param locale
|
||||
*/
|
||||
function getDefaultHourSymbolFromLocale(locale) {
|
||||
var hourCycle = locale.hourCycle;
|
||||
if (hourCycle === undefined &&
|
||||
// @ts-ignore hourCycle(s) is not identified yet
|
||||
locale.hourCycles &&
|
||||
// @ts-ignore
|
||||
locale.hourCycles.length) {
|
||||
// @ts-ignore
|
||||
hourCycle = locale.hourCycles[0];
|
||||
}
|
||||
if (hourCycle) {
|
||||
switch (hourCycle) {
|
||||
case 'h24':
|
||||
return 'k';
|
||||
case 'h23':
|
||||
return 'H';
|
||||
case 'h12':
|
||||
return 'h';
|
||||
case 'h11':
|
||||
return 'K';
|
||||
default:
|
||||
throw new Error('Invalid hourCycle');
|
||||
}
|
||||
}
|
||||
// TODO: Once hourCycle is fully supported remove the following with data generation
|
||||
var languageTag = locale.language;
|
||||
var regionTag;
|
||||
if (languageTag !== 'root') {
|
||||
regionTag = locale.maximize().region;
|
||||
}
|
||||
var hourCycles = timeData[regionTag || ''] ||
|
||||
timeData[languageTag || ''] ||
|
||||
timeData["".concat(languageTag, "-001")] ||
|
||||
timeData['001'];
|
||||
return hourCycles[0];
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"regex.generated.d.ts","sourceRoot":"","sources":["../../../../../../packages/icu-messageformat-parser/regex.generated.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,qBAAqB,QAAiD,CAAA;AACnF,eAAO,MAAM,iBAAiB,QAAyC,CAAA"}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","2":"C K L","578":"G"},C:{"1":"TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB EC FC","194":"NB OB PB QB RB","1025":"SB"},D:{"1":"XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB","322":"RB SB TB UB VB WB"},E:{"1":"B C K L G qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E F A HC zB IC JC KC LC 0B"},F:{"1":"KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB PC QC RC SC qB AC TC rB","322":"EB FB GB HB IB JB"},G:{"1":"dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC ZC aC bC cC"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"g yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I wC xC"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"BD","194":"AD"}},B:6,C:"WebAssembly"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../../../../../packages/intl-messageformat/src/formatters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAWL,oBAAoB,EAGrB,MAAM,oCAAoC,CAAA;AAS3C,MAAM,WAAW,OAAO;IACtB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;IAC3C,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAA;IAChD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAA;CACjD;AAED,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAA;IAC3C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,cAAc,CAAC,CAAA;IAC7C,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAA;CAC9C;AAED,MAAM,WAAW,UAAU;IACzB,eAAe,CACb,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,IAAI,CAAC,EAAE,mBAAmB,GACzB,IAAI,CAAC,YAAY,CAAA;IACpB,iBAAiB,CACf,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,IAAI,CAAC,cAAc,CAAC,GACzD,IAAI,CAAC,cAAc,CAAA;IACtB,cAAc,CACZ,GAAG,IAAI,EAAE,qBAAqB,CAAC,OAAO,IAAI,CAAC,WAAW,CAAC,GACtD,IAAI,CAAC,WAAW,CAAA;CACpB;AAED,oBAAY,SAAS;IACnB,OAAO,IAAA;IACP,MAAM,IAAA;CACP;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,SAAS,CAAC,OAAO,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,UAAU,CAAC,CAAC,GAAG,GAAG;IACjC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAA;IACtB,KAAK,EAAE,CAAC,CAAA;CACT;AAED,oBAAY,iBAAiB,CAAC,CAAC,IAAI,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;AAE9D,oBAAY,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAA;AAuB/E,wBAAgB,oBAAoB,CAAC,CAAC,EACpC,EAAE,EAAE,aAAa,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,GAC5C,EAAE,IAAI,kBAAkB,CAAC,CAAC,CAAC,CAE7B;AAGD,wBAAgB,aAAa,CAAC,CAAC,EAC7B,GAAG,EAAE,oBAAoB,EAAE,EAC3B,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,EAC1B,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,GAAG,CAAC,GAAG,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAClE,kBAAkB,CAAC,EAAE,MAAM,EAE3B,eAAe,CAAC,EAAE,MAAM,GACvB,iBAAiB,CAAC,CAAC,CAAC,EAAE,CA6LxB;AAED,oBAAY,kBAAkB,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,CACtE,KAAK,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KACrB,CAAC,CAAA"}
|
||||
@@ -0,0 +1,277 @@
|
||||
import { parseColor } from './color'
|
||||
import { parseBoxShadowValue } from './parseBoxShadowValue'
|
||||
import { splitAtTopLevelOnly } from './splitAtTopLevelOnly'
|
||||
|
||||
let cssFunctions = ['min', 'max', 'clamp', 'calc']
|
||||
|
||||
// Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Types
|
||||
|
||||
function isCSSFunction(value) {
|
||||
return cssFunctions.some((fn) => new RegExp(`^${fn}\\(.*\\)`).test(value))
|
||||
}
|
||||
|
||||
const placeholder = '--tw-placeholder'
|
||||
const placeholderRe = new RegExp(placeholder, 'g')
|
||||
|
||||
// This is not a data type, but rather a function that can normalize the
|
||||
// correct values.
|
||||
export function normalize(value, isRoot = true) {
|
||||
// Keep raw strings if it starts with `url(`
|
||||
if (value.includes('url(')) {
|
||||
return value
|
||||
.split(/(url\(.*?\))/g)
|
||||
.filter(Boolean)
|
||||
.map((part) => {
|
||||
if (/^url\(.*?\)$/.test(part)) {
|
||||
return part
|
||||
}
|
||||
|
||||
return normalize(part, false)
|
||||
})
|
||||
.join('')
|
||||
}
|
||||
|
||||
// Convert `_` to ` `, except for escaped underscores `\_`
|
||||
value = value
|
||||
.replace(
|
||||
/([^\\])_+/g,
|
||||
(fullMatch, characterBefore) => characterBefore + ' '.repeat(fullMatch.length - 1)
|
||||
)
|
||||
.replace(/^_/g, ' ')
|
||||
.replace(/\\_/g, '_')
|
||||
|
||||
// Remove leftover whitespace
|
||||
if (isRoot) {
|
||||
value = value.trim()
|
||||
}
|
||||
|
||||
// Add spaces around operators inside math functions like calc() that do not follow an operator
|
||||
// or '('.
|
||||
value = value.replace(/(calc|min|max|clamp)\(.+\)/g, (match) => {
|
||||
let vars = []
|
||||
return match
|
||||
.replace(/var\((--.+?)[,)]/g, (match, g1) => {
|
||||
vars.push(g1)
|
||||
return match.replace(g1, placeholder)
|
||||
})
|
||||
.replace(/(-?\d*\.?\d(?!\b-\d.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, '$1 $2 ')
|
||||
.replace(placeholderRe, () => vars.shift())
|
||||
})
|
||||
|
||||
return value
|
||||
}
|
||||
|
||||
export function url(value) {
|
||||
return value.startsWith('url(')
|
||||
}
|
||||
|
||||
export function number(value) {
|
||||
return !isNaN(Number(value)) || isCSSFunction(value)
|
||||
}
|
||||
|
||||
export function percentage(value) {
|
||||
return (value.endsWith('%') && number(value.slice(0, -1))) || isCSSFunction(value)
|
||||
}
|
||||
|
||||
// Please refer to MDN when updating this list:
|
||||
// https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units
|
||||
// https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units
|
||||
let lengthUnits = [
|
||||
'cm',
|
||||
'mm',
|
||||
'Q',
|
||||
'in',
|
||||
'pc',
|
||||
'pt',
|
||||
'px',
|
||||
'em',
|
||||
'ex',
|
||||
'ch',
|
||||
'rem',
|
||||
'lh',
|
||||
'rlh',
|
||||
'vw',
|
||||
'vh',
|
||||
'vmin',
|
||||
'vmax',
|
||||
'vb',
|
||||
'vi',
|
||||
'svw',
|
||||
'svh',
|
||||
'lvw',
|
||||
'lvh',
|
||||
'dvw',
|
||||
'dvh',
|
||||
'cqw',
|
||||
'cqh',
|
||||
'cqi',
|
||||
'cqb',
|
||||
'cqmin',
|
||||
'cqmax',
|
||||
]
|
||||
let lengthUnitsPattern = `(?:${lengthUnits.join('|')})`
|
||||
export function length(value) {
|
||||
return (
|
||||
value === '0' ||
|
||||
new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) ||
|
||||
isCSSFunction(value)
|
||||
)
|
||||
}
|
||||
|
||||
let lineWidths = new Set(['thin', 'medium', 'thick'])
|
||||
export function lineWidth(value) {
|
||||
return lineWidths.has(value)
|
||||
}
|
||||
|
||||
export function shadow(value) {
|
||||
let parsedShadows = parseBoxShadowValue(normalize(value))
|
||||
|
||||
for (let parsedShadow of parsedShadows) {
|
||||
if (!parsedShadow.valid) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
export function color(value) {
|
||||
let colors = 0
|
||||
|
||||
let result = splitAtTopLevelOnly(value, '_').every((part) => {
|
||||
part = normalize(part)
|
||||
|
||||
if (part.startsWith('var(')) return true
|
||||
if (parseColor(part, { loose: true }) !== null) return colors++, true
|
||||
|
||||
return false
|
||||
})
|
||||
|
||||
if (!result) return false
|
||||
return colors > 0
|
||||
}
|
||||
|
||||
export function image(value) {
|
||||
let images = 0
|
||||
let result = splitAtTopLevelOnly(value, ',').every((part) => {
|
||||
part = normalize(part)
|
||||
|
||||
if (part.startsWith('var(')) return true
|
||||
if (
|
||||
url(part) ||
|
||||
gradient(part) ||
|
||||
['element(', 'image(', 'cross-fade(', 'image-set('].some((fn) => part.startsWith(fn))
|
||||
) {
|
||||
images++
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
})
|
||||
|
||||
if (!result) return false
|
||||
return images > 0
|
||||
}
|
||||
|
||||
let gradientTypes = new Set([
|
||||
'linear-gradient',
|
||||
'radial-gradient',
|
||||
'repeating-linear-gradient',
|
||||
'repeating-radial-gradient',
|
||||
'conic-gradient',
|
||||
])
|
||||
export function gradient(value) {
|
||||
value = normalize(value)
|
||||
|
||||
for (let type of gradientTypes) {
|
||||
if (value.startsWith(`${type}(`)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
let validPositions = new Set(['center', 'top', 'right', 'bottom', 'left'])
|
||||
export function position(value) {
|
||||
let positions = 0
|
||||
let result = splitAtTopLevelOnly(value, '_').every((part) => {
|
||||
part = normalize(part)
|
||||
|
||||
if (part.startsWith('var(')) return true
|
||||
if (validPositions.has(part) || length(part) || percentage(part)) {
|
||||
positions++
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
})
|
||||
|
||||
if (!result) return false
|
||||
return positions > 0
|
||||
}
|
||||
|
||||
export function familyName(value) {
|
||||
let fonts = 0
|
||||
let result = splitAtTopLevelOnly(value, ',').every((part) => {
|
||||
part = normalize(part)
|
||||
|
||||
if (part.startsWith('var(')) return true
|
||||
|
||||
// If it contains spaces, then it should be quoted
|
||||
if (part.includes(' ')) {
|
||||
if (!/(['"])([^"']+)\1/g.test(part)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// If it starts with a number, it's invalid
|
||||
if (/^\d/g.test(part)) {
|
||||
return false
|
||||
}
|
||||
|
||||
fonts++
|
||||
|
||||
return true
|
||||
})
|
||||
|
||||
if (!result) return false
|
||||
return fonts > 0
|
||||
}
|
||||
|
||||
let genericNames = new Set([
|
||||
'serif',
|
||||
'sans-serif',
|
||||
'monospace',
|
||||
'cursive',
|
||||
'fantasy',
|
||||
'system-ui',
|
||||
'ui-serif',
|
||||
'ui-sans-serif',
|
||||
'ui-monospace',
|
||||
'ui-rounded',
|
||||
'math',
|
||||
'emoji',
|
||||
'fangsong',
|
||||
])
|
||||
export function genericName(value) {
|
||||
return genericNames.has(value)
|
||||
}
|
||||
|
||||
let absoluteSizes = new Set([
|
||||
'xx-small',
|
||||
'x-small',
|
||||
'small',
|
||||
'medium',
|
||||
'large',
|
||||
'x-large',
|
||||
'x-large',
|
||||
'xxx-large',
|
||||
])
|
||||
export function absoluteSize(value) {
|
||||
return absoluteSizes.has(value)
|
||||
}
|
||||
|
||||
let relativeSizes = new Set(['larger', 'smaller'])
|
||||
export function relativeSize(value) {
|
||||
return relativeSizes.has(value)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
@tailwind base;
|
||||
|
||||
@tailwind components;
|
||||
|
||||
@tailwind utilities;
|
||||
@@ -0,0 +1,12 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $String = GetIntrinsic('%String%');
|
||||
|
||||
// http://262.ecma-international.org/5.1/#sec-9.8
|
||||
|
||||
module.exports = function ToString(value) {
|
||||
return $String(value);
|
||||
};
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import Renderer from '../Renderer';
|
||||
import Block from '../Block';
|
||||
import Text from '../../nodes/Text';
|
||||
import Wrapper from './shared/Wrapper';
|
||||
import { Identifier } from 'estree';
|
||||
export default class TextWrapper extends Wrapper {
|
||||
node: Text;
|
||||
data: string;
|
||||
skip: boolean;
|
||||
var: Identifier;
|
||||
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: Text, data: string);
|
||||
use_space(): boolean;
|
||||
render(block: Block, parent_node: Identifier, parent_nodes: Identifier): void;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"A B","2":"J D E CC","132":"F"},B:{"1":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB EC FC"},D:{"1":"8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"0 1 2 3 4 5 6 7 I v J D E F A B C K L G M N O w g x y z"},E:{"1":"D E F A B C K L G KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J HC zB IC JC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e RC SC qB AC TC rB","2":"F G M N O PC QC"},G:{"1":"E XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"zB UC BC VC WC"},H:{"1":"oC"},I:{"1":"f tC uC","2":"tB I pC qC rC sC BC"},J:{"1":"A","2":"D"},K:{"1":"B C h qB AC rB","2":"A"},L:{"1":"H"},M:{"1":"H"},N:{"1":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"BD","2":"AD"}},B:4,C:"CSS background-repeat round and space"};
|
||||
@@ -0,0 +1,310 @@
|
||||
#!/usr/bin/env node
|
||||
/* xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
||||
/* eslint-env node */
|
||||
/* vim: set ts=2 ft=javascript: */
|
||||
var n = "xlsx";
|
||||
var X = require('../');
|
||||
try { X = require('../xlsx.flow'); } catch(e) {}
|
||||
try { require('exit-on-epipe'); } catch(e) {}
|
||||
var fs = require('fs'), program;
|
||||
try { program = require('commander'); } catch(e) {
|
||||
[
|
||||
"The `xlsx` command line tool is deprecated in favor of `xlsx-cli`.",
|
||||
"",
|
||||
"For new versions of node, we recommend using `npx`:",
|
||||
" $ npx xlsx-cli --help",
|
||||
"",
|
||||
"For older versions of node, explicitly install `xlsx-cli` globally:",
|
||||
" $ npm i -g xlsx-cli",
|
||||
" $ xlsx-cli --help"
|
||||
].forEach(function(m) { console.error(m); });
|
||||
process.exit(1);
|
||||
}
|
||||
program
|
||||
.version(X.version)
|
||||
.usage('[options] <file> [sheetname]')
|
||||
.option('-f, --file <file>', 'use specified workbook')
|
||||
.option('-s, --sheet <sheet>', 'print specified sheet (default first sheet)')
|
||||
.option('-N, --sheet-index <idx>', 'use specified sheet index (0-based)')
|
||||
.option('-p, --password <pw>', 'if file is encrypted, try with specified pw')
|
||||
.option('-l, --list-sheets', 'list sheet names and exit')
|
||||
.option('-o, --output <file>', 'output to specified file')
|
||||
|
||||
.option('-B, --xlsb', 'emit XLSB to <sheetname> or <file>.xlsb')
|
||||
.option('-M, --xlsm', 'emit XLSM to <sheetname> or <file>.xlsm')
|
||||
.option('-X, --xlsx', 'emit XLSX to <sheetname> or <file>.xlsx')
|
||||
.option('-I, --xlam', 'emit XLAM to <sheetname> or <file>.xlam')
|
||||
.option('-Y, --ods', 'emit ODS to <sheetname> or <file>.ods')
|
||||
.option('-8, --xls', 'emit XLS to <sheetname> or <file>.xls (BIFF8)')
|
||||
.option('-5, --biff5','emit XLS to <sheetname> or <file>.xls (BIFF5)')
|
||||
.option('-4, --biff4','emit XLS to <sheetname> or <file>.xls (BIFF4)')
|
||||
.option('-3, --biff3','emit XLS to <sheetname> or <file>.xls (BIFF3)')
|
||||
.option('-2, --biff2','emit XLS to <sheetname> or <file>.xls (BIFF2)')
|
||||
.option('-i, --xla', 'emit XLA to <sheetname> or <file>.xla')
|
||||
.option('-6, --xlml', 'emit SSML to <sheetname> or <file>.xls (2003 XML)')
|
||||
.option('-T, --fods', 'emit FODS to <sheetname> or <file>.fods (Flat ODS)')
|
||||
.option('--wk3', 'emit WK3 to <sheetname> or <file>.txt (Lotus WK3)')
|
||||
.option('--numbers', 'emit NUMBERS to <sheetname> or <file>.numbers')
|
||||
|
||||
.option('-S, --formulae', 'emit list of values and formulae')
|
||||
.option('-j, --json', 'emit formatted JSON (all fields text)')
|
||||
.option('-J, --raw-js', 'emit raw JS object (raw numbers)')
|
||||
.option('-A, --arrays', 'emit rows as JS objects (raw numbers)')
|
||||
.option('-H, --html', 'emit HTML to <sheetname> or <file>.html')
|
||||
.option('-D, --dif', 'emit DIF to <sheetname> or <file>.dif (Lotus DIF)')
|
||||
.option('-U, --dbf', 'emit DBF to <sheetname> or <file>.dbf (MSVFP DBF)')
|
||||
.option('-K, --sylk', 'emit SYLK to <sheetname> or <file>.slk (Excel SYLK)')
|
||||
.option('-P, --prn', 'emit PRN to <sheetname> or <file>.prn (Lotus PRN)')
|
||||
.option('-E, --eth', 'emit ETH to <sheetname> or <file>.eth (Ethercalc)')
|
||||
.option('-t, --txt', 'emit TXT to <sheetname> or <file>.txt (UTF-8 TSV)')
|
||||
.option('-r, --rtf', 'emit RTF to <sheetname> or <file>.txt (Table RTF)')
|
||||
.option('--wk1', 'emit WK1 to <sheetname> or <file>.txt (Lotus WK1)')
|
||||
.option('-z, --dump', 'dump internal representation as JSON')
|
||||
.option('--props', 'dump workbook properties as CSV')
|
||||
|
||||
.option('-F, --field-sep <sep>', 'CSV field separator', ",")
|
||||
.option('-R, --row-sep <sep>', 'CSV row separator', "\n")
|
||||
.option('-n, --sheet-rows <num>', 'Number of rows to process (0=all rows)')
|
||||
.option('--codepage <cp>', 'default to specified codepage when ambiguous')
|
||||
.option('--req <module>', 'require module before processing')
|
||||
.option('--sst', 'generate shared string table for XLS* formats')
|
||||
.option('--compress', 'use compression when writing XLSX/M/B and ODS')
|
||||
.option('--read', 'read but do not generate output')
|
||||
.option('--book', 'for single-sheet formats, emit a file per worksheet')
|
||||
.option('--all', 'parse everything; write as much as possible')
|
||||
.option('--dev', 'development mode')
|
||||
.option('--sparse', 'sparse mode')
|
||||
.option('-q, --quiet', 'quiet mode');
|
||||
|
||||
program.on('--help', function() {
|
||||
console.log(' Default output format is CSV');
|
||||
console.log(' Support email: dev@sheetjs.com');
|
||||
console.log(' Web Demo: http://oss.sheetjs.com/js-'+n+'/');
|
||||
});
|
||||
|
||||
/* flag, bookType, default ext */
|
||||
var workbook_formats = [
|
||||
['xlsx', 'xlsx', 'xlsx'],
|
||||
['xlsm', 'xlsm', 'xlsm'],
|
||||
['xlam', 'xlam', 'xlam'],
|
||||
['xlsb', 'xlsb', 'xlsb'],
|
||||
['xls', 'xls', 'xls'],
|
||||
['xla', 'xla', 'xla'],
|
||||
['biff5', 'biff5', 'xls'],
|
||||
['numbers', 'numbers', 'numbers'],
|
||||
['ods', 'ods', 'ods'],
|
||||
['fods', 'fods', 'fods'],
|
||||
['wk3', 'wk3', 'wk3']
|
||||
];
|
||||
var wb_formats_2 = [
|
||||
['xlml', 'xlml', 'xls']
|
||||
];
|
||||
program.parse(process.argv);
|
||||
|
||||
var filename = '', sheetname = '';
|
||||
if(program.args[0]) {
|
||||
filename = program.args[0];
|
||||
if(program.args[1]) sheetname = program.args[1];
|
||||
}
|
||||
if(program.sheet) sheetname = program.sheet;
|
||||
if(program.file) filename = program.file;
|
||||
|
||||
if(!filename) {
|
||||
console.error(n + ": must specify a filename");
|
||||
process.exit(1);
|
||||
}
|
||||
if(!fs.existsSync(filename)) {
|
||||
console.error(n + ": " + filename + ": No such file or directory");
|
||||
process.exit(2);
|
||||
}
|
||||
|
||||
if(program.req) program.req.split(",").forEach(function(r) {
|
||||
require((fs.existsSync(r) || fs.existsSync(r + '.js')) ? require('path').resolve(r) : r);
|
||||
});
|
||||
|
||||
var opts = {}, wb/*:?Workbook*/;
|
||||
if(program.listSheets) opts.bookSheets = true;
|
||||
if(program.sheetRows) opts.sheetRows = program.sheetRows;
|
||||
if(program.password) opts.password = program.password;
|
||||
var seen = false;
|
||||
function wb_fmt() {
|
||||
seen = true;
|
||||
opts.cellFormula = true;
|
||||
opts.cellNF = true;
|
||||
opts.xlfn = true;
|
||||
if(program.output) sheetname = program.output;
|
||||
}
|
||||
function isfmt(m/*:string*/)/*:boolean*/ {
|
||||
if(!program.output) return false;
|
||||
var t = m.charAt(0) === "." ? m : "." + m;
|
||||
return program.output.slice(-t.length) === t;
|
||||
}
|
||||
workbook_formats.forEach(function(m) { if(program[m[0]] || isfmt(m[0])) { wb_fmt(); } });
|
||||
wb_formats_2.forEach(function(m) { if(program[m[0]] || isfmt(m[0])) { wb_fmt(); } });
|
||||
if(seen) {
|
||||
} else if(program.formulae) opts.cellFormula = true;
|
||||
else opts.cellFormula = false;
|
||||
|
||||
var wopts = ({WTF:opts.WTF, bookSST:program.sst}/*:any*/);
|
||||
if(program.compress) wopts.compression = true;
|
||||
|
||||
if(program.all) {
|
||||
opts.cellFormula = true;
|
||||
opts.bookVBA = true;
|
||||
opts.cellNF = true;
|
||||
opts.cellHTML = true;
|
||||
opts.cellStyles = true;
|
||||
opts.sheetStubs = true;
|
||||
opts.cellDates = true;
|
||||
wopts.cellFormula = true;
|
||||
wopts.cellStyles = true;
|
||||
wopts.sheetStubs = true;
|
||||
wopts.bookVBA = true;
|
||||
}
|
||||
if(program.sparse) opts.dense = false; else opts.dense = true;
|
||||
if(program.codepage) opts.codepage = +program.codepage;
|
||||
|
||||
if(program.dev) {
|
||||
opts.WTF = true;
|
||||
wb = X.readFile(filename, opts);
|
||||
} else try {
|
||||
wb = X.readFile(filename, opts);
|
||||
} catch(e) {
|
||||
var msg = (program.quiet) ? "" : n + ": error parsing ";
|
||||
msg += filename + ": " + e;
|
||||
console.error(msg);
|
||||
process.exit(3);
|
||||
}
|
||||
if(program.read) process.exit(0);
|
||||
if(!wb) { console.error(n + ": error parsing " + filename + ": empty workbook"); process.exit(0); }
|
||||
/*:: if(!wb) throw new Error("unreachable"); */
|
||||
if(program.listSheets) {
|
||||
console.log((wb.SheetNames||[]).join("\n"));
|
||||
process.exit(0);
|
||||
}
|
||||
if(program.dump) {
|
||||
console.log(JSON.stringify(wb));
|
||||
process.exit(0);
|
||||
}
|
||||
if(program.props) {
|
||||
if(wb) dump_props(wb);
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
/* full workbook formats */
|
||||
workbook_formats.forEach(function(m) { if(program[m[0]] || isfmt(m[0])) {
|
||||
wopts.bookType = m[1];
|
||||
if(wopts.bookType == "numbers") try {
|
||||
var XLSX_ZAHL = require("../dist/xlsx.zahl");
|
||||
wopts.numbers = XLSX_ZAHL;
|
||||
} catch(e) {}
|
||||
if(wb) X.writeFile(wb, program.output || sheetname || ((filename || "") + "." + m[2]), wopts);
|
||||
process.exit(0);
|
||||
} });
|
||||
|
||||
wb_formats_2.forEach(function(m) { if(program[m[0]] || isfmt(m[0])) {
|
||||
wopts.bookType = m[1];
|
||||
if(wb) X.writeFile(wb, program.output || sheetname || ((filename || "") + "." + m[2]), wopts);
|
||||
process.exit(0);
|
||||
} });
|
||||
|
||||
var target_sheet = sheetname || '';
|
||||
if(target_sheet === '') {
|
||||
if(+program.sheetIndex < (wb.SheetNames||[]).length) target_sheet = wb.SheetNames[+program.sheetIndex];
|
||||
else target_sheet = (wb.SheetNames||[""])[0];
|
||||
}
|
||||
|
||||
var ws;
|
||||
try {
|
||||
ws = wb.Sheets[target_sheet];
|
||||
if(!ws) {
|
||||
console.error("Sheet " + target_sheet + " cannot be found");
|
||||
process.exit(3);
|
||||
}
|
||||
} catch(e) {
|
||||
console.error(n + ": error parsing "+filename+" "+target_sheet+": " + e);
|
||||
process.exit(4);
|
||||
}
|
||||
|
||||
if(!program.quiet && !program.book) console.error(target_sheet);
|
||||
|
||||
/* single worksheet file formats */
|
||||
[
|
||||
['biff2', '.xls'],
|
||||
['biff3', '.xls'],
|
||||
['biff4', '.xls'],
|
||||
['sylk', '.slk'],
|
||||
['html', '.html'],
|
||||
['prn', '.prn'],
|
||||
['eth', '.eth'],
|
||||
['rtf', '.rtf'],
|
||||
['txt', '.txt'],
|
||||
['dbf', '.dbf'],
|
||||
['wk1', '.wk1'],
|
||||
['dif', '.dif']
|
||||
].forEach(function(m) { if(program[m[0]] || isfmt(m[1])) {
|
||||
wopts.bookType = m[0];
|
||||
if(program.book) {
|
||||
/*:: if(wb == null) throw new Error("Unreachable"); */
|
||||
wb.SheetNames.forEach(function(n, i) {
|
||||
wopts.sheet = n;
|
||||
X.writeFile(wb, (program.output || sheetname || filename || "") + m[1] + "." + i, wopts);
|
||||
});
|
||||
} else X.writeFile(wb, program.output || sheetname || ((filename || "") + m[1]), wopts);
|
||||
process.exit(0);
|
||||
} });
|
||||
|
||||
function outit(o, fn) { if(fn) fs.writeFileSync(fn, o); else console.log(o); }
|
||||
|
||||
function doit(cb) {
|
||||
/*:: if(!wb) throw new Error("unreachable"); */
|
||||
if(program.book) wb.SheetNames.forEach(function(n, i) {
|
||||
/*:: if(!wb) throw new Error("unreachable"); */
|
||||
outit(cb(wb.Sheets[n]), (program.output || sheetname || filename) + "." + i);
|
||||
});
|
||||
else outit(cb(ws), program.output);
|
||||
}
|
||||
|
||||
var jso = {};
|
||||
switch(true) {
|
||||
case program.formulae:
|
||||
doit(function(ws) { return X.utils.sheet_to_formulae(ws).join("\n"); });
|
||||
break;
|
||||
|
||||
case program.arrays: jso.header = 1;
|
||||
/* falls through */
|
||||
case program.rawJs: jso.raw = true;
|
||||
/* falls through */
|
||||
case program.json:
|
||||
doit(function(ws) { return JSON.stringify(X.utils.sheet_to_json(ws,jso)); });
|
||||
break;
|
||||
|
||||
default:
|
||||
if(!program.book) {
|
||||
var stream = X.stream.to_csv(ws, {FS:program.fieldSep||",", RS:program.rowSep||"\n"});
|
||||
if(program.output) stream.pipe(fs.createWriteStream(program.output));
|
||||
else stream.pipe(process.stdout);
|
||||
} else doit(function(ws) { return X.utils.sheet_to_csv(ws,{FS:program.fieldSep, RS:program.rowSep}); });
|
||||
break;
|
||||
}
|
||||
|
||||
function dump_props(wb/*:Workbook*/) {
|
||||
var propaoa = [];
|
||||
if(Object.assign && Object.entries) propaoa = Object.entries(Object.assign({}, wb.Props, wb.Custprops));
|
||||
else {
|
||||
var Keys/*:: :Array<string> = []*/, pi;
|
||||
if(wb.Props) {
|
||||
Keys = Object.keys(wb.Props);
|
||||
for(pi = 0; pi < Keys.length; ++pi) {
|
||||
if(Object.prototype.hasOwnProperty.call(Keys, Keys[pi])) propaoa.push([Keys[pi], Keys[/*::+*/Keys[pi]]]);
|
||||
}
|
||||
}
|
||||
if(wb.Custprops) {
|
||||
Keys = Object.keys(wb.Custprops);
|
||||
for(pi = 0; pi < Keys.length; ++pi) {
|
||||
if(Object.prototype.hasOwnProperty.call(Keys, Keys[pi])) propaoa.push([Keys[pi], Keys[/*::+*/Keys[pi]]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log(X.utils.sheet_to_csv(X.utils.aoa_to_sheet(propaoa)));
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
||||
|
||||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
||||
|
||||
function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
||||
|
||||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
||||
|
||||
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
||||
|
||||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
||||
|
||||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
||||
|
||||
import merge from './util/merge';
|
||||
var default_date_options = {
|
||||
format: 'YYYY/MM/DD',
|
||||
delimiters: ['/', '-'],
|
||||
strictMode: false
|
||||
};
|
||||
|
||||
function isValidFormat(format) {
|
||||
return /(^(y{4}|y{2})[.\/-](m{1,2})[.\/-](d{1,2})$)|(^(m{1,2})[.\/-](d{1,2})[.\/-]((y{4}|y{2})$))|(^(d{1,2})[.\/-](m{1,2})[.\/-]((y{4}|y{2})$))/gi.test(format);
|
||||
}
|
||||
|
||||
function zip(date, format) {
|
||||
var zippedArr = [],
|
||||
len = Math.min(date.length, format.length);
|
||||
|
||||
for (var i = 0; i < len; i++) {
|
||||
zippedArr.push([date[i], format[i]]);
|
||||
}
|
||||
|
||||
return zippedArr;
|
||||
}
|
||||
|
||||
export default function isDate(input, options) {
|
||||
if (typeof options === 'string') {
|
||||
// Allow backward compatbility for old format isDate(input [, format])
|
||||
options = merge({
|
||||
format: options
|
||||
}, default_date_options);
|
||||
} else {
|
||||
options = merge(options, default_date_options);
|
||||
}
|
||||
|
||||
if (typeof input === 'string' && isValidFormat(options.format)) {
|
||||
var formatDelimiter = options.delimiters.find(function (delimiter) {
|
||||
return options.format.indexOf(delimiter) !== -1;
|
||||
});
|
||||
var dateDelimiter = options.strictMode ? formatDelimiter : options.delimiters.find(function (delimiter) {
|
||||
return input.indexOf(delimiter) !== -1;
|
||||
});
|
||||
var dateAndFormat = zip(input.split(dateDelimiter), options.format.toLowerCase().split(formatDelimiter));
|
||||
var dateObj = {};
|
||||
|
||||
var _iterator = _createForOfIteratorHelper(dateAndFormat),
|
||||
_step;
|
||||
|
||||
try {
|
||||
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
||||
var _step$value = _slicedToArray(_step.value, 2),
|
||||
dateWord = _step$value[0],
|
||||
formatWord = _step$value[1];
|
||||
|
||||
if (dateWord.length !== formatWord.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
dateObj[formatWord.charAt(0)] = dateWord;
|
||||
}
|
||||
} catch (err) {
|
||||
_iterator.e(err);
|
||||
} finally {
|
||||
_iterator.f();
|
||||
}
|
||||
|
||||
return new Date("".concat(dateObj.m, "/").concat(dateObj.d, "/").concat(dateObj.y)).getDate() === +dateObj.d;
|
||||
}
|
||||
|
||||
if (!options.strictMode) {
|
||||
return Object.prototype.toString.call(input) === '[object Date]' && isFinite(input);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var fileline_1 = require("./fileline");
|
||||
var Converter_1 = require("./Converter");
|
||||
var assert = require("assert");
|
||||
describe("fileline function", function () {
|
||||
it("should convert data to multiple lines ", function () {
|
||||
var conv = new Converter_1.Converter();
|
||||
var data = "abcde\nefef";
|
||||
var result = fileline_1.stringToLines(data, conv.parseRuntime);
|
||||
assert.equal(result.lines.length, 1);
|
||||
assert.equal(result.partial, "efef");
|
||||
assert.equal(result.lines[0], "abcde");
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL1VzZXJzL2t4aWFuZy93b3JrL3Byb2plY3RzL2NzdjJqc29uL3NyYy9maWxlbGluZS50ZXN0LnRzIiwic291cmNlcyI6WyIvVXNlcnMva3hpYW5nL3dvcmsvcHJvamVjdHMvY3N2Mmpzb24vc3JjL2ZpbGVsaW5lLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx1Q0FBeUM7QUFFekMseUNBQXdDO0FBQ3hDLElBQUksTUFBTSxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FBQztBQUMvQixRQUFRLENBQUMsbUJBQW1CLEVBQUU7SUFDNUIsRUFBRSxDQUFFLHdDQUF3QyxFQUFFO1FBQzVDLElBQU0sSUFBSSxHQUFDLElBQUkscUJBQVMsRUFBRSxDQUFDO1FBQzNCLElBQUksSUFBSSxHQUFHLGFBQWEsQ0FBQztRQUN6QixJQUFJLE1BQU0sR0FBRyx3QkFBYSxDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsWUFBWSxDQUFDLENBQUM7UUFDcEQsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUMsQ0FBQztRQUNyQyxNQUFNLENBQUMsS0FBSyxDQUFDLE1BQU0sQ0FBQyxPQUFPLEVBQUUsTUFBTSxDQUFDLENBQUM7UUFDckMsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsS0FBSyxDQUFDLENBQUMsQ0FBQyxFQUFFLE9BQU8sQ0FBQyxDQUFDO0lBQ3pDLENBQUMsQ0FBQyxDQUFDO0FBQ0wsQ0FBQyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge3N0cmluZ1RvTGluZXN9IGZyb20gXCIuL2ZpbGVsaW5lXCI7XG5pbXBvcnQgeyBtZXJnZVBhcmFtcyB9IGZyb20gXCIuL1BhcmFtZXRlcnNcIjtcbmltcG9ydCB7IENvbnZlcnRlciB9IGZyb20gXCIuL0NvbnZlcnRlclwiO1xudmFyIGFzc2VydCA9IHJlcXVpcmUoXCJhc3NlcnRcIik7XG5kZXNjcmliZShcImZpbGVsaW5lIGZ1bmN0aW9uXCIsIGZ1bmN0aW9uKCkge1xuICBpdCAoXCJzaG91bGQgY29udmVydCBkYXRhIHRvIG11bHRpcGxlIGxpbmVzIFwiLCBmdW5jdGlvbigpIHtcbiAgICBjb25zdCBjb252PW5ldyBDb252ZXJ0ZXIoKTtcbiAgICB2YXIgZGF0YSA9IFwiYWJjZGVcXG5lZmVmXCI7XG4gICAgdmFyIHJlc3VsdCA9IHN0cmluZ1RvTGluZXMoZGF0YSwgY29udi5wYXJzZVJ1bnRpbWUpO1xuICAgIGFzc2VydC5lcXVhbChyZXN1bHQubGluZXMubGVuZ3RoLCAxKTtcbiAgICBhc3NlcnQuZXF1YWwocmVzdWx0LnBhcnRpYWwsIFwiZWZlZlwiKTtcbiAgICBhc3NlcnQuZXF1YWwocmVzdWx0LmxpbmVzWzBdLCBcImFiY2RlXCIpO1xuICB9KTtcbn0pO1xuIl19
|
||||
@@ -0,0 +1,102 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/libs/core/CSVError.js</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../../index.html">All files</a> / <a href="index.html">csv2json/libs/core</a> CSVError.js
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>0/17</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/2</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/5</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>0/17</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line low'></div>
|
||||
<pre><table class="coverage">
|
||||
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
||||
<a name='L2'></a><a href='#L2'>2</a>
|
||||
<a name='L3'></a><a href='#L3'>3</a>
|
||||
<a name='L4'></a><a href='#L4'>4</a>
|
||||
<a name='L5'></a><a href='#L5'>5</a>
|
||||
<a name='L6'></a><a href='#L6'>6</a>
|
||||
<a name='L7'></a><a href='#L7'>7</a>
|
||||
<a name='L8'></a><a href='#L8'>8</a>
|
||||
<a name='L9'></a><a href='#L9'>9</a>
|
||||
<a name='L10'></a><a href='#L10'>10</a>
|
||||
<a name='L11'></a><a href='#L11'>11</a>
|
||||
<a name='L12'></a><a href='#L12'>12</a></td><td class="line-coverage quiet"><span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span>
|
||||
<span class="cline-any cline-no">0</span></td><td class="text"><pre class="prettyprint lang-js">Unable to lookup source: /Users/kxiang/work/projects/csv2json/libs/core/CSVError.js(ENOENT: no such file or directory, open '/Users/kxiang/work/projects/csv2json/libs/core/CSVError.js')
|
||||
Error: Unable to lookup source: /Users/kxiang/work/projects/csv2json/libs/core/CSVError.js(ENOENT: no such file or directory, open '/Users/kxiang/work/projects/csv2json/libs/core/CSVError.js')
|
||||
at Context.defaultSourceLookup [as sourceFinder] (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/context.js:15:15)
|
||||
at Context.getSource (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/context.js:74:17)
|
||||
at Object.annotateSourceCode (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-reports/lib/html/annotator.js:172:38)
|
||||
at HtmlReport.onDetail (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-reports/lib/html/index.js:237:39)
|
||||
at Visitor.(anonymous function) [as onDetail] (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:34:30)
|
||||
at ReportNode.Node.visit (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:123:17)
|
||||
at /Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:116:23
|
||||
at Array.forEach (native)
|
||||
at visitChildren (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:115:32)
|
||||
at ReportNode.Node.visit (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:126:5)</pre></td></tr>
|
||||
</table></pre>
|
||||
<div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri May 11 2018 21:36:07 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../../sorter.js"></script>
|
||||
<script src="../../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,21 @@
|
||||
/*! formdata-polyfill. MIT License. Jimmy W?rting <https://jimmy.warting.se/opensource> */
|
||||
;(function(){var h;function l(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}var m="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a};
|
||||
function n(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");}var q=n(this);function r(a,b){if(b)a:{var c=q;a=a.split(".");for(var d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))break a;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&null!=b&&m(c,a,{configurable:!0,writable:!0,value:b})}}
|
||||
r("Symbol",function(a){function b(f){if(this instanceof b)throw new TypeError("Symbol is not a constructor");return new c(d+(f||"")+"_"+e++,f)}function c(f,g){this.A=f;m(this,"description",{configurable:!0,writable:!0,value:g})}if(a)return a;c.prototype.toString=function(){return this.A};var d="jscomp_symbol_"+(1E9*Math.random()>>>0)+"_",e=0;return b});
|
||||
r("Symbol.iterator",function(a){if(a)return a;a=Symbol("Symbol.iterator");for(var b="Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array".split(" "),c=0;c<b.length;c++){var d=q[b[c]];"function"===typeof d&&"function"!=typeof d.prototype[a]&&m(d.prototype,a,{configurable:!0,writable:!0,value:function(){return u(l(this))}})}return a});function u(a){a={next:a};a[Symbol.iterator]=function(){return this};return a}
|
||||
function v(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:l(a)}}var w;if("function"==typeof Object.setPrototypeOf)w=Object.setPrototypeOf;else{var y;a:{var z={a:!0},A={};try{A.__proto__=z;y=A.a;break a}catch(a){}y=!1}w=y?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var B=w;function C(){this.m=!1;this.j=null;this.v=void 0;this.h=1;this.u=this.C=0;this.l=null}
|
||||
function D(a){if(a.m)throw new TypeError("Generator is already running");a.m=!0}C.prototype.o=function(a){this.v=a};C.prototype.s=function(a){this.l={D:a,F:!0};this.h=this.C||this.u};C.prototype.return=function(a){this.l={return:a};this.h=this.u};function E(a,b){a.h=3;return{value:b}}function F(a){this.g=new C;this.G=a}F.prototype.o=function(a){D(this.g);if(this.g.j)return G(this,this.g.j.next,a,this.g.o);this.g.o(a);return H(this)};
|
||||
function I(a,b){D(a.g);var c=a.g.j;if(c)return G(a,"return"in c?c["return"]:function(d){return{value:d,done:!0}},b,a.g.return);a.g.return(b);return H(a)}F.prototype.s=function(a){D(this.g);if(this.g.j)return G(this,this.g.j["throw"],a,this.g.o);this.g.s(a);return H(this)};
|
||||
function G(a,b,c,d){try{var e=b.call(a.g.j,c);if(!(e instanceof Object))throw new TypeError("Iterator result "+e+" is not an object");if(!e.done)return a.g.m=!1,e;var f=e.value}catch(g){return a.g.j=null,a.g.s(g),H(a)}a.g.j=null;d.call(a.g,f);return H(a)}function H(a){for(;a.g.h;)try{var b=a.G(a.g);if(b)return a.g.m=!1,{value:b.value,done:!1}}catch(c){a.g.v=void 0,a.g.s(c)}a.g.m=!1;if(a.g.l){b=a.g.l;a.g.l=null;if(b.F)throw b.D;return{value:b.return,done:!0}}return{value:void 0,done:!0}}
|
||||
function J(a){this.next=function(b){return a.o(b)};this.throw=function(b){return a.s(b)};this.return=function(b){return I(a,b)};this[Symbol.iterator]=function(){return this}}function K(a,b){b=new J(new F(b));B&&a.prototype&&B(b,a.prototype);return b}function L(a,b){a instanceof String&&(a+="");var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}
|
||||
r("Array.prototype.entries",function(a){return a?a:function(){return L(this,function(b,c){return[b,c]})}});
|
||||
if("undefined"!==typeof Blob&&("undefined"===typeof FormData||!FormData.prototype.keys)){var M=function(a,b){for(var c=0;c<a.length;c++)b(a[c])},N=function(a){return a.replace(/\r?\n|\r/g,"\r\n")},O=function(a,b,c){if(b instanceof Blob){c=void 0!==c?String(c+""):"string"===typeof b.name?b.name:"blob";if(b.name!==c||"[object Blob]"===Object.prototype.toString.call(b))b=new File([b],c);return[String(a),b]}return[String(a),String(b)]},P=function(a,b){if(a.length<b)throw new TypeError(b+" argument required, but only "+
|
||||
a.length+" present.");},Q="object"===typeof globalThis?globalThis:"object"===typeof window?window:"object"===typeof self?self:this,R=Q.FormData,S=Q.XMLHttpRequest&&Q.XMLHttpRequest.prototype.send,T=Q.Request&&Q.fetch,U=Q.navigator&&Q.navigator.sendBeacon,V=Q.Element&&Q.Element.prototype,W=Q.Symbol&&Symbol.toStringTag;W&&(Blob.prototype[W]||(Blob.prototype[W]="Blob"),"File"in Q&&!File.prototype[W]&&(File.prototype[W]="File"));try{new File([],"")}catch(a){Q.File=function(b,c,d){b=new Blob(b,d||{});
|
||||
Object.defineProperties(b,{name:{value:c},lastModified:{value:+(d&&void 0!==d.lastModified?new Date(d.lastModified):new Date)},toString:{value:function(){return"[object File]"}}});W&&Object.defineProperty(b,W,{value:"File"});return b}}var escape=function(a){return a.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22")},X=function(a){this.i=[];var b=this;a&&M(a.elements,function(c){if(c.name&&!c.disabled&&"submit"!==c.type&&"button"!==c.type&&!c.matches("form fieldset[disabled] *"))if("file"===
|
||||
c.type){var d=c.files&&c.files.length?c.files:[new File([],"",{type:"application/octet-stream"})];M(d,function(e){b.append(c.name,e)})}else"select-multiple"===c.type||"select-one"===c.type?M(c.options,function(e){!e.disabled&&e.selected&&b.append(c.name,e.value)}):"checkbox"===c.type||"radio"===c.type?c.checked&&b.append(c.name,c.value):(d="textarea"===c.type?N(c.value):c.value,b.append(c.name,d))})};h=X.prototype;h.append=function(a,b,c){P(arguments,2);this.i.push(O(a,b,c))};h.delete=function(a){P(arguments,
|
||||
1);var b=[];a=String(a);M(this.i,function(c){c[0]!==a&&b.push(c)});this.i=b};h.entries=function b(){var c,d=this;return K(b,function(e){1==e.h&&(c=0);if(3!=e.h)return c<d.i.length?e=E(e,d.i[c]):(e.h=0,e=void 0),e;c++;e.h=2})};h.forEach=function(b,c){P(arguments,1);for(var d=v(this),e=d.next();!e.done;e=d.next()){var f=v(e.value);e=f.next().value;f=f.next().value;b.call(c,f,e,this)}};h.get=function(b){P(arguments,1);var c=this.i;b=String(b);for(var d=0;d<c.length;d++)if(c[d][0]===b)return c[d][1];
|
||||
return null};h.getAll=function(b){P(arguments,1);var c=[];b=String(b);M(this.i,function(d){d[0]===b&&c.push(d[1])});return c};h.has=function(b){P(arguments,1);b=String(b);for(var c=0;c<this.i.length;c++)if(this.i[c][0]===b)return!0;return!1};h.keys=function c(){var d=this,e,f,g,k,p;return K(c,function(t){1==t.h&&(e=v(d),f=e.next());if(3!=t.h){if(f.done){t.h=0;return}g=f.value;k=v(g);p=k.next().value;return E(t,p)}f=e.next();t.h=2})};h.set=function(c,d,e){P(arguments,2);c=String(c);var f=[],g=O(c,
|
||||
d,e),k=!0;M(this.i,function(p){p[0]===c?k&&(k=!f.push(g)):f.push(p)});k&&f.push(g);this.i=f};h.values=function d(){var e=this,f,g,k,p,t;return K(d,function(x){1==x.h&&(f=v(e),g=f.next());if(3!=x.h){if(g.done){x.h=0;return}k=g.value;p=v(k);p.next();t=p.next().value;return E(x,t)}g=f.next();x.h=2})};X.prototype._asNative=function(){for(var d=new R,e=v(this),f=e.next();!f.done;f=e.next()){var g=v(f.value);f=g.next().value;g=g.next().value;d.append(f,g)}return d};X.prototype._blob=function(){var d="----formdata-polyfill-"+
|
||||
Math.random(),e=[],f="--"+d+'\r\nContent-Disposition: form-data; name="';this.forEach(function(g,k){return"string"==typeof g?e.push(f+escape(N(k))+('"\r\n\r\n'+N(g)+"\r\n")):e.push(f+escape(N(k))+('"; filename="'+escape(g.name)+'"\r\nContent-Type: '+(g.type||"application/octet-stream")+"\r\n\r\n"),g,"\r\n")});e.push("--"+d+"--");return new Blob(e,{type:"multipart/form-data; boundary="+d})};X.prototype[Symbol.iterator]=function(){return this.entries()};X.prototype.toString=function(){return"[object FormData]"};
|
||||
V&&!V.matches&&(V.matches=V.matchesSelector||V.mozMatchesSelector||V.msMatchesSelector||V.oMatchesSelector||V.webkitMatchesSelector||function(d){d=(this.document||this.ownerDocument).querySelectorAll(d);for(var e=d.length;0<=--e&&d.item(e)!==this;);return-1<e});W&&(X.prototype[W]="FormData");if(S){var Y=Q.XMLHttpRequest.prototype.setRequestHeader;Q.XMLHttpRequest.prototype.setRequestHeader=function(d,e){Y.call(this,d,e);"content-type"===d.toLowerCase()&&(this.B=!0)};Q.XMLHttpRequest.prototype.send=
|
||||
function(d){d instanceof X?(d=d._blob(),this.B||this.setRequestHeader("Content-Type",d.type),S.call(this,d)):S.call(this,d)}}T&&(Q.fetch=function(d,e){e&&e.body&&e.body instanceof X&&(e.body=e.body._blob());return T.call(this,d,e)});U&&(Q.navigator.sendBeacon=function(d,e){e instanceof X&&(e=e._asNative());return U.call(this,d,e)});Q.FormData=X};})();
|
||||
@@ -0,0 +1,115 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { ObservableInputTuple, SchedulerLike } from '../types';
|
||||
import { concatAll } from '../operators/concatAll';
|
||||
import { popScheduler } from '../util/args';
|
||||
import { from } from './from';
|
||||
|
||||
export function concat<T extends readonly unknown[]>(...inputs: [...ObservableInputTuple<T>]): Observable<T[number]>;
|
||||
export function concat<T extends readonly unknown[]>(
|
||||
...inputsAndScheduler: [...ObservableInputTuple<T>, SchedulerLike]
|
||||
): Observable<T[number]>;
|
||||
|
||||
/**
|
||||
* Creates an output Observable which sequentially emits all values from the first given
|
||||
* Observable and then moves on to the next.
|
||||
*
|
||||
* <span class="informal">Concatenates multiple Observables together by
|
||||
* sequentially emitting their values, one Observable after the other.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `concat` joins multiple Observables together, by subscribing to them one at a time and
|
||||
* merging their results into the output Observable. You can pass either an array of
|
||||
* Observables, or put them directly as arguments. Passing an empty array will result
|
||||
* in Observable that completes immediately.
|
||||
*
|
||||
* `concat` will subscribe to first input Observable and emit all its values, without
|
||||
* changing or affecting them in any way. When that Observable completes, it will
|
||||
* subscribe to then next Observable passed and, again, emit its values. This will be
|
||||
* repeated, until the operator runs out of Observables. When last input Observable completes,
|
||||
* `concat` will complete as well. At any given moment only one Observable passed to operator
|
||||
* emits values. If you would like to emit values from passed Observables concurrently, check out
|
||||
* {@link merge} instead, especially with optional `concurrent` parameter. As a matter of fact,
|
||||
* `concat` is an equivalent of `merge` operator with `concurrent` parameter set to `1`.
|
||||
*
|
||||
* Note that if some input Observable never completes, `concat` will also never complete
|
||||
* and Observables following the one that did not complete will never be subscribed. On the other
|
||||
* hand, if some Observable simply completes immediately after it is subscribed, it will be
|
||||
* invisible for `concat`, which will just move on to the next Observable.
|
||||
*
|
||||
* If any Observable in chain errors, instead of passing control to the next Observable,
|
||||
* `concat` will error immediately as well. Observables that would be subscribed after
|
||||
* the one that emitted error, never will.
|
||||
*
|
||||
* If you pass to `concat` the same Observable many times, its stream of values
|
||||
* will be "replayed" on every subscription, which means you can repeat given Observable
|
||||
* as many times as you like. If passing the same Observable to `concat` 1000 times becomes tedious,
|
||||
* you can always use {@link repeat}.
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10
|
||||
*
|
||||
* ```ts
|
||||
* import { interval, take, range, concat } from 'rxjs';
|
||||
*
|
||||
* const timer = interval(1000).pipe(take(4));
|
||||
* const sequence = range(1, 10);
|
||||
* const result = concat(timer, sequence);
|
||||
* result.subscribe(x => console.log(x));
|
||||
*
|
||||
* // results in:
|
||||
* // 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10
|
||||
* ```
|
||||
*
|
||||
* Concatenate 3 Observables
|
||||
*
|
||||
* ```ts
|
||||
* import { interval, take, concat } from 'rxjs';
|
||||
*
|
||||
* const timer1 = interval(1000).pipe(take(10));
|
||||
* const timer2 = interval(2000).pipe(take(6));
|
||||
* const timer3 = interval(500).pipe(take(10));
|
||||
*
|
||||
* const result = concat(timer1, timer2, timer3);
|
||||
* result.subscribe(x => console.log(x));
|
||||
*
|
||||
* // results in the following:
|
||||
* // (Prints to console sequentially)
|
||||
* // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9
|
||||
* // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5
|
||||
* // -500ms-> 0 -500ms-> 1 -500ms-> ... 9
|
||||
* ```
|
||||
*
|
||||
* Concatenate the same Observable to repeat it
|
||||
*
|
||||
* ```ts
|
||||
* import { interval, take, concat } from 'rxjs';
|
||||
*
|
||||
* const timer = interval(1000).pipe(take(2));
|
||||
*
|
||||
* concat(timer, timer) // concatenating the same Observable!
|
||||
* .subscribe({
|
||||
* next: value => console.log(value),
|
||||
* complete: () => console.log('...and it is done!')
|
||||
* });
|
||||
*
|
||||
* // Logs:
|
||||
* // 0 after 1s
|
||||
* // 1 after 2s
|
||||
* // 0 after 3s
|
||||
* // 1 after 4s
|
||||
* // '...and it is done!' also after 4s
|
||||
* ```
|
||||
*
|
||||
* @see {@link concatAll}
|
||||
* @see {@link concatMap}
|
||||
* @see {@link concatMapTo}
|
||||
* @see {@link startWith}
|
||||
* @see {@link endWith}
|
||||
*
|
||||
* @param args Input Observables to concatenate.
|
||||
*/
|
||||
export function concat(...args: any[]): Observable<unknown> {
|
||||
return concatAll()(from(args, popScheduler(args)));
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
|
||||
var assert = require("chai").assert
|
||||
, ensureSafeInteger = require("../../safe-integer/ensure");
|
||||
|
||||
describe("safe-integer/ensure", function () {
|
||||
it("Should return coerced value", function () {
|
||||
assert.equal(ensureSafeInteger("12.23"), 12);
|
||||
});
|
||||
it("Should crash on no value", function () {
|
||||
try {
|
||||
ensureSafeInteger(null);
|
||||
throw new Error("Unexpected");
|
||||
} catch (error) {
|
||||
assert.equal(error.name, "TypeError");
|
||||
assert.equal(error.message, "null is not a safe integer");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = require("./is-implemented")() ? String.prototype.normalize : require("./shim");
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,113 @@
|
||||
// Generated by LiveScript 1.4.0
|
||||
(function(){
|
||||
var reject, special, tokenRegex;
|
||||
reject = require('prelude-ls').reject;
|
||||
function consumeOp(tokens, op){
|
||||
if (tokens[0] === op) {
|
||||
return tokens.shift();
|
||||
} else {
|
||||
throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + ".");
|
||||
}
|
||||
}
|
||||
function maybeConsumeOp(tokens, op){
|
||||
if (tokens[0] === op) {
|
||||
return tokens.shift();
|
||||
}
|
||||
}
|
||||
function consumeList(tokens, arg$, hasDelimiters){
|
||||
var open, close, result, untilTest;
|
||||
open = arg$[0], close = arg$[1];
|
||||
if (hasDelimiters) {
|
||||
consumeOp(tokens, open);
|
||||
}
|
||||
result = [];
|
||||
untilTest = "," + (hasDelimiters ? close : '');
|
||||
while (tokens.length && (hasDelimiters && tokens[0] !== close)) {
|
||||
result.push(consumeElement(tokens, untilTest));
|
||||
maybeConsumeOp(tokens, ',');
|
||||
}
|
||||
if (hasDelimiters) {
|
||||
consumeOp(tokens, close);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function consumeArray(tokens, hasDelimiters){
|
||||
return consumeList(tokens, ['[', ']'], hasDelimiters);
|
||||
}
|
||||
function consumeTuple(tokens, hasDelimiters){
|
||||
return consumeList(tokens, ['(', ')'], hasDelimiters);
|
||||
}
|
||||
function consumeFields(tokens, hasDelimiters){
|
||||
var result, untilTest, key;
|
||||
if (hasDelimiters) {
|
||||
consumeOp(tokens, '{');
|
||||
}
|
||||
result = {};
|
||||
untilTest = "," + (hasDelimiters ? '}' : '');
|
||||
while (tokens.length && (!hasDelimiters || tokens[0] !== '}')) {
|
||||
key = consumeValue(tokens, ':');
|
||||
consumeOp(tokens, ':');
|
||||
result[key] = consumeElement(tokens, untilTest);
|
||||
maybeConsumeOp(tokens, ',');
|
||||
}
|
||||
if (hasDelimiters) {
|
||||
consumeOp(tokens, '}');
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function consumeValue(tokens, untilTest){
|
||||
var out;
|
||||
untilTest == null && (untilTest = '');
|
||||
out = '';
|
||||
while (tokens.length && -1 === untilTest.indexOf(tokens[0])) {
|
||||
out += tokens.shift();
|
||||
}
|
||||
return out;
|
||||
}
|
||||
function consumeElement(tokens, untilTest){
|
||||
switch (tokens[0]) {
|
||||
case '[':
|
||||
return consumeArray(tokens, true);
|
||||
case '(':
|
||||
return consumeTuple(tokens, true);
|
||||
case '{':
|
||||
return consumeFields(tokens, true);
|
||||
default:
|
||||
return consumeValue(tokens, untilTest);
|
||||
}
|
||||
}
|
||||
function consumeTopLevel(tokens, types, options){
|
||||
var ref$, type, structure, origTokens, result, finalResult, x$, y$;
|
||||
ref$ = types[0], type = ref$.type, structure = ref$.structure;
|
||||
origTokens = tokens.concat();
|
||||
if (!options.explicit && types.length === 1 && ((!type && structure) || (type === 'Array' || type === 'Object'))) {
|
||||
result = structure === 'array' || type === 'Array'
|
||||
? consumeArray(tokens, tokens[0] === '[')
|
||||
: structure === 'tuple'
|
||||
? consumeTuple(tokens, tokens[0] === '(')
|
||||
: consumeFields(tokens, tokens[0] === '{');
|
||||
finalResult = tokens.length ? consumeElement(structure === 'array' || type === 'Array'
|
||||
? (x$ = origTokens, x$.unshift('['), x$.push(']'), x$)
|
||||
: (y$ = origTokens, y$.unshift('('), y$.push(')'), y$)) : result;
|
||||
} else {
|
||||
finalResult = consumeElement(tokens);
|
||||
}
|
||||
return finalResult;
|
||||
}
|
||||
special = /\[\]\(\)}{:,/.source;
|
||||
tokenRegex = RegExp('("(?:\\\\"|[^"])*")|(\'(?:\\\\\'|[^\'])*\')|(/(?:\\\\/|[^/])*/[a-zA-Z]*)|(#.*#)|([' + special + '])|([^\\s' + special + '](?:\\s*[^\\s' + special + ']+)*)|\\s*');
|
||||
module.exports = function(types, string, options){
|
||||
var tokens, node;
|
||||
options == null && (options = {});
|
||||
if (!options.explicit && types.length === 1 && types[0].type === 'String') {
|
||||
return "'" + string.replace(/\\'/g, "\\\\'") + "'";
|
||||
}
|
||||
tokens = reject(not$, string.split(tokenRegex));
|
||||
node = consumeTopLevel(tokens, types, options);
|
||||
if (!node) {
|
||||
throw new Error("Error parsing '" + string + "'.");
|
||||
}
|
||||
return node;
|
||||
};
|
||||
function not$(x){ return !x; }
|
||||
}).call(this);
|
||||
@@ -0,0 +1,163 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.codeFrameColumns = codeFrameColumns;
|
||||
exports.default = _default;
|
||||
|
||||
var _highlight = require("@babel/highlight");
|
||||
|
||||
let deprecationWarningShown = false;
|
||||
|
||||
function getDefs(chalk) {
|
||||
return {
|
||||
gutter: chalk.grey,
|
||||
marker: chalk.red.bold,
|
||||
message: chalk.red.bold
|
||||
};
|
||||
}
|
||||
|
||||
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
||||
|
||||
function getMarkerLines(loc, source, opts) {
|
||||
const startLoc = Object.assign({
|
||||
column: 0,
|
||||
line: -1
|
||||
}, loc.start);
|
||||
const endLoc = Object.assign({}, startLoc, loc.end);
|
||||
const {
|
||||
linesAbove = 2,
|
||||
linesBelow = 3
|
||||
} = opts || {};
|
||||
const startLine = startLoc.line;
|
||||
const startColumn = startLoc.column;
|
||||
const endLine = endLoc.line;
|
||||
const endColumn = endLoc.column;
|
||||
let start = Math.max(startLine - (linesAbove + 1), 0);
|
||||
let end = Math.min(source.length, endLine + linesBelow);
|
||||
|
||||
if (startLine === -1) {
|
||||
start = 0;
|
||||
}
|
||||
|
||||
if (endLine === -1) {
|
||||
end = source.length;
|
||||
}
|
||||
|
||||
const lineDiff = endLine - startLine;
|
||||
const markerLines = {};
|
||||
|
||||
if (lineDiff) {
|
||||
for (let i = 0; i <= lineDiff; i++) {
|
||||
const lineNumber = i + startLine;
|
||||
|
||||
if (!startColumn) {
|
||||
markerLines[lineNumber] = true;
|
||||
} else if (i === 0) {
|
||||
const sourceLength = source[lineNumber - 1].length;
|
||||
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
|
||||
} else if (i === lineDiff) {
|
||||
markerLines[lineNumber] = [0, endColumn];
|
||||
} else {
|
||||
const sourceLength = source[lineNumber - i].length;
|
||||
markerLines[lineNumber] = [0, sourceLength];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (startColumn === endColumn) {
|
||||
if (startColumn) {
|
||||
markerLines[startLine] = [startColumn, 0];
|
||||
} else {
|
||||
markerLines[startLine] = true;
|
||||
}
|
||||
} else {
|
||||
markerLines[startLine] = [startColumn, endColumn - startColumn];
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
};
|
||||
}
|
||||
|
||||
function codeFrameColumns(rawLines, loc, opts = {}) {
|
||||
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
|
||||
const chalk = (0, _highlight.getChalk)(opts);
|
||||
const defs = getDefs(chalk);
|
||||
|
||||
const maybeHighlight = (chalkFn, string) => {
|
||||
return highlighted ? chalkFn(string) : string;
|
||||
};
|
||||
|
||||
const lines = rawLines.split(NEWLINE);
|
||||
const {
|
||||
start,
|
||||
end,
|
||||
markerLines
|
||||
} = getMarkerLines(loc, lines, opts);
|
||||
const hasColumns = loc.start && typeof loc.start.column === "number";
|
||||
const numberMaxWidth = String(end).length;
|
||||
const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
|
||||
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {
|
||||
const number = start + 1 + index;
|
||||
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
|
||||
const gutter = ` ${paddedNumber} |`;
|
||||
const hasMarker = markerLines[number];
|
||||
const lastMarkerLine = !markerLines[number + 1];
|
||||
|
||||
if (hasMarker) {
|
||||
let markerLine = "";
|
||||
|
||||
if (Array.isArray(hasMarker)) {
|
||||
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
|
||||
const numberOfMarkers = hasMarker[1] || 1;
|
||||
markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
|
||||
|
||||
if (lastMarkerLine && opts.message) {
|
||||
markerLine += " " + maybeHighlight(defs.message, opts.message);
|
||||
}
|
||||
}
|
||||
|
||||
return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
|
||||
} else {
|
||||
return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`;
|
||||
}
|
||||
}).join("\n");
|
||||
|
||||
if (opts.message && !hasColumns) {
|
||||
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
|
||||
}
|
||||
|
||||
if (highlighted) {
|
||||
return chalk.reset(frame);
|
||||
} else {
|
||||
return frame;
|
||||
}
|
||||
}
|
||||
|
||||
function _default(rawLines, lineNumber, colNumber, opts = {}) {
|
||||
if (!deprecationWarningShown) {
|
||||
deprecationWarningShown = true;
|
||||
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
|
||||
|
||||
if (process.emitWarning) {
|
||||
process.emitWarning(message, "DeprecationWarning");
|
||||
} else {
|
||||
const deprecationError = new Error(message);
|
||||
deprecationError.name = "DeprecationWarning";
|
||||
console.warn(new Error(message));
|
||||
}
|
||||
}
|
||||
|
||||
colNumber = Math.max(colNumber, 0);
|
||||
const location = {
|
||||
start: {
|
||||
column: colNumber,
|
||||
line: lineNumber
|
||||
}
|
||||
};
|
||||
return codeFrameColumns(rawLines, location, opts);
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ColdObservable.js","sourceRoot":"","sources":["../../../../src/internal/testing/ColdObservable.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,4CAA2C;AAC3C,gDAA+C;AAI/C,+DAA8D;AAC9D,mDAAkD;AAElD,gDAAsD;AAEtD;IAAuC,kCAAa;IAQlD,wBAAmB,QAAuB,EAAE,SAAoB;QAAhE,YACE,kBAAM,UAA+B,UAA2B;YAC9D,IAAM,UAAU,GAAsB,IAAW,CAAC;YAClD,IAAM,KAAK,GAAG,UAAU,CAAC,kBAAkB,EAAE,CAAC;YAC9C,IAAM,YAAY,GAAG,IAAI,2BAAY,EAAE,CAAC;YACxC,YAAY,CAAC,GAAG,CACd,IAAI,2BAAY,CAAC;gBACf,UAAU,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;YACzC,CAAC,CAAC,CACH,CAAC;YACF,UAAU,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;YACxC,OAAO,YAAY,CAAC;QACtB,CAAC,CAAC,SAEH;QAdkB,cAAQ,GAAR,QAAQ,CAAe;QAPnC,mBAAa,GAAsB,EAAE,CAAC;QAoB3C,KAAI,CAAC,SAAS,GAAG,SAAS,CAAC;;IAC7B,CAAC;IAED,yCAAgB,GAAhB,UAAiB,UAA2B;QAC1C,IAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;QAC5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,EAAE,CAAC,EAAE,EAAE;YACvC,IAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;YACjC,UAAU,CAAC,GAAG,CACZ,IAAI,CAAC,SAAS,CAAC,QAAQ,CACrB,UAAC,KAAK;gBACE,IAAA,KAAyD,KAAM,EAAlD,YAAY,0BAAA,EAAgB,WAAW,gBAAW,CAAC;gBACtE,kCAAmB,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;YACjD,CAAC,EACD,OAAO,CAAC,KAAK,EACb,EAAE,OAAO,SAAA,EAAE,UAAU,YAAA,EAAE,CACxB,CACF,CAAC;SACH;IACH,CAAC;IACH,qBAAC;AAAD,CAAC,AAxCD,CAAuC,uBAAU,GAwChD;AAxCY,wCAAc;AAyC3B,yBAAW,CAAC,cAAc,EAAE,CAAC,2CAAoB,CAAC,CAAC,CAAC"}
|
||||
Reference in New Issue
Block a user