new license file version [CI SKIP]

This commit is contained in:
2023-03-15 12:34:41 +00:00
parent 0a6d92a1f3
commit 61328d20ed
13115 changed files with 1892314 additions and 1 deletions

View File

@@ -0,0 +1 @@
module.exports={C:{"34":0.00288,"36":0.01151,"43":0.0374,"47":0.00288,"52":0.05179,"56":0.00863,"72":0.00288,"78":0.01151,"79":0.00288,"87":0.02014,"88":0.00575,"99":0.00288,"102":0.01726,"103":0.00288,"104":0.00575,"105":0.00575,"106":0.00863,"107":0.01151,"108":0.02877,"109":0.64733,"110":0.44594,"111":0.01151,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 35 37 38 39 40 41 42 44 45 46 48 49 50 51 53 54 55 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 73 74 75 76 77 80 81 82 83 84 85 86 89 90 91 92 93 94 95 96 97 98 100 101 112 3.5 3.6"},D:{"11":0.00288,"34":0.00863,"35":0.00288,"38":0.02014,"41":0.00575,"45":0.00288,"47":0.00863,"48":0.00863,"49":0.02877,"50":0.00288,"51":0.00288,"53":0.01439,"54":0.00288,"55":0.00863,"56":0.00863,"57":0.00863,"58":0.00575,"59":0.00288,"60":0.00863,"61":0.00575,"62":0.00288,"63":0.00863,"65":0.00575,"66":0.00575,"67":0.00575,"68":0.00863,"69":0.09206,"70":0.02877,"71":0.01151,"72":0.02877,"73":0.00863,"74":0.06329,"75":0.01151,"76":0.00575,"77":0.01151,"78":0.02589,"79":0.11796,"80":0.02877,"81":0.02589,"83":0.04316,"84":0.02589,"85":0.04028,"86":0.05466,"87":0.05179,"88":0.01151,"89":0.03165,"90":0.03452,"91":0.06617,"92":0.04891,"93":0.01726,"94":0.03165,"95":0.01726,"96":0.03165,"97":0.04028,"98":0.15824,"99":0.04891,"100":0.04028,"101":0.03452,"102":0.04028,"103":0.11508,"104":0.05754,"105":0.06905,"106":0.06617,"107":0.13234,"108":0.43155,"109":10.51256,"110":5.80579,"111":0.01151,"112":0.00575,_:"4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 36 37 39 40 42 43 44 46 52 64 113"},F:{"28":0.00863,"36":0.01151,"40":0.00288,"46":0.02014,"79":0.00288,"85":0.00288,"93":0.02014,"94":0.21865,"95":0.16399,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 37 38 39 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 86 87 88 89 90 91 92 9.5-9.6 10.5 10.6 11.1 11.5 11.6 12.1","10.0-10.1":0},B:{"12":0.00288,"17":0.00288,"18":0.01439,"84":0.00288,"89":0.00863,"92":0.00863,"103":0.00288,"104":0.00288,"105":0.00575,"106":0.00863,"107":0.02302,"108":0.08056,"109":0.96092,"110":1.263,_:"13 14 15 16 79 80 81 83 85 86 87 88 90 91 93 94 95 96 97 98 99 100 101 102"},E:{"4":0,"13":0.01151,"14":0.04603,"15":0.00863,_:"0 5 6 7 8 9 10 11 12 3.1 3.2 6.1 7.1 10.1 11.1 16.4","5.1":0.00863,"9.1":0.00863,"12.1":0.00863,"13.1":0.04028,"14.1":0.10357,"15.1":0.01726,"15.2-15.3":0.01439,"15.4":0.04316,"15.5":0.08056,"15.6":0.33086,"16.0":0.02589,"16.1":0.11796,"16.2":0.29633,"16.3":0.18413},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00335,"5.0-5.1":0.00446,"6.0-6.1":0.00446,"7.0-7.1":0.01673,"8.1-8.4":0.00781,"9.0-9.2":0.01673,"9.3":0.04573,"10.0-10.2":0.00781,"10.3":0.13163,"11.0-11.2":0.02789,"11.3-11.4":0.01785,"12.0-12.1":0.02454,"12.2-12.5":0.42611,"13.0-13.1":0.01673,"13.2":0.01004,"13.3":0.04239,"13.4-13.7":0.12716,"14.0-14.4":0.33353,"14.5-14.8":0.56332,"15.0-15.1":0.17513,"15.2-15.3":0.20079,"15.4":0.26772,"15.5":0.39488,"15.6":0.97605,"16.0":0.95931,"16.1":1.97775,"16.2":2.03575,"16.3":1.35754,"16.4":0.00558},P:{"4":0.2095,"20":0.65993,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.07333,"8.2":0,"9.2":0.01048,"10.1":0,"11.1-11.2":0.03143,"12.0":0.01048,"13.0":0.05238,"14.0":0.0419,"15.0":0.03143,"16.0":0.0838,"17.0":0.09428,"18.0":0.11523,"19.0":1.257},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.22355,"4.4":0,"4.4.3-4.4.4":0.74518},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"8":0.03951,"9":0.08891,"10":0.00988,"11":0.97798,_:"6 7 5.5"},N:{"10":0,"11":0},S:{"2.5":0.17095,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":1.85198},H:{"0":1.06549},L:{"0":55.73825},R:{_:"0"},M:{"0":0.15671},Q:{"13.1":0.25643}};

View File

@@ -0,0 +1,39 @@
import assertString from './util/assertString';
/*
Checks if the provided string matches to a correct Media type format (MIME type)
This function only checks is the string format follows the
etablished rules by the according RFC specifications.
This function supports 'charset' in textual media types
(https://tools.ietf.org/html/rfc6657).
This function does not check against all the media types listed
by the IANA (https://www.iana.org/assignments/media-types/media-types.xhtml)
because of lightness purposes : it would require to include
all these MIME types in this librairy, which would weigh it
significantly. This kind of effort maybe is not worth for the use that
this function has in this entire librairy.
More informations in the RFC specifications :
- https://tools.ietf.org/html/rfc2045
- https://tools.ietf.org/html/rfc2046
- https://tools.ietf.org/html/rfc7231#section-3.1.1.1
- https://tools.ietf.org/html/rfc7231#section-3.1.1.5
*/
// Match simple MIME types
// NB :
// Subtype length must not exceed 100 characters.
// This rule does not comply to the RFC specs (what is the max length ?).
var mimeTypeSimple = /^(application|audio|font|image|message|model|multipart|text|video)\/[a-zA-Z0-9\.\-\+_]{1,100}$/i; // eslint-disable-line max-len
// Handle "charset" in "text/*"
var mimeTypeText = /^text\/[a-zA-Z0-9\.\-\+]{1,100};\s?charset=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?$/i; // eslint-disable-line max-len
// Handle "boundary" in "multipart/*"
var mimeTypeMultipart = /^multipart\/[a-zA-Z0-9\.\-\+]{1,100}(;\s?(boundary|charset)=("[a-zA-Z0-9\.\-\+\s]{0,70}"|[a-zA-Z0-9\.\-\+]{0,70})(\s?\([a-zA-Z0-9\.\-\+\s]{1,20}\))?){0,2}$/i; // eslint-disable-line max-len
export default function isMimeType(str) {
assertString(str);
return mimeTypeSimple.test(str) || mimeTypeText.test(str) || mimeTypeMultipart.test(str);
}

View File

@@ -0,0 +1,70 @@
"use strict";
module.exports = {
assign: require("./assign"),
assignDeep: require("./assign-deep"),
clear: require("./clear"),
compact: require("./compact"),
compare: require("./compare"),
copy: require("./copy"),
copyDeep: require("./copy-deep"),
count: require("./count"),
create: require("./create"),
ensureArray: require("./ensure-array"),
ensureFiniteNumber: require("./ensure-finite-number"),
ensureInteger: require("./ensure-integer"),
ensureNaturalNumber: require("./ensure-natural-number"),
ensureNaturalNumberValue: require("./ensure-natural-number-value"),
ensurePlainFunction: require("./ensure-plain-function"),
ensurePlainObject: require("./ensure-plain-object"),
ensurePromise: require("./ensure-promise"),
ensureThenable: require("./ensure-thenable"),
entries: require("./entries"),
eq: require("./eq"),
every: require("./every"),
filter: require("./filter"),
find: require("./find"),
findKey: require("./find-key"),
firstKey: require("./first-key"),
flatten: require("./flatten"),
forEach: require("./for-each"),
getPropertyNames: require("./get-property-names"),
is: require("./is"),
isArrayLike: require("./is-array-like"),
isCallable: require("./is-callable"),
isCopy: require("./is-copy"),
isCopyDeep: require("./is-copy-deep"),
isEmpty: require("./is-empty"),
isFiniteNumber: require("./is-finite-number"),
isInteger: require("./is-integer"),
isNaturalNumber: require("./is-natural-number"),
isNaturalNumberValue: require("./is-natural-number-value"),
isNumberValue: require("./is-number-value"),
isObject: require("./is-object"),
isPlainFunction: require("./is-plain-function"),
isPlainObject: require("./is-plain-object"),
isPromise: require("./is-promise"),
isThenable: require("./is-thenable"),
isValue: require("./is-value"),
keyOf: require("./key-of"),
keys: require("./keys"),
map: require("./map"),
mapKeys: require("./map-keys"),
normalizeOptions: require("./normalize-options"),
mixin: require("./mixin"),
mixinPrototypes: require("./mixin-prototypes"),
primitiveSet: require("./primitive-set"),
safeTraverse: require("./safe-traverse"),
serialize: require("./serialize"),
setPrototypeOf: require("./set-prototype-of"),
some: require("./some"),
toArray: require("./to-array"),
unserialize: require("./unserialize"),
validateArrayLike: require("./validate-array-like"),
validateArrayLikeObject: require("./validate-array-like-object"),
validCallable: require("./valid-callable"),
validObject: require("./valid-object"),
validateStringifiable: require("./validate-stringifiable"),
validateStringifiableValue: require("./validate-stringifiable-value"),
validValue: require("./valid-value")
};

View File

@@ -0,0 +1,594 @@
/* -*- Mode: js; js-indent-level: 2; -*- */
/*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/
/**
* This is a helper function for getting values from parameter/options
* objects.
*
* @param args The object we are extracting values from
* @param name The name of the property we are getting.
* @param defaultValue An optional value to return if the property is missing
* from the object. If this is not specified and the property is missing, an
* error will be thrown.
*/
function getArg(aArgs, aName, aDefaultValue) {
if (aName in aArgs) {
return aArgs[aName];
} else if (arguments.length === 3) {
return aDefaultValue;
} else {
throw new Error('"' + aName + '" is a required argument.');
}
}
exports.getArg = getArg;
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
var dataUrlRegexp = /^data:.+\,.+$/;
function urlParse(aUrl) {
var match = aUrl.match(urlRegexp);
if (!match) {
return null;
}
return {
scheme: match[1],
auth: match[2],
host: match[3],
port: match[4],
path: match[5]
};
}
exports.urlParse = urlParse;
function urlGenerate(aParsedUrl) {
var url = '';
if (aParsedUrl.scheme) {
url += aParsedUrl.scheme + ':';
}
url += '//';
if (aParsedUrl.auth) {
url += aParsedUrl.auth + '@';
}
if (aParsedUrl.host) {
url += aParsedUrl.host;
}
if (aParsedUrl.port) {
url += ":" + aParsedUrl.port
}
if (aParsedUrl.path) {
url += aParsedUrl.path;
}
return url;
}
exports.urlGenerate = urlGenerate;
var MAX_CACHED_INPUTS = 32;
/**
* Takes some function `f(input) -> result` and returns a memoized version of
* `f`.
*
* We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The
* memoization is a dumb-simple, linear least-recently-used cache.
*/
function lruMemoize(f) {
var cache = [];
return function(input) {
for (var i = 0; i < cache.length; i++) {
if (cache[i].input === input) {
var temp = cache[0];
cache[0] = cache[i];
cache[i] = temp;
return cache[0].result;
}
}
var result = f(input);
cache.unshift({
input,
result,
});
if (cache.length > MAX_CACHED_INPUTS) {
cache.pop();
}
return result;
};
}
/**
* Normalizes a path, or the path portion of a URL:
*
* - Replaces consecutive slashes with one slash.
* - Removes unnecessary '.' parts.
* - Removes unnecessary '<dir>/..' parts.
*
* Based on code in the Node.js 'path' core module.
*
* @param aPath The path or url to normalize.
*/
var normalize = lruMemoize(function normalize(aPath) {
var path = aPath;
var url = urlParse(aPath);
if (url) {
if (!url.path) {
return aPath;
}
path = url.path;
}
var isAbsolute = exports.isAbsolute(path);
// Split the path into parts between `/` characters. This is much faster than
// using `.split(/\/+/g)`.
var parts = [];
var start = 0;
var i = 0;
while (true) {
start = i;
i = path.indexOf("/", start);
if (i === -1) {
parts.push(path.slice(start));
break;
} else {
parts.push(path.slice(start, i));
while (i < path.length && path[i] === "/") {
i++;
}
}
}
for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
part = parts[i];
if (part === '.') {
parts.splice(i, 1);
} else if (part === '..') {
up++;
} else if (up > 0) {
if (part === '') {
// The first part is blank if the path is absolute. Trying to go
// above the root is a no-op. Therefore we can remove all '..' parts
// directly after the root.
parts.splice(i + 1, up);
up = 0;
} else {
parts.splice(i, 2);
up--;
}
}
}
path = parts.join('/');
if (path === '') {
path = isAbsolute ? '/' : '.';
}
if (url) {
url.path = path;
return urlGenerate(url);
}
return path;
});
exports.normalize = normalize;
/**
* Joins two paths/URLs.
*
* @param aRoot The root path or URL.
* @param aPath The path or URL to be joined with the root.
*
* - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
* scheme-relative URL: Then the scheme of aRoot, if any, is prepended
* first.
* - Otherwise aPath is a path. If aRoot is a URL, then its path portion
* is updated with the result and aRoot is returned. Otherwise the result
* is returned.
* - If aPath is absolute, the result is aPath.
* - Otherwise the two paths are joined with a slash.
* - Joining for example 'http://' and 'www.example.com' is also supported.
*/
function join(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
if (aPath === "") {
aPath = ".";
}
var aPathUrl = urlParse(aPath);
var aRootUrl = urlParse(aRoot);
if (aRootUrl) {
aRoot = aRootUrl.path || '/';
}
// `join(foo, '//www.example.org')`
if (aPathUrl && !aPathUrl.scheme) {
if (aRootUrl) {
aPathUrl.scheme = aRootUrl.scheme;
}
return urlGenerate(aPathUrl);
}
if (aPathUrl || aPath.match(dataUrlRegexp)) {
return aPath;
}
// `join('http://', 'www.example.com')`
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
aRootUrl.host = aPath;
return urlGenerate(aRootUrl);
}
var joined = aPath.charAt(0) === '/'
? aPath
: normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
if (aRootUrl) {
aRootUrl.path = joined;
return urlGenerate(aRootUrl);
}
return joined;
}
exports.join = join;
exports.isAbsolute = function (aPath) {
return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
};
/**
* Make a path relative to a URL or another path.
*
* @param aRoot The root path or URL.
* @param aPath The path or URL to be made relative to aRoot.
*/
function relative(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
aRoot = aRoot.replace(/\/$/, '');
// It is possible for the path to be above the root. In this case, simply
// checking whether the root is a prefix of the path won't work. Instead, we
// need to remove components from the root one by one, until either we find
// a prefix that fits, or we run out of components to remove.
var level = 0;
while (aPath.indexOf(aRoot + '/') !== 0) {
var index = aRoot.lastIndexOf("/");
if (index < 0) {
return aPath;
}
// If the only part of the root that is left is the scheme (i.e. http://,
// file:///, etc.), one or more slashes (/), or simply nothing at all, we
// have exhausted all components, so the path is not relative to the root.
aRoot = aRoot.slice(0, index);
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
return aPath;
}
++level;
}
// Make sure we add a "../" for each component we removed from the root.
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
}
exports.relative = relative;
var supportsNullProto = (function () {
var obj = Object.create(null);
return !('__proto__' in obj);
}());
function identity (s) {
return s;
}
/**
* Because behavior goes wacky when you set `__proto__` on objects, we
* have to prefix all the strings in our set with an arbitrary character.
*
* See https://github.com/mozilla/source-map/pull/31 and
* https://github.com/mozilla/source-map/issues/30
*
* @param String aStr
*/
function toSetString(aStr) {
if (isProtoString(aStr)) {
return '$' + aStr;
}
return aStr;
}
exports.toSetString = supportsNullProto ? identity : toSetString;
function fromSetString(aStr) {
if (isProtoString(aStr)) {
return aStr.slice(1);
}
return aStr;
}
exports.fromSetString = supportsNullProto ? identity : fromSetString;
function isProtoString(s) {
if (!s) {
return false;
}
var length = s.length;
if (length < 9 /* "__proto__".length */) {
return false;
}
if (s.charCodeAt(length - 1) !== 95 /* '_' */ ||
s.charCodeAt(length - 2) !== 95 /* '_' */ ||
s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
s.charCodeAt(length - 4) !== 116 /* 't' */ ||
s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
s.charCodeAt(length - 8) !== 95 /* '_' */ ||
s.charCodeAt(length - 9) !== 95 /* '_' */) {
return false;
}
for (var i = length - 10; i >= 0; i--) {
if (s.charCodeAt(i) !== 36 /* '$' */) {
return false;
}
}
return true;
}
/**
* Comparator between two mappings where the original positions are compared.
*
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
* mappings with the same original source/line/column, but different generated
* line and column the same. Useful when searching for a mapping with a
* stubbed out mapping.
*/
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
var cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0 || onlyCompareOriginal) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByOriginalPositions = compareByOriginalPositions;
function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
var cmp
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0 || onlyCompareOriginal) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;
/**
* Comparator between two mappings with deflated source and name indices where
* the generated positions are compared.
*
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
* mappings with the same generated line and column, but different
* source/name/original line and column the same. Useful when searching for a
* mapping with a stubbed out mapping.
*/
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0 || onlyCompareGenerated) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0 || onlyCompareGenerated) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;
function strcmp(aStr1, aStr2) {
if (aStr1 === aStr2) {
return 0;
}
if (aStr1 === null) {
return 1; // aStr2 !== null
}
if (aStr2 === null) {
return -1; // aStr1 !== null
}
if (aStr1 > aStr2) {
return 1;
}
return -1;
}
/**
* Comparator between two mappings with inflated source and name strings where
* the generated positions are compared.
*/
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
/**
* Strip any JSON XSSI avoidance prefix from the string (as documented
* in the source maps specification), and then parse the string as
* JSON.
*/
function parseSourceMapInput(str) {
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
}
exports.parseSourceMapInput = parseSourceMapInput;
/**
* Compute the URL of a source given the the source root, the source's
* URL, and the source map's URL.
*/
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
sourceURL = sourceURL || '';
if (sourceRoot) {
// This follows what Chrome does.
if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
sourceRoot += '/';
}
// The spec says:
// Line 4: An optional source root, useful for relocating source
// files on a server or removing repeated values in the
// “sources” entry. This value is prepended to the individual
// entries in the “source” field.
sourceURL = sourceRoot + sourceURL;
}
// Historically, SourceMapConsumer did not take the sourceMapURL as
// a parameter. This mode is still somewhat supported, which is why
// this code block is conditional. However, it's preferable to pass
// the source map URL to SourceMapConsumer, so that this function
// can implement the source URL resolution algorithm as outlined in
// the spec. This block is basically the equivalent of:
// new URL(sourceURL, sourceMapURL).toString()
// ... except it avoids using URL, which wasn't available in the
// older releases of node still supported by this library.
//
// The spec says:
// If the sources are not absolute URLs after prepending of the
// “sourceRoot”, the sources are resolved relative to the
// SourceMap (like resolving script src in a html document).
if (sourceMapURL) {
var parsed = urlParse(sourceMapURL);
if (!parsed) {
throw new Error("sourceMapURL could not be parsed");
}
if (parsed.path) {
// Strip the last path component, but keep the "/".
var index = parsed.path.lastIndexOf('/');
if (index >= 0) {
parsed.path = parsed.path.substring(0, index + 1);
}
}
sourceURL = join(urlGenerate(parsed), sourceURL);
}
return normalize(sourceURL);
}
exports.computeSourceURL = computeSourceURL;

View File

@@ -0,0 +1,117 @@
import { Observable } from '../Observable';
import { EmptyError } from '../util/EmptyError';
import { MonoTypeOperatorFunction, OperatorFunction, TruthyTypesOf } from '../types';
import { SequenceError } from '../util/SequenceError';
import { NotFoundError } from '../util/NotFoundError';
import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
export function single<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;
export function single<T>(predicate?: (value: T, index: number, source: Observable<T>) => boolean): MonoTypeOperatorFunction<T>;
/**
* Returns an observable that asserts that only one value is
* emitted from the observable that matches the predicate. If no
* predicate is provided, then it will assert that the observable
* only emits one value.
*
* In the event that the observable is empty, it will throw an
* {@link EmptyError}.
*
* In the event that two values are found that match the predicate,
* or when there are two values emitted and no predicate, it will
* throw a {@link SequenceError}
*
* In the event that no values match the predicate, if one is provided,
* it will throw a {@link NotFoundError}
*
* ## Example
*
* Expect only `name` beginning with `'B'`
*
* ```ts
* import { of, single } from 'rxjs';
*
* const source1 = of(
* { name: 'Ben' },
* { name: 'Tracy' },
* { name: 'Laney' },
* { name: 'Lily' }
* );
*
* source1
* .pipe(single(x => x.name.startsWith('B')))
* .subscribe(x => console.log(x));
* // Emits 'Ben'
*
*
* const source2 = of(
* { name: 'Ben' },
* { name: 'Tracy' },
* { name: 'Bradley' },
* { name: 'Lincoln' }
* );
*
* source2
* .pipe(single(x => x.name.startsWith('B')))
* .subscribe({ error: err => console.error(err) });
* // Error emitted: SequenceError('Too many values match')
*
*
* const source3 = of(
* { name: 'Laney' },
* { name: 'Tracy' },
* { name: 'Lily' },
* { name: 'Lincoln' }
* );
*
* source3
* .pipe(single(x => x.name.startsWith('B')))
* .subscribe({ error: err => console.error(err) });
* // Error emitted: NotFoundError('No values match')
* ```
*
* @see {@link first}
* @see {@link find}
* @see {@link findIndex}
* @see {@link elementAt}
*
* @throws {NotFoundError} Delivers an NotFoundError to the Observer's `error`
* callback if the Observable completes before any `next` notification was sent.
* @throws {SequenceError} Delivers a SequenceError if more than one value is emitted that matches the
* provided predicate. If no predicate is provided, will deliver a SequenceError if more
* than one value comes from the source
* @param {Function} predicate - A predicate function to evaluate items emitted by the source Observable.
* @return A function that returns an Observable that emits the single item
* emitted by the source Observable that matches the predicate.
*/
export function single<T>(predicate?: (value: T, index: number, source: Observable<T>) => boolean): MonoTypeOperatorFunction<T> {
return operate((source, subscriber) => {
let hasValue = false;
let singleValue: T;
let seenValue = false;
let index = 0;
source.subscribe(
createOperatorSubscriber(
subscriber,
(value) => {
seenValue = true;
if (!predicate || predicate(value, index++, source)) {
hasValue && subscriber.error(new SequenceError('Too many matching values'));
hasValue = true;
singleValue = value;
}
},
() => {
if (hasValue) {
subscriber.next(singleValue);
subscriber.complete();
} else {
subscriber.error(seenValue ? new NotFoundError('No matching values') : new EmptyError());
}
}
)
);
});
}

View File

@@ -0,0 +1,74 @@
{
"name": "execa",
"version": "5.1.1",
"description": "Process execution for humans",
"license": "MIT",
"repository": "sindresorhus/execa",
"funding": "https://github.com/sindresorhus/execa?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && nyc ava && tsd"
},
"files": [
"index.js",
"index.d.ts",
"lib"
],
"keywords": [
"exec",
"child",
"process",
"execute",
"fork",
"execfile",
"spawn",
"file",
"shell",
"bin",
"binary",
"binaries",
"npm",
"path",
"local"
],
"dependencies": {
"cross-spawn": "^7.0.3",
"get-stream": "^6.0.0",
"human-signals": "^2.1.0",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.1",
"onetime": "^5.1.2",
"signal-exit": "^3.0.3",
"strip-final-newline": "^2.0.0"
},
"devDependencies": {
"@types/node": "^14.14.10",
"ava": "^2.4.0",
"get-node": "^11.0.1",
"is-running": "^2.1.0",
"nyc": "^15.1.0",
"p-event": "^4.2.0",
"tempfile": "^3.0.0",
"tsd": "^0.13.1",
"xo": "^0.35.0"
},
"nyc": {
"reporter": [
"text",
"lcov"
],
"exclude": [
"**/fixtures/**",
"**/test.js",
"**/test/**"
]
}
}

View File

@@ -0,0 +1,142 @@
# camelcase
> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`
Correctly handles Unicode strings.
If you use this on untrusted user input, don't forget to limit the length to something reasonable.
## Install
```sh
npm install camelcase
```
## Usage
```js
import camelCase from 'camelcase';
camelCase('foo-bar');
//=> 'fooBar'
camelCase('foo_bar');
//=> 'fooBar'
camelCase('Foo-Bar');
//=> 'fooBar'
camelCase('розовый_пушистый_единорог');
//=> 'розовыйПушистыйЕдинорог'
camelCase('Foo-Bar', {pascalCase: true});
//=> 'FooBar'
camelCase('--foo.bar', {pascalCase: false});
//=> 'fooBar'
camelCase('Foo-BAR', {preserveConsecutiveUppercase: true});
//=> 'fooBAR'
camelCase('fooBAR', {pascalCase: true, preserveConsecutiveUppercase: true}));
//=> 'FooBAR'
camelCase('foo bar');
//=> 'fooBar'
console.log(process.argv[3]);
//=> '--foo-bar'
camelCase(process.argv[3]);
//=> 'fooBar'
camelCase(['foo', 'bar']);
//=> 'fooBar'
camelCase(['__foo__', '--bar'], {pascalCase: true});
//=> 'FooBar'
camelCase(['foo', 'BAR'], {pascalCase: true, preserveConsecutiveUppercase: true})
//=> 'FooBAR'
camelCase('lorem-ipsum', {locale: 'en-US'});
//=> 'loremIpsum'
```
## API
### camelCase(input, options?)
#### input
Type: `string | string[]`
String to convert to camel case.
#### options
Type: `object`
##### pascalCase
Type: `boolean`\
Default: `false`
Uppercase the first character: `foo-bar` → `FooBar`
##### preserveConsecutiveUppercase
Type: `boolean`\
Default: `false`
Preserve consecutive uppercase characters: `foo-BAR` → `FooBAR`.
##### locale
Type: `false | string | string[]`\
Default: The host environments current locale.
The locale parameter indicates the locale to be used to convert to upper/lower case according to any locale-specific case mappings. If multiple locales are given in an array, the best available locale is used.
```js
import camelCase from 'camelcase';
camelCase('lorem-ipsum', {locale: 'en-US'});
//=> 'loremIpsum'
camelCase('lorem-ipsum', {locale: 'tr-TR'});
//=> 'loremİpsum'
camelCase('lorem-ipsum', {locale: ['en-US', 'en-GB']});
//=> 'loremIpsum'
camelCase('lorem-ipsum', {locale: ['tr', 'TR', 'tr-TR']});
//=> 'loremİpsum'
```
Setting `locale: false` ignores the platform locale and uses the [Unicode Default Case Conversion](https://unicode-org.github.io/icu/userguide/transforms/casemappings.html#simple-single-character-case-mapping) algorithm:
```js
import camelCase from 'camelcase';
// On a platform with 'tr-TR'
camelCase('lorem-ipsum');
//=> 'loremİpsum'
camelCase('lorem-ipsum', {locale: false});
//=> 'loremIpsum'
```
## camelcase for enterprise
Available as part of the Tidelift Subscription.
The maintainers of camelcase and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-camelcase?utm_source=npm-camelcase&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
## Related
- [decamelize](https://github.com/sindresorhus/decamelize) - The inverse of this module
- [uppercamelcase](https://github.com/SamVerschueren/uppercamelcase) - Like this module, but to PascalCase instead of camelCase
- [titleize](https://github.com/sindresorhus/titleize) - Capitalize every word in string
- [humanize-string](https://github.com/sindresorhus/humanize-string) - Convert a camelized/dasherized/underscored string into a humanized one
- [camelcase-keys](https://github.com/sindresorhus/camelcase-keys) - Convert object keys to camel case

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","132":"J D E F CC"},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":"7 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 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":"DC tB","257":"0 1 2 3 4 5 6 I v J D E F A B C K L G M N O w g x y z EC FC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 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 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":"I v J D"},E:{"1":"v J D E F A B C K L G IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I HC zB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 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 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":"F B C PC QC RC SC qB AC TC rB"},G:{"1":"E VC WC 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"},H:{"2":"oC"},I:{"1":"tB I f sC BC tC uC","2":"pC qC rC"},J:{"1":"D A"},K:{"1":"h","2":"A B C qB AC rB"},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":"AD BD"}},B:1,C:"defer attribute for external scripts"};

View File

@@ -0,0 +1,111 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for csv2json/src/fileline.test.ts</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/src</a> fileline.test.ts
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>4/4</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Branches</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>0/0</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>4/4</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 high'></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>
<a name='L13'></a><a href='#L13'>13</a>
<a name='L14'></a><a href='#L14'>14</a>
<a name='L15'></a><a href='#L15'>15</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-yes">1x</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import {stringToLines} from "./fileline";
import { mergeParams } from "./Parameters";
import { Converter } from "./Converter";
var assert = require("assert");
describe("fileline function", function() {
it ("should convert data to multiple lines ", function() {
const conv=new Converter();
var data = "abcde\nefef";
var result = stringToLines(data, conv.parseRuntime);
assert.equal(result.lines.length, 1);
assert.equal(result.partial, "efef");
assert.equal(result.lines[0], "abcde");
});
});
&nbsp;</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>

View File

@@ -0,0 +1,19 @@
Copyright (C) 2011-2019 by Yehuda Katz
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.

View File

@@ -0,0 +1,15 @@
@root
module
es5
indent 2
maxlen 80
tabs
ass
plusplus
nomen
./benchmark
predef+ console

View File

@@ -0,0 +1,47 @@
"use strict";;
Object.defineProperty(exports, "__esModule", { value: true });
var tslib_1 = require("tslib");
var types_1 = tslib_1.__importDefault(require("./types"));
function default_1(fork) {
var types = fork.use(types_1.default);
var Type = types.Type;
var builtin = types.builtInTypes;
var isNumber = builtin.number;
// An example of constructing a new type with arbitrary constraints from
// an existing type.
function geq(than) {
return Type.from(function (value) { return isNumber.check(value) && value >= than; }, isNumber + " >= " + than);
}
;
// Default value-returning functions that may optionally be passed as a
// third argument to Def.prototype.field.
var defaults = {
// Functions were used because (among other reasons) that's the most
// elegant way to allow for the emptyArray one always to give a new
// array instance.
"null": function () { return null; },
"emptyArray": function () { return []; },
"false": function () { return false; },
"true": function () { return true; },
"undefined": function () { },
"use strict": function () { return "use strict"; }
};
var naiveIsPrimitive = Type.or(builtin.string, builtin.number, builtin.boolean, builtin.null, builtin.undefined);
var isPrimitive = Type.from(function (value) {
if (value === null)
return true;
var type = typeof value;
if (type === "object" ||
type === "function") {
return false;
}
return true;
}, naiveIsPrimitive.toString());
return {
geq: geq,
defaults: defaults,
isPrimitive: isPrimitive,
};
}
exports.default = default_1;
module.exports = exports["default"];

View File

@@ -0,0 +1,35 @@
"use strict";
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
Object.defineProperty(exports, "__esModule", { value: true });
exports.ResponsePermission = void 0;
var ResponsePermission;
(function (ResponsePermission) {
let target;
(function (target) {
target["RUNNER"] = "RUNNER";
target["ORGANIZATION"] = "ORGANIZATION";
target["TEAM"] = "TEAM";
target["TRACK"] = "TRACK";
target["USER"] = "USER";
target["USERGROUP"] = "USERGROUP";
target["PERMISSION"] = "PERMISSION";
target["STATSCLIENT"] = "STATSCLIENT";
target["DONOR"] = "DONOR";
target["SCAN"] = "SCAN";
target["STATION"] = "STATION";
target["CARD"] = "CARD";
target["DONATION"] = "DONATION";
target["CONTACT"] = "CONTACT";
target["MAIL"] = "MAIL";
})(target = ResponsePermission.target || (ResponsePermission.target = {}));
let action;
(function (action) {
action["GET"] = "GET";
action["CREATE"] = "CREATE";
action["UPDATE"] = "UPDATE";
action["DELETE"] = "DELETE";
action["IMPORT"] = "IMPORT";
})(action = ResponsePermission.action || (ResponsePermission.action = {}));
})(ResponsePermission = exports.ResponsePermission || (exports.ResponsePermission = {}));

View File

@@ -0,0 +1,4 @@
import type { Transformer, Options } from '../types';
/** Adapted from https://github.com/TehShrike/svelte-preprocess-postcss */
declare const transformer: Transformer<Options.Postcss>;
export { transformer };

View File

@@ -0,0 +1,3 @@
"use strict";
module.exports = require("./is-implemented")() ? Array.prototype.copyWithin : require("./shim");

View File

@@ -0,0 +1,260 @@
// Generated by LiveScript 1.6.0
(function(){
var ref$, id, find, sort, min, max, map, unlines, nameToRaw, dasherize, naturalJoin, wordWrap, wordwrap, getPreText, setHelpStyleDefaults, generateHelpForOption, generateHelp;
ref$ = require('prelude-ls'), id = ref$.id, find = ref$.find, sort = ref$.sort, min = ref$.min, max = ref$.max, map = ref$.map, unlines = ref$.unlines;
ref$ = require('./util'), nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize, naturalJoin = ref$.naturalJoin;
wordWrap = require('word-wrap');
wordwrap = function(a, b){
var ref$, indent, width;
ref$ = b === undefined
? ['', a - 1]
: [repeatString$(' ', a), b - a - 1], indent = ref$[0], width = ref$[1];
return function(text){
return wordWrap(text, {
indent: indent,
width: width,
trim: true
});
};
};
getPreText = function(option, arg$, maxWidth){
var mainName, shortNames, ref$, longNames, type, description, aliasSeparator, typeSeparator, initialIndent, names, namesString, namesStringLen, typeSeparatorString, typeSeparatorStringLen, wrap;
mainName = option.option, shortNames = (ref$ = option.shortNames) != null
? ref$
: [], longNames = (ref$ = option.longNames) != null
? ref$
: [], type = option.type, description = option.description;
aliasSeparator = arg$.aliasSeparator, typeSeparator = arg$.typeSeparator, initialIndent = arg$.initialIndent;
if (option.negateName) {
mainName = "no-" + mainName;
if (longNames) {
longNames = map(function(it){
return "no-" + it;
}, longNames);
}
}
names = mainName.length === 1
? [mainName].concat(shortNames, longNames)
: shortNames.concat([mainName], longNames);
namesString = map(nameToRaw, names).join(aliasSeparator);
namesStringLen = namesString.length;
typeSeparatorString = mainName === 'NUM' ? '::' : typeSeparator;
typeSeparatorStringLen = typeSeparatorString.length;
if (maxWidth != null && !option.boolean && initialIndent + namesStringLen + typeSeparatorStringLen + type.length > maxWidth) {
wrap = wordwrap(initialIndent + namesStringLen + typeSeparatorStringLen, maxWidth);
return namesString + "" + typeSeparatorString + wrap(type).replace(/^\s+/, '');
} else {
return namesString + "" + (option.boolean
? ''
: typeSeparatorString + "" + type);
}
};
setHelpStyleDefaults = function(helpStyle){
helpStyle.aliasSeparator == null && (helpStyle.aliasSeparator = ', ');
helpStyle.typeSeparator == null && (helpStyle.typeSeparator = ' ');
helpStyle.descriptionSeparator == null && (helpStyle.descriptionSeparator = ' ');
helpStyle.initialIndent == null && (helpStyle.initialIndent = 2);
helpStyle.secondaryIndent == null && (helpStyle.secondaryIndent = 4);
helpStyle.maxPadFactor == null && (helpStyle.maxPadFactor = 1.5);
};
generateHelpForOption = function(getOption, arg$){
var stdout, helpStyle, ref$;
stdout = arg$.stdout, helpStyle = (ref$ = arg$.helpStyle) != null
? ref$
: {};
setHelpStyleDefaults(helpStyle);
return function(optionName){
var maxWidth, wrap, option, e, pre, defaultString, restPositionalString, description, fullDescription, that, preDescription, descriptionString, exampleString, examples, seperator;
maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null;
wrap = maxWidth ? wordwrap(maxWidth) : id;
try {
option = getOption(dasherize(optionName));
} catch (e$) {
e = e$;
return e.message;
}
pre = getPreText(option, helpStyle);
defaultString = option['default'] && !option.negateName ? "\ndefault: " + option['default'] : '';
restPositionalString = option.restPositional ? 'Everything after this option is considered a positional argument, even if it looks like an option.' : '';
description = option.longDescription || option.description && sentencize(option.description);
fullDescription = description && restPositionalString
? description + " " + restPositionalString
: (that = description || restPositionalString) ? that : '';
preDescription = 'description:';
descriptionString = !fullDescription
? ''
: maxWidth && fullDescription.length - 1 - preDescription.length > maxWidth
? "\n" + preDescription + "\n" + wrap(fullDescription)
: "\n" + preDescription + " " + fullDescription;
exampleString = (that = option.example) ? (examples = [].concat(that), examples.length > 1
? "\nexamples:\n" + unlines(examples)
: "\nexample: " + examples[0]) : '';
seperator = defaultString || descriptionString || exampleString ? "\n" + repeatString$('=', pre.length) : '';
return pre + "" + seperator + defaultString + descriptionString + exampleString;
};
};
generateHelp = function(arg$){
var options, prepend, append, helpStyle, ref$, stdout, aliasSeparator, typeSeparator, descriptionSeparator, maxPadFactor, initialIndent, secondaryIndent;
options = arg$.options, prepend = arg$.prepend, append = arg$.append, helpStyle = (ref$ = arg$.helpStyle) != null
? ref$
: {}, stdout = arg$.stdout;
setHelpStyleDefaults(helpStyle);
aliasSeparator = helpStyle.aliasSeparator, typeSeparator = helpStyle.typeSeparator, descriptionSeparator = helpStyle.descriptionSeparator, maxPadFactor = helpStyle.maxPadFactor, initialIndent = helpStyle.initialIndent, secondaryIndent = helpStyle.secondaryIndent;
return function(arg$){
var ref$, showHidden, interpolate, maxWidth, output, out, data, optionCount, totalPreLen, preLens, i$, len$, item, that, pre, descParts, desc, preLen, sortedPreLens, maxPreLen, preLenMean, x, padAmount, descSepLen, fullWrapCount, partialWrapCount, descLen, totalLen, initialSpace, wrapAllFull, i, wrap;
ref$ = arg$ != null
? arg$
: {}, showHidden = ref$.showHidden, interpolate = ref$.interpolate;
maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null;
output = [];
out = function(it){
return output.push(it != null ? it : '');
};
if (prepend) {
out(interpolate ? interp(prepend, interpolate) : prepend);
out();
}
data = [];
optionCount = 0;
totalPreLen = 0;
preLens = [];
for (i$ = 0, len$ = (ref$ = options).length; i$ < len$; ++i$) {
item = ref$[i$];
if (showHidden || !item.hidden) {
if (that = item.heading) {
data.push({
type: 'heading',
value: that
});
} else {
pre = getPreText(item, helpStyle, maxWidth);
descParts = [];
if ((that = item.description) != null) {
descParts.push(that);
}
if (that = item['enum']) {
descParts.push("either: " + naturalJoin(that));
}
if (item['default'] && !item.negateName) {
descParts.push("default: " + item['default']);
}
desc = descParts.join(' - ');
data.push({
type: 'option',
pre: pre,
desc: desc,
descLen: desc.length
});
preLen = pre.length;
optionCount++;
totalPreLen += preLen;
preLens.push(preLen);
}
}
}
sortedPreLens = sort(preLens);
maxPreLen = sortedPreLens[sortedPreLens.length - 1];
preLenMean = initialIndent + totalPreLen / optionCount;
x = optionCount > 2 ? min(preLenMean * maxPadFactor, maxPreLen) : maxPreLen;
for (i$ = sortedPreLens.length - 1; i$ >= 0; --i$) {
preLen = sortedPreLens[i$];
if (preLen <= x) {
padAmount = preLen;
break;
}
}
descSepLen = descriptionSeparator.length;
if (maxWidth != null) {
fullWrapCount = 0;
partialWrapCount = 0;
for (i$ = 0, len$ = data.length; i$ < len$; ++i$) {
item = data[i$];
if (item.type === 'option') {
pre = item.pre, desc = item.desc, descLen = item.descLen;
if (descLen === 0) {
item.wrap = 'none';
} else {
preLen = max(padAmount, pre.length) + initialIndent + descSepLen;
totalLen = preLen + descLen;
if (totalLen > maxWidth) {
if (descLen / 2.5 > maxWidth - preLen) {
fullWrapCount++;
item.wrap = 'full';
} else {
partialWrapCount++;
item.wrap = 'partial';
}
} else {
item.wrap = 'none';
}
}
}
}
}
initialSpace = repeatString$(' ', initialIndent);
wrapAllFull = optionCount > 1 && fullWrapCount + partialWrapCount * 0.5 > optionCount * 0.5;
for (i$ = 0, len$ = data.length; i$ < len$; ++i$) {
i = i$;
item = data[i$];
if (item.type === 'heading') {
if (i !== 0) {
out();
}
out(item.value + ":");
} else {
pre = item.pre, desc = item.desc, descLen = item.descLen, wrap = item.wrap;
if (maxWidth != null) {
if (wrapAllFull || wrap === 'full') {
wrap = wordwrap(initialIndent + secondaryIndent, maxWidth);
out(initialSpace + "" + pre + "\n" + wrap(desc));
continue;
} else if (wrap === 'partial') {
wrap = wordwrap(initialIndent + descSepLen + max(padAmount, pre.length), maxWidth);
out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + wrap(desc).replace(/^\s+/, ''));
continue;
}
}
if (descLen === 0) {
out(initialSpace + "" + pre);
} else {
out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + desc);
}
}
}
if (append) {
out();
out(interpolate ? interp(append, interpolate) : append);
}
return unlines(output);
};
};
function pad(str, num){
var len, padAmount;
len = str.length;
padAmount = num - len;
return str + "" + repeatString$(' ', padAmount > 0 ? padAmount : 0);
}
function sentencize(str){
var first, rest, period;
first = str.charAt(0).toUpperCase();
rest = str.slice(1);
period = /[\.!\?]$/.test(str) ? '' : '.';
return first + "" + rest + period;
}
function interp(string, object){
return string.replace(/{{([a-zA-Z$_][a-zA-Z$_0-9]*)}}/g, function(arg$, key){
var ref$;
return (ref$ = object[key]) != null
? ref$
: "{{" + key + "}}";
});
}
module.exports = {
generateHelp: generateHelp,
generateHelpForOption: generateHelpForOption
};
function repeatString$(str, n){
for (var r = ''; n > 0; (n >>= 1) && (str += str)) if (n & 1) r += str;
return r;
}
}).call(this);

View File

@@ -0,0 +1,4 @@
const VERSION = "9.0.0";
export { VERSION };
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,12 @@
export type ResponseDonor = {
receiptNeeded: boolean;
donationAmount: number;
paidDonationAmount: number;
id: number;
firstname: string;
middlename: string;
lastname: string;
phone: string;
email: string;
address?: any;
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"weekdayRange.js","sourceRoot":"","sources":["../src/weekdayRange.ts"],"names":[],"mappings":";;AAAA,iCAA+B;AAG/B,MAAM,QAAQ,GAAc,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,SAAwB,YAAY,CACnC,GAAY,EACZ,GAAmB,EACnB,GAAS;IAET,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC;IAClB,IAAI,QAAQ,GAAG,CAAC,CAAC,CAAC;IAClB,IAAI,QAAQ,GAAG,KAAK,CAAC;IAErB,IAAI,IAAA,YAAK,EAAC,GAAG,CAAC,EAAE;QACf,UAAU,GAAG,IAAI,CAAC;KAClB;SAAM,IAAI,IAAA,YAAK,EAAC,GAAG,CAAC,EAAE;QACtB,UAAU,GAAG,IAAI,CAAC;QAClB,QAAQ,GAAG,IAAI,CAAC;KAChB;IAED,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAEjC,IAAI,CAAC,QAAQ,IAAI,SAAS,CAAC,GAAG,CAAC,EAAE;QAChC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;KACjC;IAED,IAAI,SAAS,GAAG,YAAY,CAAC,UAAU,CAAC,CAAC;IACzC,IAAI,MAAe,CAAC;IAEpB,IAAI,QAAQ,GAAG,CAAC,EAAE;QACjB,MAAM,GAAG,SAAS,KAAK,QAAQ,CAAC;KAChC;SAAM,IAAI,QAAQ,IAAI,QAAQ,EAAE;QAChC,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;KACrD;SAAM;QACN,MAAM;YACL,YAAY,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;gBACpC,YAAY,CAAC,CAAC,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC;KACtC;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AArCD,+BAqCC;AAED,SAAS,YAAY,CAAC,GAAY;IACjC,OAAO,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC;AAC3D,CAAC;AAED,2BAA2B;AAC3B,SAAS,YAAY,CAAC,KAAa,EAAE,KAAa,EAAE,MAAc;IACjE,OAAO,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,MAAM,CAAC;AAC1C,CAAC;AAED,SAAS,SAAS,CAAC,CAAM;IACxB,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;AACnC,CAAC"}

View File

@@ -0,0 +1,15 @@
/// <reference types="node" />
import * as fs from 'fs';
import * as fsStat from '@nodelib/fs.stat';
import Settings from '../settings';
import { Entry, ErrnoException, Pattern, ReaderOptions } from '../types';
export default abstract class Reader<T> {
protected readonly _settings: Settings;
protected readonly _fsStatSettings: fsStat.Settings;
constructor(_settings: Settings);
abstract dynamic(root: string, options: ReaderOptions): T;
abstract static(patterns: Pattern[], options: ReaderOptions): T;
protected _getFullEntryPath(filepath: string): string;
protected _makeEntry(stats: fs.Stats, pattern: Pattern): Entry;
protected _isFatalError(error: ErrnoException): boolean;
}

View File

@@ -0,0 +1,34 @@
{
"name": "read-cache",
"version": "1.0.0",
"description": "Reads and caches the entire contents of a file until it is modified",
"files": [
"index.js"
],
"main": "index.js",
"scripts": {
"test": "ava"
},
"repository": {
"type": "git",
"url": "git+https://github.com/TrySound/read-cache.git"
},
"keywords": [
"fs",
"read",
"cache"
],
"author": "Bogdan Chadkin <trysound@yandex.ru>",
"license": "MIT",
"bugs": {
"url": "https://github.com/TrySound/read-cache/issues"
},
"homepage": "https://github.com/TrySound/read-cache#readme",
"devDependencies": {
"ava": "^0.9.1",
"del": "^2.2.0"
},
"dependencies": {
"pify": "^2.3.0"
}
}

View File

@@ -0,0 +1,9 @@
'use strict';
module.exports = function reduce(arr, fn, init) {
var acc = init;
for (var i = 0; i < arr.length; i += 1) {
acc = fn(acc, arr[i], i);
}
return acc;
};

View File

@@ -0,0 +1,89 @@
// Copyright Joyent, Inc. and other Node 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.
// a duplex stream is just a stream that is both readable and writable.
// Since JS doesn't have multiple prototypal inheritance, this class
// prototypally inherits from Readable, and then parasitically from
// Writable.
module.exports = Duplex;
/*<replacement>*/
var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) keys.push(key);
return keys;
}
/*</replacement>*/
/*<replacement>*/
var util = require('core-util-is');
util.inherits = require('inherits');
/*</replacement>*/
var Readable = require('./_stream_readable');
var Writable = require('./_stream_writable');
util.inherits(Duplex, Readable);
forEach(objectKeys(Writable.prototype), function(method) {
if (!Duplex.prototype[method])
Duplex.prototype[method] = Writable.prototype[method];
});
function Duplex(options) {
if (!(this instanceof Duplex))
return new Duplex(options);
Readable.call(this, options);
Writable.call(this, options);
if (options && options.readable === false)
this.readable = false;
if (options && options.writable === false)
this.writable = false;
this.allowHalfOpen = true;
if (options && options.allowHalfOpen === false)
this.allowHalfOpen = false;
this.once('end', onend);
}
// the no-half-open enforcer
function onend() {
// if we allow half-open state, or if the writable side ended,
// then we're ok.
if (this.allowHalfOpen || this._writableState.ended)
return;
// no more data can be written.
// But allow more writes to happen in this tick.
process.nextTick(this.end.bind(this));
}
function forEach (xs, f) {
for (var i = 0, l = xs.length; i < l; i++) {
f(xs[i], i);
}
}

View File

@@ -0,0 +1,107 @@
// Gathers statistical data, and provides them in convinient form
"use strict";
var partial = require("es5-ext/function/#/partial")
, forEach = require("es5-ext/object/for-each")
, pad = require("es5-ext/string/#/pad")
, compact = require("es5-ext/array/#/compact")
, d = require("d")
, memoize = require("./plain");
var max = Math.max, stats = exports.statistics = {};
Object.defineProperty(
memoize,
"__profiler__",
d(function (conf) {
var id, source, data, stack;
stack = new Error().stack;
if (
!stack ||
!stack.split("\n").slice(3).some(function (line) {
if (line.indexOf("/memoizee/") === -1 && line.indexOf(" (native)") === -1) {
source = line.replace(/\n/g, "\\n").trim();
return true;
}
return false;
})
) {
source = "unknown";
}
id = compact.call([conf.profileName, source]).join(", ");
if (!stats[id]) stats[id] = { initial: 0, cached: 0 };
data = stats[id];
conf.on("set", function () { ++data.initial; });
conf.on("get", function () { ++data.cached; });
})
);
exports.log = function () {
var initial, cached, ordered, ipad, cpad, ppad, toPrc, log;
initial = cached = 0;
ordered = [];
toPrc = function (initialCount, cachedCount) {
if (!initialCount && !cachedCount) {
return "0.00";
}
return ((cachedCount / (initialCount + cachedCount)) * 100).toFixed(2);
};
log = "------------------------------------------------------------\n";
log += "Memoize statistics:\n\n";
forEach(
stats,
function (data, name) {
initial += data.initial;
cached += data.cached;
ordered.push([name, data]);
},
null,
function (nameA, nameB) {
return (
this[nameB].initial +
this[nameB].cached -
(this[nameA].initial + this[nameA].cached)
);
}
);
ipad = partial.call(pad, " ", max(String(initial).length, "Init".length));
cpad = partial.call(pad, " ", max(String(cached).length, "Cache".length));
ppad = partial.call(pad, " ", "%Cache".length);
log +=
ipad.call("Init") +
" " +
cpad.call("Cache") +
" " +
ppad.call("%Cache") +
" Source location\n";
log +=
ipad.call(initial) +
" " +
cpad.call(cached) +
" " +
ppad.call(toPrc(initial, cached)) +
" (all)\n";
ordered.forEach(function (data) {
var name = data[0];
data = data[1];
log +=
ipad.call(data.initial) +
" " +
cpad.call(data.cached) +
" " +
ppad.call(toPrc(data.initial, data.cached)) +
" " +
name +
"\n";
});
log += "------------------------------------------------------------\n";
return log;
};

View File

@@ -0,0 +1,33 @@
var toInteger = require('./toInteger');
/**
* Checks if `value` is an integer.
*
* **Note:** This method is based on
* [`Number.isInteger`](https://mdn.io/Number/isInteger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is an integer, else `false`.
* @example
*
* _.isInteger(3);
* // => true
*
* _.isInteger(Number.MIN_VALUE);
* // => false
*
* _.isInteger(Infinity);
* // => false
*
* _.isInteger('3');
* // => false
*/
function isInteger(value) {
return typeof value == 'number' && value == toInteger(value);
}
module.exports = isInteger;

View File

@@ -0,0 +1,44 @@
// given a set of versions and a range, create a "simplified" range
// that includes the same versions that the original range does
// If the original range is shorter than the simplified one, return that.
const satisfies = require('../functions/satisfies.js')
const compare = require('../functions/compare.js')
module.exports = (versions, range, options) => {
const set = []
let min = null
let prev = null
const v = versions.sort((a, b) => compare(a, b, options))
for (const version of v) {
const included = satisfies(version, range, options)
if (included) {
prev = version
if (!min)
min = version
} else {
if (prev) {
set.push([min, prev])
}
prev = null
min = null
}
}
if (min)
set.push([min, null])
const ranges = []
for (const [min, max] of set) {
if (min === max)
ranges.push(min)
else if (!max && min === v[0])
ranges.push('*')
else if (!max)
ranges.push(`>=${min}`)
else if (min === v[0])
ranges.push(`<=${max}`)
else
ranges.push(`${min} - ${max}`)
}
const simplified = ranges.join(' || ')
const original = typeof range.raw === 'string' ? range.raw : String(range)
return simplified.length < original.length ? simplified : range
}

View File

@@ -0,0 +1,34 @@
{
"name": "acorn-walk",
"description": "ECMAScript (ESTree) AST walker",
"homepage": "https://github.com/acornjs/acorn",
"main": "dist/walk.js",
"types": "dist/walk.d.ts",
"module": "dist/walk.mjs",
"version": "7.2.0",
"engines": {"node": ">=0.4.0"},
"maintainers": [
{
"name": "Marijn Haverbeke",
"email": "marijnh@gmail.com",
"web": "https://marijnhaverbeke.nl"
},
{
"name": "Ingvar Stepanyan",
"email": "me@rreverser.com",
"web": "https://rreverser.com/"
},
{
"name": "Adrian Heine",
"web": "http://adrianheine.de"
}
],
"repository": {
"type": "git",
"url": "https://github.com/acornjs/acorn.git"
},
"scripts": {
"prepare": "cd ..; npm run build:walk"
},
"license": "MIT"
}

View File

@@ -0,0 +1,25 @@
"use strict";
var toPosInt = require("../../number/to-pos-integer")
, callable = require("../../object/valid-callable")
, defineLength = require("../_define-length")
, slice = Array.prototype.slice
, apply = Function.prototype.apply
, curry;
curry = function self(fn, length, preArgs) {
return defineLength(
function () {
var args = preArgs
? preArgs.concat(slice.call(arguments, 0, length - preArgs.length))
: slice.call(arguments, 0, length);
return args.length === length ? apply.call(fn, this, args) : self(fn, length, args);
},
preArgs ? length - preArgs.length : length
);
};
module.exports = function (/* Length*/) {
var length = arguments[0];
return curry(callable(this), isNaN(length) ? toPosInt(this.length) : toPosInt(length));
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"debounceTime.js","sourceRoot":"","sources":["../../../../src/internal/operators/debounceTime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAGpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA2DhE,MAAM,UAAU,YAAY,CAAI,OAAe,EAAE,SAAyC;IAAzC,0BAAA,EAAA,0BAAyC;IACxF,OAAO,OAAO,CAAC,UAAC,MAAM,EAAE,UAAU;QAChC,IAAI,UAAU,GAAwB,IAAI,CAAC;QAC3C,IAAI,SAAS,GAAa,IAAI,CAAC;QAC/B,IAAI,QAAQ,GAAkB,IAAI,CAAC;QAEnC,IAAM,IAAI,GAAG;YACX,IAAI,UAAU,EAAE;gBAEd,UAAU,CAAC,WAAW,EAAE,CAAC;gBACzB,UAAU,GAAG,IAAI,CAAC;gBAClB,IAAM,KAAK,GAAG,SAAU,CAAC;gBACzB,SAAS,GAAG,IAAI,CAAC;gBACjB,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACxB;QACH,CAAC,CAAC;QACF,SAAS,YAAY;YAInB,IAAM,UAAU,GAAG,QAAS,GAAG,OAAO,CAAC;YACvC,IAAM,GAAG,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC;YAC5B,IAAI,GAAG,GAAG,UAAU,EAAE;gBAEpB,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,UAAU,GAAG,GAAG,CAAC,CAAC;gBACxD,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBAC3B,OAAO;aACR;YAED,IAAI,EAAE,CAAC;QACT,CAAC;QAED,MAAM,CAAC,SAAS,CACd,wBAAwB,CACtB,UAAU,EACV,UAAC,KAAQ;YACP,SAAS,GAAG,KAAK,CAAC;YAClB,QAAQ,GAAG,SAAS,CAAC,GAAG,EAAE,CAAC;YAG3B,IAAI,CAAC,UAAU,EAAE;gBACf,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;gBACvD,UAAU,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;aAC5B;QACH,CAAC,EACD;YAGE,IAAI,EAAE,CAAC;YACP,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC,EAED,SAAS,EACT;YAEE,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC;QAChC,CAAC,CACF,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1 @@
{"name":"@octokit/plugin-request-log","version":"1.0.4","files":{"LICENSE":{"checkedAt":1678883670543,"integrity":"sha512-sDmIOn3LdlpAphiNYHw2q5a1Qey5JGQGK0v8i3Sr8QLwACSZH8c3dKptDF3AvfNo2hxQ8E2yMYx6n0YE0M+eDw==","mode":420,"size":1107},"dist-src/index.js":{"checkedAt":1678883670543,"integrity":"sha512-NWtuaOVDdVto8GigX4ksDfvUR/TZqEM0Lct+n2H1s54rqr2gsNkL5QRFnRtVTfa3KatvjRnQJcf21t6FiI0H+A==","mode":420,"size":894},"dist-node/index.js":{"checkedAt":1678883670543,"integrity":"sha512-QKxiKJnX9HKhP119T7b7C+oUCrSjnFdtvdLgtLY4Aklg7BCqS7zyMNy6DMI3jLwOgmXv9a9BrGkFfpPR5FDNyg==","mode":420,"size":938},"dist-web/index.js":{"checkedAt":1678883670543,"integrity":"sha512-UA4xt7S2CQdQpEgNseDI9261fXYw2HZ3lRWhB5wBnzLL6R8CA3/lbzAc0AfZyzCt7PDNYexnzuN6rVFd8M6bIA==","mode":420,"size":934},"package.json":{"checkedAt":1678883670543,"integrity":"sha512-7To9ybA50Q7WfnANPB0eV6o7qy7hcJ8fjQjSOBfRDIB2HnwDVEunZ8grVadsZL6cBpsoKnF+v4bxcpYrG6LD0g==","mode":420,"size":1160},"dist-src/version.js":{"checkedAt":1678883670543,"integrity":"sha512-eIumJDbmFxxdmL+UF9HkygEQC1N8112lkd5O+2umjaete/Ul3TGenXTtV0lCQkpZ8ci58n/uZfBPZfHBAFJagg==","mode":420,"size":32},"dist-node/index.js.map":{"checkedAt":1678883670543,"integrity":"sha512-jumzADTgDUM0jLNXHedsdiOh27iFwOY595v+/k8VyeXj8qA/wex4GNiDbZ7oj2U3sUABTY/G/dO9GnOjCFq9BQ==","mode":420,"size":2273},"dist-web/index.js.map":{"checkedAt":1678883670543,"integrity":"sha512-kme9ptpuMiLakpVDCmrRtdY4LcXdm24lot6+bVxXQ3W2bJqdX0nNaDtZ9doddR94V0pZstOqGgWIZ6vYUfM5fQ==","mode":420,"size":2186},"README.md":{"checkedAt":1678883670545,"integrity":"sha512-IzaU+NKaRNfHv0zqCsr9fr/W4mmMTx4TGJuitw42AD55+pdOnYy9EbO1HVDqw01WNnv0nt9AwkotIJTfvlmTEA==","mode":420,"size":1793},"dist-types/index.d.ts":{"checkedAt":1678883670545,"integrity":"sha512-8/YhKu5X8tBHaHjh8/4fGoFbGHOl0NdKfnxkClh2KIiTBoCEG+vOTjzOWy0LT64AC8ZC8z1PHbGjvFs3WjLIFw==","mode":420,"size":270},"dist-types/version.d.ts":{"checkedAt":1678883670545,"integrity":"sha512-K/kbfsQ75PG1nu+1y7UUeLKKc9od7I93sn8EQJdGSELbsKhvZc3DIWx9y4yB6EAkEps3mLGiWlwEXMqPZPM1vA==","mode":420,"size":40}}}

View File

@@ -0,0 +1,11 @@
/**
* Removes an item from an array, mutating it.
* @param arr The array to remove the item from
* @param item The item to remove
*/
export function arrRemove<T>(arr: T[] | undefined | null, item: T) {
if (arr) {
const index = arr.indexOf(item);
0 <= index && arr.splice(index, 1);
}
}

View File

@@ -0,0 +1,97 @@
var conversions = require('./conversions');
/*
this function routes a model to all other models.
all functions that are routed have a property `.conversion` attached
to the returned synthetic function. This property is an array
of strings, each with the steps in between the 'from' and 'to'
color models (inclusive).
conversions that are not possible simply are not included.
*/
function buildGraph() {
var graph = {};
// https://jsperf.com/object-keys-vs-for-in-with-closure/3
var models = Object.keys(conversions);
for (var len = models.length, i = 0; i < len; i++) {
graph[models[i]] = {
// http://jsperf.com/1-vs-infinity
// micro-opt, but this is simple.
distance: -1,
parent: null
};
}
return graph;
}
// https://en.wikipedia.org/wiki/Breadth-first_search
function deriveBFS(fromModel) {
var graph = buildGraph();
var queue = [fromModel]; // unshift -> queue -> pop
graph[fromModel].distance = 0;
while (queue.length) {
var current = queue.pop();
var adjacents = Object.keys(conversions[current]);
for (var len = adjacents.length, i = 0; i < len; i++) {
var adjacent = adjacents[i];
var node = graph[adjacent];
if (node.distance === -1) {
node.distance = graph[current].distance + 1;
node.parent = current;
queue.unshift(adjacent);
}
}
}
return graph;
}
function link(from, to) {
return function (args) {
return to(from(args));
};
}
function wrapConversion(toModel, graph) {
var path = [graph[toModel].parent, toModel];
var fn = conversions[graph[toModel].parent][toModel];
var cur = graph[toModel].parent;
while (graph[cur].parent) {
path.unshift(graph[cur].parent);
fn = link(conversions[graph[cur].parent][cur], fn);
cur = graph[cur].parent;
}
fn.conversion = path;
return fn;
}
module.exports = function (fromModel) {
var graph = deriveBFS(fromModel);
var conversion = {};
var models = Object.keys(graph);
for (var len = models.length, i = 0; i < len; i++) {
var toModel = models[i];
var node = graph[toModel];
if (node.parent === null) {
// no possible conversion, or this node is the source model.
continue;
}
conversion[toModel] = wrapConversion(toModel, graph);
}
return conversion;
};

View File

@@ -0,0 +1,64 @@
"use strict"
var wcwidth = require('../')
var test = require('tape')
test('handles regular strings', function(t) {
t.strictEqual(wcwidth('abc'), 3)
t.end()
})
test('handles multibyte strings', function(t) {
t.strictEqual(wcwidth('字的模块'), 8)
t.end()
})
test('handles multibyte characters mixed with regular characters', function(t) {
t.strictEqual(wcwidth('abc 字的模块'), 12)
t.end()
})
test('ignores control characters e.g. \\n', function(t) {
t.strictEqual(wcwidth('abc\n字的模块\ndef'), 14)
t.end()
})
test('ignores bad input', function(t) {
t.strictEqual(wcwidth(''), 0)
t.strictEqual(wcwidth(3), 0)
t.strictEqual(wcwidth({}), 0)
t.strictEqual(wcwidth([]), 0)
t.strictEqual(wcwidth(), 0)
t.end()
})
test('ignores nul (charcode 0)', function(t) {
t.strictEqual(wcwidth(String.fromCharCode(0)), 0)
t.end()
})
test('ignores nul mixed with chars', function(t) {
t.strictEqual(wcwidth('a' + String.fromCharCode(0) + '\n字的'), 5)
t.end()
})
test('can have custom value for nul', function(t) {
t.strictEqual(wcwidth.config({
nul: 10
})(String.fromCharCode(0) + 'a字的'), 15)
t.end()
})
test('can have custom control char value', function(t) {
t.strictEqual(wcwidth.config({
control: 1
})('abc\n字的模块\ndef'), 16)
t.end()
})
test('negative custom control chars == -1', function(t) {
t.strictEqual(wcwidth.config({
control: -1
})('abc\n字的模块\ndef'), -1)
t.end()
})

View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//return first eol found from a data chunk.
function default_1(data, param) {
if (!param.eol && data) {
for (var i = 0, len = data.length; i < len; i++) {
if (data[i] === "\r") {
if (data[i + 1] === "\n") {
param.eol = "\r\n";
break;
}
else if (data[i + 1]) {
param.eol = "\r";
break;
}
}
else if (data[i] === "\n") {
param.eol = "\n";
break;
}
}
}
return param.eol || "\n";
}
exports.default = default_1;
;
//# sourceMappingURL=getEol.js.map

View File

@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/es-get-iterator
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with a single custom sponsorship URL

View File

@@ -0,0 +1,45 @@
/**
Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
@category Class
*/
export type Class<T, Arguments extends unknown[] = any[]> = Constructor<T, Arguments> & {prototype: T};
/**
Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes).
@category Class
*/
export type Constructor<T, Arguments extends unknown[] = any[]> = new(...arguments_: Arguments) => T;
/**
Matches a JSON object.
This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`.
@category JSON
*/
export type JsonObject = {[Key in string]?: JsonValue};
/**
Matches a JSON array.
@category JSON
*/
export type JsonArray = JsonValue[];
/**
Matches any valid JSON primitive value.
@category JSON
*/
export type JsonPrimitive = string | number | boolean | null;
/**
Matches any valid JSON value.
@see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`.
@category JSON
*/
export type JsonValue = JsonPrimitive | JsonObject | JsonArray;

View File

@@ -0,0 +1,362 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.msFromTime = exports.OrdinaryHasInstance = exports.SecFromTime = exports.MinFromTime = exports.HourFromTime = exports.DateFromTime = exports.MonthFromTime = exports.InLeapYear = exports.DayWithinYear = exports.DaysInYear = exports.YearFromTime = exports.TimeFromYear = exports.DayFromYear = exports.WeekDay = exports.Day = exports.Type = exports.HasOwnProperty = exports.ArrayCreate = exports.SameValue = exports.ToObject = exports.TimeClip = exports.ToNumber = exports.ToString = void 0;
/**
* https://tc39.es/ecma262/#sec-tostring
*/
function ToString(o) {
// Only symbol is irregular...
if (typeof o === 'symbol') {
throw TypeError('Cannot convert a Symbol value to a string');
}
return String(o);
}
exports.ToString = ToString;
/**
* https://tc39.es/ecma262/#sec-tonumber
* @param val
*/
function ToNumber(val) {
if (val === undefined) {
return NaN;
}
if (val === null) {
return +0;
}
if (typeof val === 'boolean') {
return val ? 1 : +0;
}
if (typeof val === 'number') {
return val;
}
if (typeof val === 'symbol' || typeof val === 'bigint') {
throw new TypeError('Cannot convert symbol/bigint to number');
}
return Number(val);
}
exports.ToNumber = ToNumber;
/**
* https://tc39.es/ecma262/#sec-tointeger
* @param n
*/
function ToInteger(n) {
var number = ToNumber(n);
if (isNaN(number) || SameValue(number, -0)) {
return 0;
}
if (isFinite(number)) {
return number;
}
var integer = Math.floor(Math.abs(number));
if (number < 0) {
integer = -integer;
}
if (SameValue(integer, -0)) {
return 0;
}
return integer;
}
/**
* https://tc39.es/ecma262/#sec-timeclip
* @param time
*/
function TimeClip(time) {
if (!isFinite(time)) {
return NaN;
}
if (Math.abs(time) > 8.64 * 1e15) {
return NaN;
}
return ToInteger(time);
}
exports.TimeClip = TimeClip;
/**
* https://tc39.es/ecma262/#sec-toobject
* @param arg
*/
function ToObject(arg) {
if (arg == null) {
throw new TypeError('undefined/null cannot be converted to object');
}
return Object(arg);
}
exports.ToObject = ToObject;
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-samevalue
* @param x
* @param y
*/
function SameValue(x, y) {
if (Object.is) {
return Object.is(x, y);
}
// SameValue algorithm
if (x === y) {
// Steps 1-5, 7-10
// Steps 6.b-6.e: +0 != -0
return x !== 0 || 1 / x === 1 / y;
}
// Step 6.a: NaN == NaN
return x !== x && y !== y;
}
exports.SameValue = SameValue;
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-arraycreate
* @param len
*/
function ArrayCreate(len) {
return new Array(len);
}
exports.ArrayCreate = ArrayCreate;
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-hasownproperty
* @param o
* @param prop
*/
function HasOwnProperty(o, prop) {
return Object.prototype.hasOwnProperty.call(o, prop);
}
exports.HasOwnProperty = HasOwnProperty;
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-type
* @param x
*/
function Type(x) {
if (x === null) {
return 'Null';
}
if (typeof x === 'undefined') {
return 'Undefined';
}
if (typeof x === 'function' || typeof x === 'object') {
return 'Object';
}
if (typeof x === 'number') {
return 'Number';
}
if (typeof x === 'boolean') {
return 'Boolean';
}
if (typeof x === 'string') {
return 'String';
}
if (typeof x === 'symbol') {
return 'Symbol';
}
if (typeof x === 'bigint') {
return 'BigInt';
}
}
exports.Type = Type;
var MS_PER_DAY = 86400000;
/**
* https://www.ecma-international.org/ecma-262/11.0/index.html#eqn-modulo
* @param x
* @param y
* @return k of the same sign as y
*/
function mod(x, y) {
return x - Math.floor(x / y) * y;
}
/**
* https://tc39.es/ecma262/#eqn-Day
* @param t
*/
function Day(t) {
return Math.floor(t / MS_PER_DAY);
}
exports.Day = Day;
/**
* https://tc39.es/ecma262/#sec-week-day
* @param t
*/
function WeekDay(t) {
return mod(Day(t) + 4, 7);
}
exports.WeekDay = WeekDay;
/**
* https://tc39.es/ecma262/#sec-year-number
* @param y
*/
function DayFromYear(y) {
return Date.UTC(y, 0) / MS_PER_DAY;
}
exports.DayFromYear = DayFromYear;
/**
* https://tc39.es/ecma262/#sec-year-number
* @param y
*/
function TimeFromYear(y) {
return Date.UTC(y, 0);
}
exports.TimeFromYear = TimeFromYear;
/**
* https://tc39.es/ecma262/#sec-year-number
* @param t
*/
function YearFromTime(t) {
return new Date(t).getUTCFullYear();
}
exports.YearFromTime = YearFromTime;
function DaysInYear(y) {
if (y % 4 !== 0) {
return 365;
}
if (y % 100 !== 0) {
return 366;
}
if (y % 400 !== 0) {
return 365;
}
return 366;
}
exports.DaysInYear = DaysInYear;
function DayWithinYear(t) {
return Day(t) - DayFromYear(YearFromTime(t));
}
exports.DayWithinYear = DayWithinYear;
function InLeapYear(t) {
return DaysInYear(YearFromTime(t)) === 365 ? 0 : 1;
}
exports.InLeapYear = InLeapYear;
/**
* https://tc39.es/ecma262/#sec-month-number
* @param t
*/
function MonthFromTime(t) {
var dwy = DayWithinYear(t);
var leap = InLeapYear(t);
if (dwy >= 0 && dwy < 31) {
return 0;
}
if (dwy < 59 + leap) {
return 1;
}
if (dwy < 90 + leap) {
return 2;
}
if (dwy < 120 + leap) {
return 3;
}
if (dwy < 151 + leap) {
return 4;
}
if (dwy < 181 + leap) {
return 5;
}
if (dwy < 212 + leap) {
return 6;
}
if (dwy < 243 + leap) {
return 7;
}
if (dwy < 273 + leap) {
return 8;
}
if (dwy < 304 + leap) {
return 9;
}
if (dwy < 334 + leap) {
return 10;
}
if (dwy < 365 + leap) {
return 11;
}
throw new Error('Invalid time');
}
exports.MonthFromTime = MonthFromTime;
function DateFromTime(t) {
var dwy = DayWithinYear(t);
var mft = MonthFromTime(t);
var leap = InLeapYear(t);
if (mft === 0) {
return dwy + 1;
}
if (mft === 1) {
return dwy - 30;
}
if (mft === 2) {
return dwy - 58 - leap;
}
if (mft === 3) {
return dwy - 89 - leap;
}
if (mft === 4) {
return dwy - 119 - leap;
}
if (mft === 5) {
return dwy - 150 - leap;
}
if (mft === 6) {
return dwy - 180 - leap;
}
if (mft === 7) {
return dwy - 211 - leap;
}
if (mft === 8) {
return dwy - 242 - leap;
}
if (mft === 9) {
return dwy - 272 - leap;
}
if (mft === 10) {
return dwy - 303 - leap;
}
if (mft === 11) {
return dwy - 333 - leap;
}
throw new Error('Invalid time');
}
exports.DateFromTime = DateFromTime;
var HOURS_PER_DAY = 24;
var MINUTES_PER_HOUR = 60;
var SECONDS_PER_MINUTE = 60;
var MS_PER_SECOND = 1e3;
var MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;
var MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;
function HourFromTime(t) {
return mod(Math.floor(t / MS_PER_HOUR), HOURS_PER_DAY);
}
exports.HourFromTime = HourFromTime;
function MinFromTime(t) {
return mod(Math.floor(t / MS_PER_MINUTE), MINUTES_PER_HOUR);
}
exports.MinFromTime = MinFromTime;
function SecFromTime(t) {
return mod(Math.floor(t / MS_PER_SECOND), SECONDS_PER_MINUTE);
}
exports.SecFromTime = SecFromTime;
function IsCallable(fn) {
return typeof fn === 'function';
}
/**
* The abstract operation OrdinaryHasInstance implements
* the default algorithm for determining if an object O
* inherits from the instance object inheritance path
* provided by constructor C.
* @param C class
* @param O object
* @param internalSlots internalSlots
*/
function OrdinaryHasInstance(C, O, internalSlots) {
if (!IsCallable(C)) {
return false;
}
if (internalSlots === null || internalSlots === void 0 ? void 0 : internalSlots.boundTargetFunction) {
var BC = internalSlots === null || internalSlots === void 0 ? void 0 : internalSlots.boundTargetFunction;
return O instanceof BC;
}
if (typeof O !== 'object') {
return false;
}
var P = C.prototype;
if (typeof P !== 'object') {
throw new TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.');
}
return Object.prototype.isPrototypeOf.call(P, O);
}
exports.OrdinaryHasInstance = OrdinaryHasInstance;
function msFromTime(t) {
return mod(t, MS_PER_SECOND);
}
exports.msFromTime = msFromTime;

View File

@@ -0,0 +1,43 @@
{
"name": "ansi-align",
"version": "3.0.1",
"description": "align-text with ANSI support for CLIs",
"main": "index.js",
"scripts": {
"pretest": "standard",
"test": "nyc ava",
"coverage": "nyc report --reporter=text-lcov | coveralls",
"release": "standard-version"
},
"files": [
"index.js"
],
"repository": {
"type": "git",
"url": "git+https://github.com/nexdrew/ansi-align.git"
},
"keywords": [
"ansi",
"align",
"cli",
"center",
"pad"
],
"author": "nexdrew",
"license": "ISC",
"bugs": {
"url": "https://github.com/nexdrew/ansi-align/issues"
},
"homepage": "https://github.com/nexdrew/ansi-align#readme",
"dependencies": {
"string-width": "^4.1.0"
},
"devDependencies": {
"ava": "^2.0.0",
"chalk": "^2.4.2",
"coveralls": "^3.0.3",
"nyc": "^14.0.0",
"standard": "^14.0.0",
"standard-version": "^7.0.0"
}
}

View File

@@ -0,0 +1,38 @@
var baseToNumber = require('./_baseToNumber'),
baseToString = require('./_baseToString');
/**
* Creates a function that performs a mathematical operation on two values.
*
* @private
* @param {Function} operator The function to perform the operation.
* @param {number} [defaultValue] The value used for `undefined` arguments.
* @returns {Function} Returns the new mathematical operation function.
*/
function createMathOperation(operator, defaultValue) {
return function(value, other) {
var result;
if (value === undefined && other === undefined) {
return defaultValue;
}
if (value !== undefined) {
result = value;
}
if (other !== undefined) {
if (result === undefined) {
return other;
}
if (typeof value == 'string' || typeof other == 'string') {
value = baseToString(value);
other = baseToString(other);
} else {
value = baseToNumber(value);
other = baseToNumber(other);
}
result = operator(value, other);
}
return result;
};
}
module.exports = createMathOperation;

View File

@@ -0,0 +1,6 @@
import * as nodeCrypto from 'crypto';
export const crypto = {
node: nodeCrypto,
web: undefined,
};
//# sourceMappingURL=crypto.js.map

View File

@@ -0,0 +1,441 @@
/* formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
/* global FormData self Blob File */
/* eslint-disable no-inner-declarations */
if (typeof Blob !== 'undefined' && (typeof FormData === 'undefined' || !FormData.prototype.keys)) {
const global = typeof globalThis === 'object'
? globalThis
: typeof window === 'object'
? window
: typeof self === 'object' ? self : this
// keep a reference to native implementation
const _FormData = global.FormData
// To be monkey patched
const _send = global.XMLHttpRequest && global.XMLHttpRequest.prototype.send
const _fetch = global.Request && global.fetch
const _sendBeacon = global.navigator && global.navigator.sendBeacon
// Might be a worker thread...
const _match = global.Element && global.Element.prototype
// Unable to patch Request/Response constructor correctly #109
// only way is to use ES6 class extend
// https://github.com/babel/babel/issues/1966
const stringTag = global.Symbol && Symbol.toStringTag
// Add missing stringTags to blob and files
if (stringTag) {
if (!Blob.prototype[stringTag]) {
Blob.prototype[stringTag] = 'Blob'
}
if ('File' in global && !File.prototype[stringTag]) {
File.prototype[stringTag] = 'File'
}
}
// Fix so you can construct your own File
try {
new File([], '') // eslint-disable-line
} catch (a) {
global.File = function File (b, d, c) {
const blob = new Blob(b, c || {})
const t = c && void 0 !== c.lastModified ? new Date(c.lastModified) : new Date()
Object.defineProperties(blob, {
name: {
value: d
},
lastModified: {
value: +t
},
toString: {
value () {
return '[object File]'
}
}
})
if (stringTag) {
Object.defineProperty(blob, stringTag, {
value: 'File'
})
}
return blob
}
}
function ensureArgs (args, expected) {
if (args.length < expected) {
throw new TypeError(`${expected} argument required, but only ${args.length} present.`)
}
}
/**
* @param {string} name
* @param {string | undefined} filename
* @returns {[string, File|string]}
*/
function normalizeArgs (name, value, filename) {
if (value instanceof Blob) {
filename = filename !== undefined
? String(filename + '')
: typeof value.name === 'string'
? value.name
: 'blob'
if (value.name !== filename || Object.prototype.toString.call(value) === '[object Blob]') {
value = new File([value], filename)
}
return [String(name), value]
}
return [String(name), String(value)]
}
// normalize line feeds for textarea
// https://html.spec.whatwg.org/multipage/form-elements.html#textarea-line-break-normalisation-transformation
function normalizeLinefeeds (value) {
return value.replace(/\r?\n|\r/g, '\r\n')
}
/**
* @template T
* @param {ArrayLike<T>} arr
* @param {{ (elm: T): void; }} cb
*/
function each (arr, cb) {
for (let i = 0; i < arr.length; i++) {
cb(arr[i])
}
}
const escape = str => str.replace(/\n/g, '%0A').replace(/\r/g, '%0D').replace(/"/g, '%22')
/**
* @implements {Iterable}
*/
class FormDataPolyfill {
/**
* FormData class
*
* @param {HTMLFormElement=} form
*/
constructor (form) {
/** @type {[string, string|File][]} */
this._data = []
const self = this
form && each(form.elements, (/** @type {HTMLInputElement} */ elm) => {
if (
!elm.name ||
elm.disabled ||
elm.type === 'submit' ||
elm.type === 'button' ||
elm.matches('form fieldset[disabled] *')
) return
if (elm.type === 'file') {
const files = elm.files && elm.files.length
? elm.files
: [new File([], '', { type: 'application/octet-stream' })] // #78
each(files, file => {
self.append(elm.name, file)
})
} else if (elm.type === 'select-multiple' || elm.type === 'select-one') {
each(elm.options, opt => {
!opt.disabled && opt.selected && self.append(elm.name, opt.value)
})
} else if (elm.type === 'checkbox' || elm.type === 'radio') {
if (elm.checked) self.append(elm.name, elm.value)
} else {
const value = elm.type === 'textarea' ? normalizeLinefeeds(elm.value) : elm.value
self.append(elm.name, value)
}
})
}
/**
* Append a field
*
* @param {string} name field name
* @param {string|Blob|File} value string / blob / file
* @param {string=} filename filename to use with blob
* @return {undefined}
*/
append (name, value, filename) {
ensureArgs(arguments, 2)
this._data.push(normalizeArgs(name, value, filename))
}
/**
* Delete all fields values given name
*
* @param {string} name Field name
* @return {undefined}
*/
delete (name) {
ensureArgs(arguments, 1)
const result = []
name = String(name)
each(this._data, entry => {
entry[0] !== name && result.push(entry)
})
this._data = result
}
/**
* Iterate over all fields as [name, value]
*
* @return {Iterator}
*/
* entries () {
for (var i = 0; i < this._data.length; i++) {
yield this._data[i]
}
}
/**
* Iterate over all fields
*
* @param {Function} callback Executed for each item with parameters (value, name, thisArg)
* @param {Object=} thisArg `this` context for callback function
*/
forEach (callback, thisArg) {
ensureArgs(arguments, 1)
for (const [name, value] of this) {
callback.call(thisArg, value, name, this)
}
}
/**
* Return first field value given name
* or null if non existent
*
* @param {string} name Field name
* @return {string|File|null} value Fields value
*/
get (name) {
ensureArgs(arguments, 1)
const entries = this._data
name = String(name)
for (let i = 0; i < entries.length; i++) {
if (entries[i][0] === name) {
return entries[i][1]
}
}
return null
}
/**
* Return all fields values given name
*
* @param {string} name Fields name
* @return {Array} [{String|File}]
*/
getAll (name) {
ensureArgs(arguments, 1)
const result = []
name = String(name)
each(this._data, data => {
data[0] === name && result.push(data[1])
})
return result
}
/**
* Check for field name existence
*
* @param {string} name Field name
* @return {boolean}
*/
has (name) {
ensureArgs(arguments, 1)
name = String(name)
for (let i = 0; i < this._data.length; i++) {
if (this._data[i][0] === name) {
return true
}
}
return false
}
/**
* Iterate over all fields name
*
* @return {Iterator}
*/
* keys () {
for (const [name] of this) {
yield name
}
}
/**
* Overwrite all values given name
*
* @param {string} name Filed name
* @param {string} value Field value
* @param {string=} filename Filename (optional)
*/
set (name, value, filename) {
ensureArgs(arguments, 2)
name = String(name)
/** @type {[string, string|File][]} */
const result = []
const args = normalizeArgs(name, value, filename)
let replace = true
// - replace the first occurrence with same name
// - discards the remaining with same name
// - while keeping the same order items where added
each(this._data, data => {
data[0] === name
? replace && (replace = !result.push(args))
: result.push(data)
})
replace && result.push(args)
this._data = result
}
/**
* Iterate over all fields
*
* @return {Iterator}
*/
* values () {
for (const [, value] of this) {
yield value
}
}
/**
* Return a native (perhaps degraded) FormData with only a `append` method
* Can throw if it's not supported
*
* @return {FormData}
*/
['_asNative'] () {
const fd = new _FormData()
for (const [name, value] of this) {
fd.append(name, value)
}
return fd
}
/**
* [_blob description]
*
* @return {Blob} [description]
*/
['_blob'] () {
const boundary = '----formdata-polyfill-' + Math.random(),
chunks = [],
p = `--${boundary}\r\nContent-Disposition: form-data; name="`
this.forEach((value, name) => typeof value == 'string'
? chunks.push(p + escape(normalizeLinefeeds(name)) + `"\r\n\r\n${normalizeLinefeeds(value)}\r\n`)
: chunks.push(p + escape(normalizeLinefeeds(name)) + `"; filename="${escape(value.name)}"\r\nContent-Type: ${value.type||"application/octet-stream"}\r\n\r\n`, value, `\r\n`))
chunks.push(`--${boundary}--`)
return new Blob(chunks, {
type: "multipart/form-data; boundary=" + boundary
})
}
/**
* The class itself is iterable
* alias for formdata.entries()
*
* @return {Iterator}
*/
[Symbol.iterator] () {
return this.entries()
}
/**
* Create the default string description.
*
* @return {string} [object FormData]
*/
toString () {
return '[object FormData]'
}
}
if (_match && !_match.matches) {
_match.matches =
_match.matchesSelector ||
_match.mozMatchesSelector ||
_match.msMatchesSelector ||
_match.oMatchesSelector ||
_match.webkitMatchesSelector ||
function (s) {
var matches = (this.document || this.ownerDocument).querySelectorAll(s)
var i = matches.length
while (--i >= 0 && matches.item(i) !== this) {}
return i > -1
}
}
if (stringTag) {
/**
* Create the default string description.
* It is accessed internally by the Object.prototype.toString().
*/
FormDataPolyfill.prototype[stringTag] = 'FormData'
}
// Patch xhr's send method to call _blob transparently
if (_send) {
const setRequestHeader = global.XMLHttpRequest.prototype.setRequestHeader
global.XMLHttpRequest.prototype.setRequestHeader = function (name, value) {
setRequestHeader.call(this, name, value)
if (name.toLowerCase() === 'content-type') this._hasContentType = true
}
global.XMLHttpRequest.prototype.send = function (data) {
// need to patch send b/c old IE don't send blob's type (#44)
if (data instanceof FormDataPolyfill) {
const blob = data['_blob']()
if (!this._hasContentType) this.setRequestHeader('Content-Type', blob.type)
_send.call(this, blob)
} else {
_send.call(this, data)
}
}
}
// Patch fetch's function to call _blob transparently
if (_fetch) {
global.fetch = function (input, init) {
if (init && init.body && init.body instanceof FormDataPolyfill) {
init.body = init.body['_blob']()
}
return _fetch.call(this, input, init)
}
}
// Patch navigator.sendBeacon to use native FormData
if (_sendBeacon) {
global.navigator.sendBeacon = function (url, data) {
if (data instanceof FormDataPolyfill) {
data = data['_asNative']()
}
return _sendBeacon.call(this, url, data)
}
}
global['FormData'] = FormDataPolyfill
}

View File

@@ -0,0 +1,62 @@
import type {ArrayEntry, MapEntry, ObjectEntry, SetEntry} from './entry';
type ArrayEntries<BaseType extends readonly unknown[]> = Array<ArrayEntry<BaseType>>;
type MapEntries<BaseType> = Array<MapEntry<BaseType>>;
type ObjectEntries<BaseType> = Array<ObjectEntry<BaseType>>;
type SetEntries<BaseType extends Set<unknown>> = Array<SetEntry<BaseType>>;
/**
Many collections have an `entries` method which returns an array of a given object's own enumerable string-keyed property [key, value] pairs. The `Entries` type will return the type of that collection's entries.
For example the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/entries|`Object`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/entries|`Map`}, {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/entries|`Array`}, and {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/entries|`Set`} collections all have this method. Note that `WeakMap` and `WeakSet` do not have this method since their entries are not enumerable.
@see `Entry` if you want to just access the type of a single entry.
@example
```
import type {Entries} from 'type-fest';
interface Example {
someKey: number;
}
const manipulatesEntries = (examples: Entries<Example>) => examples.map(example => [
// Does some arbitrary processing on the key (with type information available)
example[0].toUpperCase(),
// Does some arbitrary processing on the value (with type information available)
example[1].toFixed()
]);
const example: Example = {someKey: 1};
const entries = Object.entries(example) as Entries<Example>;
const output = manipulatesEntries(entries);
// Objects
const objectExample = {a: 1};
const objectEntries: Entries<typeof objectExample> = [['a', 1]];
// Arrays
const arrayExample = ['a', 1];
const arrayEntries: Entries<typeof arrayExample> = [[0, 'a'], [1, 1]];
// Maps
const mapExample = new Map([['a', 1]]);
const mapEntries: Entries<typeof map> = [['a', 1]];
// Sets
const setExample = new Set(['a', 1]);
const setEntries: Entries<typeof setExample> = [['a', 'a'], [1, 1]];
```
@category Object
@category Map
@category Set
@category Array
*/
export type Entries<BaseType> =
BaseType extends Map<unknown, unknown> ? MapEntries<BaseType>
: BaseType extends Set<unknown> ? SetEntries<BaseType>
: BaseType extends readonly unknown[] ? ArrayEntries<BaseType>
: BaseType extends object ? ObjectEntries<BaseType>
: never;

View File

@@ -0,0 +1,58 @@
import os from 'node:os';
import execa from 'execa';
// Reference: https://www.gaijin.at/en/lstwinver.php
// Windows 11 reference: https://docs.microsoft.com/en-us/windows/release-health/windows11-release-information
const names = new Map([
['10.0.22', '11'], // It's unclear whether future Windows 11 versions will use this version scheme: https://github.com/sindresorhus/windows-release/pull/26/files#r744945281
['10.0', '10'],
['6.3', '8.1'],
['6.2', '8'],
['6.1', '7'],
['6.0', 'Vista'],
['5.2', 'Server 2003'],
['5.1', 'XP'],
['5.0', '2000'],
['4.90', 'ME'],
['4.10', '98'],
['4.03', '95'],
['4.00', '95'],
]);
export default function windowsRelease(release) {
const version = /(\d+\.\d+)(?:\.(\d+))?/.exec(release || os.release());
if (release && !version) {
throw new Error('`release` argument doesn\'t match `n.n`');
}
let ver = version[1] || '';
const build = version[2] || '';
// Server 2008, 2012, 2016, and 2019 versions are ambiguous with desktop versions and must be detected at runtime.
// If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
// then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
// If `wmic` is obsolete (later versions of Windows 10), use PowerShell instead.
// If the resulting caption contains the year 2008, 2012, 2016, 2019 or 2022, it is a server version, so return a server OS name.
if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
let stdout;
try {
stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
} catch {
stdout = execa.sync('powershell', ['(Get-CimInstance -ClassName Win32_OperatingSystem).caption']).stdout || '';
}
const year = (stdout.match(/2008|2012|2016|2019|2022/) || [])[0];
if (year) {
return `Server ${year}`;
}
}
// Windows 11
if (ver === '10.0' && build.startsWith('22')) {
ver = '10.0.22';
}
return names.get(ver);
}

View File

@@ -0,0 +1,34 @@
import { Observable } from '../Observable';
import { Subscription } from '../Subscription';
import { SubscriptionLoggable } from './SubscriptionLoggable';
import { applyMixins } from '../util/applyMixins';
import { observeNotification } from '../Notification';
export class ColdObservable extends Observable {
constructor(messages, scheduler) {
super(function (subscriber) {
const observable = this;
const index = observable.logSubscribedFrame();
const subscription = new Subscription();
subscription.add(new Subscription(() => {
observable.logUnsubscribedFrame(index);
}));
observable.scheduleMessages(subscriber);
return subscription;
});
this.messages = messages;
this.subscriptions = [];
this.scheduler = scheduler;
}
scheduleMessages(subscriber) {
const messagesLength = this.messages.length;
for (let i = 0; i < messagesLength; i++) {
const message = this.messages[i];
subscriber.add(this.scheduler.schedule((state) => {
const { message: { notification }, subscriber: destination } = state;
observeNotification(notification, destination);
}, message.frame, { message, subscriber }));
}
}
}
applyMixins(ColdObservable, [SubscriptionLoggable]);
//# sourceMappingURL=ColdObservable.js.map

View File

@@ -0,0 +1,171 @@
import { IS_NON_DIMENSIONAL } from '../constants';
import options from '../options';
/**
* Diff the old and new properties of a VNode and apply changes to the DOM node
* @param {import('../internal').PreactElement} dom The DOM node to apply
* changes to
* @param {object} newProps The new props
* @param {object} oldProps The old props
* @param {boolean} isSvg Whether or not this node is an SVG node
* @param {boolean} hydrate Whether or not we are in hydration mode
*/
export function diffProps(dom, newProps, oldProps, isSvg, hydrate) {
let i;
for (i in oldProps) {
if (i !== 'children' && i !== 'key' && !(i in newProps)) {
setProperty(dom, i, null, oldProps[i], isSvg);
}
}
for (i in newProps) {
if (
(!hydrate || typeof newProps[i] == 'function') &&
i !== 'children' &&
i !== 'key' &&
i !== 'value' &&
i !== 'checked' &&
oldProps[i] !== newProps[i]
) {
setProperty(dom, i, newProps[i], oldProps[i], isSvg);
}
}
}
function setStyle(style, key, value) {
if (key[0] === '-') {
style.setProperty(key, value == null ? '' : value);
} else if (value == null) {
style[key] = '';
} else if (typeof value != 'number' || IS_NON_DIMENSIONAL.test(key)) {
style[key] = value;
} else {
style[key] = value + 'px';
}
}
/**
* Set a property value on a DOM node
* @param {import('../internal').PreactElement} dom The DOM node to modify
* @param {string} name The name of the property to set
* @param {*} value The value to set the property to
* @param {*} oldValue The old value the property had
* @param {boolean} isSvg Whether or not this DOM node is an SVG node or not
*/
export function setProperty(dom, name, value, oldValue, isSvg) {
let useCapture;
o: if (name === 'style') {
if (typeof value == 'string') {
dom.style.cssText = value;
} else {
if (typeof oldValue == 'string') {
dom.style.cssText = oldValue = '';
}
if (oldValue) {
for (name in oldValue) {
if (!(value && name in value)) {
setStyle(dom.style, name, '');
}
}
}
if (value) {
for (name in value) {
if (!oldValue || value[name] !== oldValue[name]) {
setStyle(dom.style, name, value[name]);
}
}
}
}
}
// Benchmark for comparison: https://esbench.com/bench/574c954bdb965b9a00965ac6
else if (name[0] === 'o' && name[1] === 'n') {
useCapture = name !== (name = name.replace(/Capture$/, ''));
// Infer correct casing for DOM built-in events:
if (name.toLowerCase() in dom) name = name.toLowerCase().slice(2);
else name = name.slice(2);
if (!dom._listeners) dom._listeners = {};
dom._listeners[name + useCapture] = value;
if (value) {
if (!oldValue) {
const handler = useCapture ? eventProxyCapture : eventProxy;
dom.addEventListener(name, handler, useCapture);
}
} else {
const handler = useCapture ? eventProxyCapture : eventProxy;
dom.removeEventListener(name, handler, useCapture);
}
} else if (name !== 'dangerouslySetInnerHTML') {
if (isSvg) {
// Normalize incorrect prop usage for SVG:
// - xlink:href / xlinkHref --> href (xlink:href was removed from SVG and isn't needed)
// - className --> class
name = name.replace(/xlink(H|:h)/, 'h').replace(/sName$/, 's');
} else if (
name !== 'width' &&
name !== 'height' &&
name !== 'href' &&
name !== 'list' &&
name !== 'form' &&
// Default value in browsers is `-1` and an empty string is
// cast to `0` instead
name !== 'tabIndex' &&
name !== 'download' &&
name in dom
) {
try {
dom[name] = value == null ? '' : value;
// labelled break is 1b smaller here than a return statement (sorry)
break o;
} catch (e) {}
}
// ARIA-attributes have a different notion of boolean values.
// The value `false` is different from the attribute not
// existing on the DOM, so we can't remove it. For non-boolean
// ARIA-attributes we could treat false as a removal, but the
// amount of exceptions would cost us too many bytes. On top of
// that other VDOM frameworks also always stringify `false`.
if (typeof value === 'function') {
// never serialize functions as attribute values
} else if (value != null && (value !== false || name.indexOf('-') != -1)) {
dom.setAttribute(name, value);
} else {
dom.removeAttribute(name);
}
}
}
export let inEvent = false;
/**
* Proxy an event to hooked event handlers
* @param {Event} e The event object from the browser
* @private
*/
function eventProxy(e) {
inEvent = true;
try {
return this._listeners[e.type + false](
options.event ? options.event(e) : e
);
} finally {
inEvent = false;
}
}
function eventProxyCapture(e) {
inEvent = true;
try {
return this._listeners[e.type + true](options.event ? options.event(e) : e);
} finally {
inEvent = false;
}
}

View File

@@ -0,0 +1,61 @@
{
"name": "human-signals",
"version": "4.3.0",
"type": "module",
"exports": {
"types": "./build/types/main.d.ts",
"default": "./build/src/main.js"
},
"main": "./build/src/main.js",
"types": "./build/types/main.d.ts",
"files": [
"build/src/**/*.{js,json}",
"build/types/**/*.d.ts"
],
"sideEffects": false,
"scripts": {
"test": "gulp test"
},
"description": "Human-friendly process signals",
"keywords": [
"signal",
"signals",
"handlers",
"error-handling",
"interrupts",
"sigterm",
"sigint",
"irq",
"process",
"exit",
"exit-code",
"status",
"operating-system",
"es6",
"javascript",
"typescript",
"linux",
"macos",
"windows",
"nodejs"
],
"license": "Apache-2.0",
"homepage": "https://www.github.com/ehmicky/human-signals",
"repository": "ehmicky/human-signals",
"bugs": {
"url": "https://github.com/ehmicky/human-signals/issues"
},
"author": "ehmicky <ehmicky@gmail.com> (https://github.com/ehmicky)",
"directories": {
"lib": "src",
"test": "test"
},
"devDependencies": {
"@ehmicky/dev-tasks": "^1.0.102",
"ajv": "^8.11.0",
"test-each": "^5.5.0"
},
"engines": {
"node": ">=14.18.0"
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"VirtualTimeScheduler.d.ts","sourceRoot":"","sources":["../../../../src/internal/scheduler/VirtualTimeScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,qBAAa,oBAAqB,SAAQ,cAAc;IAyB6B,SAAS,EAAE,MAAM;IAxBpG,oFAAoF;IACpF,MAAM,CAAC,eAAe,SAAM;IAE5B;;;;;OAKG;IACI,KAAK,EAAE,MAAM,CAAK;IAEzB;;;OAGG;IACI,KAAK,EAAE,MAAM,CAAM;IAE1B;;;;;;OAMG;gBACS,mBAAmB,GAAE,OAAO,WAAkC,EAAS,SAAS,GAAE,MAAiB;IAI/G;;;;OAIG;IACI,KAAK,IAAI,IAAI;CAqBrB;AAED,qBAAa,aAAa,CAAC,CAAC,CAAE,SAAQ,WAAW,CAAC,CAAC,CAAC;IAIhD,SAAS,CAAC,SAAS,EAAE,oBAAoB;IACzC,SAAS,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,IAAI;IAC7D,SAAS,CAAC,KAAK,EAAE,MAAM;IALzB,SAAS,CAAC,MAAM,EAAE,OAAO,CAAQ;gBAGrB,SAAS,EAAE,oBAAoB,EAC/B,IAAI,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,IAAI,EACnD,KAAK,GAAE,MAA+B;IAM3C,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,GAAE,MAAU,GAAG,YAAY;IAoB3D,SAAS,CAAC,cAAc,CAAC,SAAS,EAAE,oBAAoB,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,GAAE,MAAU,GAAG,WAAW;IAQnG,SAAS,CAAC,cAAc,CAAC,SAAS,EAAE,oBAAoB,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,GAAE,MAAU,GAAG,WAAW,GAAG,SAAS;IAI/G,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG;IAMhD,OAAO,CAAC,MAAM,CAAC,WAAW;CAe3B"}