new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sources":["../dist-src/index.js"],"sourcesContent":["export function getUserAgent() {\n if (typeof navigator === \"object\" && \"userAgent\" in navigator) {\n return navigator.userAgent;\n }\n if (typeof process === \"object\" && \"version\" in process) {\n return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;\n }\n return \"<environment undetectable>\";\n}\n"],"names":["getUserAgent","navigator","userAgent","process","version","substr","platform","arch"],"mappings":";;;;AAAO,SAASA,YAAT,GAAwB;AAC3B,MAAI,OAAOC,SAAP,KAAqB,QAArB,IAAiC,eAAeA,SAApD,EAA+D;AAC3D,WAAOA,SAAS,CAACC,SAAjB;AACH;;AACD,MAAI,OAAOC,OAAP,KAAmB,QAAnB,IAA+B,aAAaA,OAAhD,EAAyD;AACrD,WAAQ,WAAUA,OAAO,CAACC,OAAR,CAAgBC,MAAhB,CAAuB,CAAvB,CAA0B,KAAIF,OAAO,CAACG,QAAS,KAAIH,OAAO,CAACI,IAAK,GAAlF;AACH;;AACD,SAAO,4BAAP;AACH;;;;"}
|
||||
@@ -0,0 +1,944 @@
|
||||
(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var keys = require('object-keys').shim();
|
||||
delete keys.shim;
|
||||
|
||||
var assign = require('./');
|
||||
|
||||
module.exports = assign.shim();
|
||||
|
||||
delete assign.shim;
|
||||
|
||||
},{"./":3,"object-keys":15}],2:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
// modified from https://github.com/es-shims/es6-shim
|
||||
var objectKeys = require('object-keys');
|
||||
var hasSymbols = require('has-symbols/shams')();
|
||||
var callBound = require('call-bind/callBound');
|
||||
var toObject = Object;
|
||||
var $push = callBound('Array.prototype.push');
|
||||
var $propIsEnumerable = callBound('Object.prototype.propertyIsEnumerable');
|
||||
var originalGetSymbols = hasSymbols ? Object.getOwnPropertySymbols : null;
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
module.exports = function assign(target, source1) {
|
||||
if (target == null) { throw new TypeError('target must be an object'); }
|
||||
var to = toObject(target); // step 1
|
||||
if (arguments.length === 1) {
|
||||
return to; // step 2
|
||||
}
|
||||
for (var s = 1; s < arguments.length; ++s) {
|
||||
var from = toObject(arguments[s]); // step 3.a.i
|
||||
|
||||
// step 3.a.ii:
|
||||
var keys = objectKeys(from);
|
||||
var getSymbols = hasSymbols && (Object.getOwnPropertySymbols || originalGetSymbols);
|
||||
if (getSymbols) {
|
||||
var syms = getSymbols(from);
|
||||
for (var j = 0; j < syms.length; ++j) {
|
||||
var key = syms[j];
|
||||
if ($propIsEnumerable(from, key)) {
|
||||
$push(keys, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// step 3.a.iii:
|
||||
for (var i = 0; i < keys.length; ++i) {
|
||||
var nextKey = keys[i];
|
||||
if ($propIsEnumerable(from, nextKey)) { // step 3.a.iii.2
|
||||
var propValue = from[nextKey]; // step 3.a.iii.2.a
|
||||
to[nextKey] = propValue; // step 3.a.iii.2.b
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return to; // step 4
|
||||
};
|
||||
|
||||
},{"call-bind/callBound":4,"has-symbols/shams":12,"object-keys":15}],3:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var defineProperties = require('define-properties');
|
||||
var callBind = require('call-bind');
|
||||
|
||||
var implementation = require('./implementation');
|
||||
var getPolyfill = require('./polyfill');
|
||||
var shim = require('./shim');
|
||||
|
||||
var polyfill = callBind.apply(getPolyfill());
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
var bound = function assign(target, source1) {
|
||||
return polyfill(Object, arguments);
|
||||
};
|
||||
|
||||
defineProperties(bound, {
|
||||
getPolyfill: getPolyfill,
|
||||
implementation: implementation,
|
||||
shim: shim
|
||||
});
|
||||
|
||||
module.exports = bound;
|
||||
|
||||
},{"./implementation":2,"./polyfill":17,"./shim":18,"call-bind":5,"define-properties":6}],4:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var callBind = require('./');
|
||||
|
||||
var $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));
|
||||
|
||||
module.exports = function callBoundIntrinsic(name, allowMissing) {
|
||||
var intrinsic = GetIntrinsic(name, !!allowMissing);
|
||||
if (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {
|
||||
return callBind(intrinsic);
|
||||
}
|
||||
return intrinsic;
|
||||
};
|
||||
|
||||
},{"./":5,"get-intrinsic":9}],5:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var bind = require('function-bind');
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $apply = GetIntrinsic('%Function.prototype.apply%');
|
||||
var $call = GetIntrinsic('%Function.prototype.call%');
|
||||
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
|
||||
|
||||
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
||||
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
||||
var $max = GetIntrinsic('%Math.max%');
|
||||
|
||||
if ($defineProperty) {
|
||||
try {
|
||||
$defineProperty({}, 'a', { value: 1 });
|
||||
} catch (e) {
|
||||
// IE 8 has a broken defineProperty
|
||||
$defineProperty = null;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = function callBind(originalFunction) {
|
||||
var func = $reflectApply(bind, $call, arguments);
|
||||
if ($gOPD && $defineProperty) {
|
||||
var desc = $gOPD(func, 'length');
|
||||
if (desc.configurable) {
|
||||
// original length, plus the receiver, minus any additional arguments (after the receiver)
|
||||
$defineProperty(
|
||||
func,
|
||||
'length',
|
||||
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
|
||||
);
|
||||
}
|
||||
}
|
||||
return func;
|
||||
};
|
||||
|
||||
var applyBind = function applyBind() {
|
||||
return $reflectApply(bind, $apply, arguments);
|
||||
};
|
||||
|
||||
if ($defineProperty) {
|
||||
$defineProperty(module.exports, 'apply', { value: applyBind });
|
||||
} else {
|
||||
module.exports.apply = applyBind;
|
||||
}
|
||||
|
||||
},{"function-bind":8,"get-intrinsic":9}],6:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var keys = require('object-keys');
|
||||
var hasSymbols = typeof Symbol === 'function' && typeof Symbol('foo') === 'symbol';
|
||||
|
||||
var toStr = Object.prototype.toString;
|
||||
var concat = Array.prototype.concat;
|
||||
var origDefineProperty = Object.defineProperty;
|
||||
|
||||
var isFunction = function (fn) {
|
||||
return typeof fn === 'function' && toStr.call(fn) === '[object Function]';
|
||||
};
|
||||
|
||||
var hasPropertyDescriptors = require('has-property-descriptors')();
|
||||
|
||||
var supportsDescriptors = origDefineProperty && hasPropertyDescriptors;
|
||||
|
||||
var defineProperty = function (object, name, value, predicate) {
|
||||
if (name in object && (!isFunction(predicate) || !predicate())) {
|
||||
return;
|
||||
}
|
||||
if (supportsDescriptors) {
|
||||
origDefineProperty(object, name, {
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: value,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
object[name] = value; // eslint-disable-line no-param-reassign
|
||||
}
|
||||
};
|
||||
|
||||
var defineProperties = function (object, map) {
|
||||
var predicates = arguments.length > 2 ? arguments[2] : {};
|
||||
var props = keys(map);
|
||||
if (hasSymbols) {
|
||||
props = concat.call(props, Object.getOwnPropertySymbols(map));
|
||||
}
|
||||
for (var i = 0; i < props.length; i += 1) {
|
||||
defineProperty(object, props[i], map[props[i]], predicates[props[i]]);
|
||||
}
|
||||
};
|
||||
|
||||
defineProperties.supportsDescriptors = !!supportsDescriptors;
|
||||
|
||||
module.exports = defineProperties;
|
||||
|
||||
},{"has-property-descriptors":10,"object-keys":15}],7:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
/* eslint no-invalid-this: 1 */
|
||||
|
||||
var ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';
|
||||
var slice = Array.prototype.slice;
|
||||
var toStr = Object.prototype.toString;
|
||||
var funcType = '[object Function]';
|
||||
|
||||
module.exports = function bind(that) {
|
||||
var target = this;
|
||||
if (typeof target !== 'function' || toStr.call(target) !== funcType) {
|
||||
throw new TypeError(ERROR_MESSAGE + target);
|
||||
}
|
||||
var args = slice.call(arguments, 1);
|
||||
|
||||
var bound;
|
||||
var binder = function () {
|
||||
if (this instanceof bound) {
|
||||
var result = target.apply(
|
||||
this,
|
||||
args.concat(slice.call(arguments))
|
||||
);
|
||||
if (Object(result) === result) {
|
||||
return result;
|
||||
}
|
||||
return this;
|
||||
} else {
|
||||
return target.apply(
|
||||
that,
|
||||
args.concat(slice.call(arguments))
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
var boundLength = Math.max(0, target.length - args.length);
|
||||
var boundArgs = [];
|
||||
for (var i = 0; i < boundLength; i++) {
|
||||
boundArgs.push('$' + i);
|
||||
}
|
||||
|
||||
bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this,arguments); }')(binder);
|
||||
|
||||
if (target.prototype) {
|
||||
var Empty = function Empty() {};
|
||||
Empty.prototype = target.prototype;
|
||||
bound.prototype = new Empty();
|
||||
Empty.prototype = null;
|
||||
}
|
||||
|
||||
return bound;
|
||||
};
|
||||
|
||||
},{}],8:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var implementation = require('./implementation');
|
||||
|
||||
module.exports = Function.prototype.bind || implementation;
|
||||
|
||||
},{"./implementation":7}],9:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var undefined;
|
||||
|
||||
var $SyntaxError = SyntaxError;
|
||||
var $Function = Function;
|
||||
var $TypeError = TypeError;
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
var getEvalledConstructor = function (expressionSyntax) {
|
||||
try {
|
||||
return $Function('"use strict"; return (' + expressionSyntax + ').constructor;')();
|
||||
} catch (e) {}
|
||||
};
|
||||
|
||||
var $gOPD = Object.getOwnPropertyDescriptor;
|
||||
if ($gOPD) {
|
||||
try {
|
||||
$gOPD({}, '');
|
||||
} catch (e) {
|
||||
$gOPD = null; // this is IE 8, which has a broken gOPD
|
||||
}
|
||||
}
|
||||
|
||||
var throwTypeError = function () {
|
||||
throw new $TypeError();
|
||||
};
|
||||
var ThrowTypeError = $gOPD
|
||||
? (function () {
|
||||
try {
|
||||
// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties
|
||||
arguments.callee; // IE 8 does not throw here
|
||||
return throwTypeError;
|
||||
} catch (calleeThrows) {
|
||||
try {
|
||||
// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')
|
||||
return $gOPD(arguments, 'callee').get;
|
||||
} catch (gOPDthrows) {
|
||||
return throwTypeError;
|
||||
}
|
||||
}
|
||||
}())
|
||||
: throwTypeError;
|
||||
|
||||
var hasSymbols = require('has-symbols')();
|
||||
|
||||
var getProto = Object.getPrototypeOf || function (x) { return x.__proto__; }; // eslint-disable-line no-proto
|
||||
|
||||
var needsEval = {};
|
||||
|
||||
var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array);
|
||||
|
||||
var INTRINSICS = {
|
||||
'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,
|
||||
'%Array%': Array,
|
||||
'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,
|
||||
'%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined,
|
||||
'%AsyncFromSyncIteratorPrototype%': undefined,
|
||||
'%AsyncFunction%': needsEval,
|
||||
'%AsyncGenerator%': needsEval,
|
||||
'%AsyncGeneratorFunction%': needsEval,
|
||||
'%AsyncIteratorPrototype%': needsEval,
|
||||
'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,
|
||||
'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,
|
||||
'%Boolean%': Boolean,
|
||||
'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,
|
||||
'%Date%': Date,
|
||||
'%decodeURI%': decodeURI,
|
||||
'%decodeURIComponent%': decodeURIComponent,
|
||||
'%encodeURI%': encodeURI,
|
||||
'%encodeURIComponent%': encodeURIComponent,
|
||||
'%Error%': Error,
|
||||
'%eval%': eval, // eslint-disable-line no-eval
|
||||
'%EvalError%': EvalError,
|
||||
'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,
|
||||
'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,
|
||||
'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,
|
||||
'%Function%': $Function,
|
||||
'%GeneratorFunction%': needsEval,
|
||||
'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,
|
||||
'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,
|
||||
'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,
|
||||
'%isFinite%': isFinite,
|
||||
'%isNaN%': isNaN,
|
||||
'%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined,
|
||||
'%JSON%': typeof JSON === 'object' ? JSON : undefined,
|
||||
'%Map%': typeof Map === 'undefined' ? undefined : Map,
|
||||
'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()),
|
||||
'%Math%': Math,
|
||||
'%Number%': Number,
|
||||
'%Object%': Object,
|
||||
'%parseFloat%': parseFloat,
|
||||
'%parseInt%': parseInt,
|
||||
'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,
|
||||
'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,
|
||||
'%RangeError%': RangeError,
|
||||
'%ReferenceError%': ReferenceError,
|
||||
'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,
|
||||
'%RegExp%': RegExp,
|
||||
'%Set%': typeof Set === 'undefined' ? undefined : Set,
|
||||
'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()),
|
||||
'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,
|
||||
'%String%': String,
|
||||
'%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined,
|
||||
'%Symbol%': hasSymbols ? Symbol : undefined,
|
||||
'%SyntaxError%': $SyntaxError,
|
||||
'%ThrowTypeError%': ThrowTypeError,
|
||||
'%TypedArray%': TypedArray,
|
||||
'%TypeError%': $TypeError,
|
||||
'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,
|
||||
'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,
|
||||
'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,
|
||||
'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,
|
||||
'%URIError%': URIError,
|
||||
'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,
|
||||
'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,
|
||||
'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet
|
||||
};
|
||||
|
||||
var doEval = function doEval(name) {
|
||||
var value;
|
||||
if (name === '%AsyncFunction%') {
|
||||
value = getEvalledConstructor('async function () {}');
|
||||
} else if (name === '%GeneratorFunction%') {
|
||||
value = getEvalledConstructor('function* () {}');
|
||||
} else if (name === '%AsyncGeneratorFunction%') {
|
||||
value = getEvalledConstructor('async function* () {}');
|
||||
} else if (name === '%AsyncGenerator%') {
|
||||
var fn = doEval('%AsyncGeneratorFunction%');
|
||||
if (fn) {
|
||||
value = fn.prototype;
|
||||
}
|
||||
} else if (name === '%AsyncIteratorPrototype%') {
|
||||
var gen = doEval('%AsyncGenerator%');
|
||||
if (gen) {
|
||||
value = getProto(gen.prototype);
|
||||
}
|
||||
}
|
||||
|
||||
INTRINSICS[name] = value;
|
||||
|
||||
return value;
|
||||
};
|
||||
|
||||
var LEGACY_ALIASES = {
|
||||
'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],
|
||||
'%ArrayPrototype%': ['Array', 'prototype'],
|
||||
'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],
|
||||
'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],
|
||||
'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],
|
||||
'%ArrayProto_values%': ['Array', 'prototype', 'values'],
|
||||
'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],
|
||||
'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],
|
||||
'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],
|
||||
'%BooleanPrototype%': ['Boolean', 'prototype'],
|
||||
'%DataViewPrototype%': ['DataView', 'prototype'],
|
||||
'%DatePrototype%': ['Date', 'prototype'],
|
||||
'%ErrorPrototype%': ['Error', 'prototype'],
|
||||
'%EvalErrorPrototype%': ['EvalError', 'prototype'],
|
||||
'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],
|
||||
'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],
|
||||
'%FunctionPrototype%': ['Function', 'prototype'],
|
||||
'%Generator%': ['GeneratorFunction', 'prototype'],
|
||||
'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],
|
||||
'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],
|
||||
'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],
|
||||
'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],
|
||||
'%JSONParse%': ['JSON', 'parse'],
|
||||
'%JSONStringify%': ['JSON', 'stringify'],
|
||||
'%MapPrototype%': ['Map', 'prototype'],
|
||||
'%NumberPrototype%': ['Number', 'prototype'],
|
||||
'%ObjectPrototype%': ['Object', 'prototype'],
|
||||
'%ObjProto_toString%': ['Object', 'prototype', 'toString'],
|
||||
'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],
|
||||
'%PromisePrototype%': ['Promise', 'prototype'],
|
||||
'%PromiseProto_then%': ['Promise', 'prototype', 'then'],
|
||||
'%Promise_all%': ['Promise', 'all'],
|
||||
'%Promise_reject%': ['Promise', 'reject'],
|
||||
'%Promise_resolve%': ['Promise', 'resolve'],
|
||||
'%RangeErrorPrototype%': ['RangeError', 'prototype'],
|
||||
'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],
|
||||
'%RegExpPrototype%': ['RegExp', 'prototype'],
|
||||
'%SetPrototype%': ['Set', 'prototype'],
|
||||
'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],
|
||||
'%StringPrototype%': ['String', 'prototype'],
|
||||
'%SymbolPrototype%': ['Symbol', 'prototype'],
|
||||
'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],
|
||||
'%TypedArrayPrototype%': ['TypedArray', 'prototype'],
|
||||
'%TypeErrorPrototype%': ['TypeError', 'prototype'],
|
||||
'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],
|
||||
'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],
|
||||
'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],
|
||||
'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],
|
||||
'%URIErrorPrototype%': ['URIError', 'prototype'],
|
||||
'%WeakMapPrototype%': ['WeakMap', 'prototype'],
|
||||
'%WeakSetPrototype%': ['WeakSet', 'prototype']
|
||||
};
|
||||
|
||||
var bind = require('function-bind');
|
||||
var hasOwn = require('has');
|
||||
var $concat = bind.call(Function.call, Array.prototype.concat);
|
||||
var $spliceApply = bind.call(Function.apply, Array.prototype.splice);
|
||||
var $replace = bind.call(Function.call, String.prototype.replace);
|
||||
var $strSlice = bind.call(Function.call, String.prototype.slice);
|
||||
|
||||
/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */
|
||||
var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
|
||||
var reEscapeChar = /\\(\\)?/g; /** Used to match backslashes in property paths. */
|
||||
var stringToPath = function stringToPath(string) {
|
||||
var first = $strSlice(string, 0, 1);
|
||||
var last = $strSlice(string, -1);
|
||||
if (first === '%' && last !== '%') {
|
||||
throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`');
|
||||
} else if (last === '%' && first !== '%') {
|
||||
throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`');
|
||||
}
|
||||
var result = [];
|
||||
$replace(string, rePropName, function (match, number, quote, subString) {
|
||||
result[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;
|
||||
});
|
||||
return result;
|
||||
};
|
||||
/* end adaptation */
|
||||
|
||||
var getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {
|
||||
var intrinsicName = name;
|
||||
var alias;
|
||||
if (hasOwn(LEGACY_ALIASES, intrinsicName)) {
|
||||
alias = LEGACY_ALIASES[intrinsicName];
|
||||
intrinsicName = '%' + alias[0] + '%';
|
||||
}
|
||||
|
||||
if (hasOwn(INTRINSICS, intrinsicName)) {
|
||||
var value = INTRINSICS[intrinsicName];
|
||||
if (value === needsEval) {
|
||||
value = doEval(intrinsicName);
|
||||
}
|
||||
if (typeof value === 'undefined' && !allowMissing) {
|
||||
throw new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');
|
||||
}
|
||||
|
||||
return {
|
||||
alias: alias,
|
||||
name: intrinsicName,
|
||||
value: value
|
||||
};
|
||||
}
|
||||
|
||||
throw new $SyntaxError('intrinsic ' + name + ' does not exist!');
|
||||
};
|
||||
|
||||
module.exports = function GetIntrinsic(name, allowMissing) {
|
||||
if (typeof name !== 'string' || name.length === 0) {
|
||||
throw new $TypeError('intrinsic name must be a non-empty string');
|
||||
}
|
||||
if (arguments.length > 1 && typeof allowMissing !== 'boolean') {
|
||||
throw new $TypeError('"allowMissing" argument must be a boolean');
|
||||
}
|
||||
|
||||
var parts = stringToPath(name);
|
||||
var intrinsicBaseName = parts.length > 0 ? parts[0] : '';
|
||||
|
||||
var intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);
|
||||
var intrinsicRealName = intrinsic.name;
|
||||
var value = intrinsic.value;
|
||||
var skipFurtherCaching = false;
|
||||
|
||||
var alias = intrinsic.alias;
|
||||
if (alias) {
|
||||
intrinsicBaseName = alias[0];
|
||||
$spliceApply(parts, $concat([0, 1], alias));
|
||||
}
|
||||
|
||||
for (var i = 1, isOwn = true; i < parts.length; i += 1) {
|
||||
var part = parts[i];
|
||||
var first = $strSlice(part, 0, 1);
|
||||
var last = $strSlice(part, -1);
|
||||
if (
|
||||
(
|
||||
(first === '"' || first === "'" || first === '`')
|
||||
|| (last === '"' || last === "'" || last === '`')
|
||||
)
|
||||
&& first !== last
|
||||
) {
|
||||
throw new $SyntaxError('property names with quotes must have matching quotes');
|
||||
}
|
||||
if (part === 'constructor' || !isOwn) {
|
||||
skipFurtherCaching = true;
|
||||
}
|
||||
|
||||
intrinsicBaseName += '.' + part;
|
||||
intrinsicRealName = '%' + intrinsicBaseName + '%';
|
||||
|
||||
if (hasOwn(INTRINSICS, intrinsicRealName)) {
|
||||
value = INTRINSICS[intrinsicRealName];
|
||||
} else if (value != null) {
|
||||
if (!(part in value)) {
|
||||
if (!allowMissing) {
|
||||
throw new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');
|
||||
}
|
||||
return void undefined;
|
||||
}
|
||||
if ($gOPD && (i + 1) >= parts.length) {
|
||||
var desc = $gOPD(value, part);
|
||||
isOwn = !!desc;
|
||||
|
||||
// By convention, when a data property is converted to an accessor
|
||||
// property to emulate a data property that does not suffer from
|
||||
// the override mistake, that accessor's getter is marked with
|
||||
// an `originalValue` property. Here, when we detect this, we
|
||||
// uphold the illusion by pretending to see that original data
|
||||
// property, i.e., returning the value rather than the getter
|
||||
// itself.
|
||||
if (isOwn && 'get' in desc && !('originalValue' in desc.get)) {
|
||||
value = desc.get;
|
||||
} else {
|
||||
value = value[part];
|
||||
}
|
||||
} else {
|
||||
isOwn = hasOwn(value, part);
|
||||
value = value[part];
|
||||
}
|
||||
|
||||
if (isOwn && !skipFurtherCaching) {
|
||||
INTRINSICS[intrinsicRealName] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
},{"function-bind":8,"has":13,"has-symbols":11}],10:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
|
||||
|
||||
var hasPropertyDescriptors = function hasPropertyDescriptors() {
|
||||
if ($defineProperty) {
|
||||
try {
|
||||
$defineProperty({}, 'a', { value: 1 });
|
||||
return true;
|
||||
} catch (e) {
|
||||
// IE 8 has a broken defineProperty
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
hasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {
|
||||
// node v0.6 has a bug where array lengths can be Set but not Defined
|
||||
if (!hasPropertyDescriptors()) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
return $defineProperty([], 'length', { value: 1 }).length !== 1;
|
||||
} catch (e) {
|
||||
// In Firefox 4-22, defining length on an array throws an exception.
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = hasPropertyDescriptors;
|
||||
|
||||
},{"get-intrinsic":9}],11:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var origSymbol = typeof Symbol !== 'undefined' && Symbol;
|
||||
var hasSymbolSham = require('./shams');
|
||||
|
||||
module.exports = function hasNativeSymbols() {
|
||||
if (typeof origSymbol !== 'function') { return false; }
|
||||
if (typeof Symbol !== 'function') { return false; }
|
||||
if (typeof origSymbol('foo') !== 'symbol') { return false; }
|
||||
if (typeof Symbol('bar') !== 'symbol') { return false; }
|
||||
|
||||
return hasSymbolSham();
|
||||
};
|
||||
|
||||
},{"./shams":12}],12:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
/* eslint complexity: [2, 18], max-statements: [2, 33] */
|
||||
module.exports = function hasSymbols() {
|
||||
if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }
|
||||
if (typeof Symbol.iterator === 'symbol') { return true; }
|
||||
|
||||
var obj = {};
|
||||
var sym = Symbol('test');
|
||||
var symObj = Object(sym);
|
||||
if (typeof sym === 'string') { return false; }
|
||||
|
||||
if (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }
|
||||
if (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }
|
||||
|
||||
// temp disabled per https://github.com/ljharb/object.assign/issues/17
|
||||
// if (sym instanceof Symbol) { return false; }
|
||||
// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4
|
||||
// if (!(symObj instanceof Symbol)) { return false; }
|
||||
|
||||
// if (typeof Symbol.prototype.toString !== 'function') { return false; }
|
||||
// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }
|
||||
|
||||
var symVal = 42;
|
||||
obj[sym] = symVal;
|
||||
for (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop
|
||||
if (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }
|
||||
|
||||
if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }
|
||||
|
||||
var syms = Object.getOwnPropertySymbols(obj);
|
||||
if (syms.length !== 1 || syms[0] !== sym) { return false; }
|
||||
|
||||
if (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }
|
||||
|
||||
if (typeof Object.getOwnPropertyDescriptor === 'function') {
|
||||
var descriptor = Object.getOwnPropertyDescriptor(obj, sym);
|
||||
if (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
},{}],13:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var bind = require('function-bind');
|
||||
|
||||
module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
|
||||
|
||||
},{"function-bind":8}],14:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var keysShim;
|
||||
if (!Object.keys) {
|
||||
// modified from https://github.com/es-shims/es5-shim
|
||||
var has = Object.prototype.hasOwnProperty;
|
||||
var toStr = Object.prototype.toString;
|
||||
var isArgs = require('./isArguments'); // eslint-disable-line global-require
|
||||
var isEnumerable = Object.prototype.propertyIsEnumerable;
|
||||
var hasDontEnumBug = !isEnumerable.call({ toString: null }, 'toString');
|
||||
var hasProtoEnumBug = isEnumerable.call(function () {}, 'prototype');
|
||||
var dontEnums = [
|
||||
'toString',
|
||||
'toLocaleString',
|
||||
'valueOf',
|
||||
'hasOwnProperty',
|
||||
'isPrototypeOf',
|
||||
'propertyIsEnumerable',
|
||||
'constructor'
|
||||
];
|
||||
var equalsConstructorPrototype = function (o) {
|
||||
var ctor = o.constructor;
|
||||
return ctor && ctor.prototype === o;
|
||||
};
|
||||
var excludedKeys = {
|
||||
$applicationCache: true,
|
||||
$console: true,
|
||||
$external: true,
|
||||
$frame: true,
|
||||
$frameElement: true,
|
||||
$frames: true,
|
||||
$innerHeight: true,
|
||||
$innerWidth: true,
|
||||
$onmozfullscreenchange: true,
|
||||
$onmozfullscreenerror: true,
|
||||
$outerHeight: true,
|
||||
$outerWidth: true,
|
||||
$pageXOffset: true,
|
||||
$pageYOffset: true,
|
||||
$parent: true,
|
||||
$scrollLeft: true,
|
||||
$scrollTop: true,
|
||||
$scrollX: true,
|
||||
$scrollY: true,
|
||||
$self: true,
|
||||
$webkitIndexedDB: true,
|
||||
$webkitStorageInfo: true,
|
||||
$window: true
|
||||
};
|
||||
var hasAutomationEqualityBug = (function () {
|
||||
/* global window */
|
||||
if (typeof window === 'undefined') { return false; }
|
||||
for (var k in window) {
|
||||
try {
|
||||
if (!excludedKeys['$' + k] && has.call(window, k) && window[k] !== null && typeof window[k] === 'object') {
|
||||
try {
|
||||
equalsConstructorPrototype(window[k]);
|
||||
} catch (e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}());
|
||||
var equalsConstructorPrototypeIfNotBuggy = function (o) {
|
||||
/* global window */
|
||||
if (typeof window === 'undefined' || !hasAutomationEqualityBug) {
|
||||
return equalsConstructorPrototype(o);
|
||||
}
|
||||
try {
|
||||
return equalsConstructorPrototype(o);
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
keysShim = function keys(object) {
|
||||
var isObject = object !== null && typeof object === 'object';
|
||||
var isFunction = toStr.call(object) === '[object Function]';
|
||||
var isArguments = isArgs(object);
|
||||
var isString = isObject && toStr.call(object) === '[object String]';
|
||||
var theKeys = [];
|
||||
|
||||
if (!isObject && !isFunction && !isArguments) {
|
||||
throw new TypeError('Object.keys called on a non-object');
|
||||
}
|
||||
|
||||
var skipProto = hasProtoEnumBug && isFunction;
|
||||
if (isString && object.length > 0 && !has.call(object, 0)) {
|
||||
for (var i = 0; i < object.length; ++i) {
|
||||
theKeys.push(String(i));
|
||||
}
|
||||
}
|
||||
|
||||
if (isArguments && object.length > 0) {
|
||||
for (var j = 0; j < object.length; ++j) {
|
||||
theKeys.push(String(j));
|
||||
}
|
||||
} else {
|
||||
for (var name in object) {
|
||||
if (!(skipProto && name === 'prototype') && has.call(object, name)) {
|
||||
theKeys.push(String(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hasDontEnumBug) {
|
||||
var skipConstructor = equalsConstructorPrototypeIfNotBuggy(object);
|
||||
|
||||
for (var k = 0; k < dontEnums.length; ++k) {
|
||||
if (!(skipConstructor && dontEnums[k] === 'constructor') && has.call(object, dontEnums[k])) {
|
||||
theKeys.push(dontEnums[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return theKeys;
|
||||
};
|
||||
}
|
||||
module.exports = keysShim;
|
||||
|
||||
},{"./isArguments":16}],15:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var slice = Array.prototype.slice;
|
||||
var isArgs = require('./isArguments');
|
||||
|
||||
var origKeys = Object.keys;
|
||||
var keysShim = origKeys ? function keys(o) { return origKeys(o); } : require('./implementation');
|
||||
|
||||
var originalKeys = Object.keys;
|
||||
|
||||
keysShim.shim = function shimObjectKeys() {
|
||||
if (Object.keys) {
|
||||
var keysWorksWithArguments = (function () {
|
||||
// Safari 5.0 bug
|
||||
var args = Object.keys(arguments);
|
||||
return args && args.length === arguments.length;
|
||||
}(1, 2));
|
||||
if (!keysWorksWithArguments) {
|
||||
Object.keys = function keys(object) { // eslint-disable-line func-name-matching
|
||||
if (isArgs(object)) {
|
||||
return originalKeys(slice.call(object));
|
||||
}
|
||||
return originalKeys(object);
|
||||
};
|
||||
}
|
||||
} else {
|
||||
Object.keys = keysShim;
|
||||
}
|
||||
return Object.keys || keysShim;
|
||||
};
|
||||
|
||||
module.exports = keysShim;
|
||||
|
||||
},{"./implementation":14,"./isArguments":16}],16:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var toStr = Object.prototype.toString;
|
||||
|
||||
module.exports = function isArguments(value) {
|
||||
var str = toStr.call(value);
|
||||
var isArgs = str === '[object Arguments]';
|
||||
if (!isArgs) {
|
||||
isArgs = str !== '[object Array]' &&
|
||||
value !== null &&
|
||||
typeof value === 'object' &&
|
||||
typeof value.length === 'number' &&
|
||||
value.length >= 0 &&
|
||||
toStr.call(value.callee) === '[object Function]';
|
||||
}
|
||||
return isArgs;
|
||||
};
|
||||
|
||||
},{}],17:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var implementation = require('./implementation');
|
||||
|
||||
var lacksProperEnumerationOrder = function () {
|
||||
if (!Object.assign) {
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
* v8, specifically in node 4.x, has a bug with incorrect property enumeration order
|
||||
* note: this does not detect the bug unless there's 20 characters
|
||||
*/
|
||||
var str = 'abcdefghijklmnopqrst';
|
||||
var letters = str.split('');
|
||||
var map = {};
|
||||
for (var i = 0; i < letters.length; ++i) {
|
||||
map[letters[i]] = letters[i];
|
||||
}
|
||||
var obj = Object.assign({}, map);
|
||||
var actual = '';
|
||||
for (var k in obj) {
|
||||
actual += k;
|
||||
}
|
||||
return str !== actual;
|
||||
};
|
||||
|
||||
var assignHasPendingExceptions = function () {
|
||||
if (!Object.assign || !Object.preventExtensions) {
|
||||
return false;
|
||||
}
|
||||
/*
|
||||
* Firefox 37 still has "pending exception" logic in its Object.assign implementation,
|
||||
* which is 72% slower than our shim, and Firefox 40's native implementation.
|
||||
*/
|
||||
var thrower = Object.preventExtensions({ 1: 2 });
|
||||
try {
|
||||
Object.assign(thrower, 'xy');
|
||||
} catch (e) {
|
||||
return thrower[1] === 'y';
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
module.exports = function getPolyfill() {
|
||||
if (!Object.assign) {
|
||||
return implementation;
|
||||
}
|
||||
if (lacksProperEnumerationOrder()) {
|
||||
return implementation;
|
||||
}
|
||||
if (assignHasPendingExceptions()) {
|
||||
return implementation;
|
||||
}
|
||||
return Object.assign;
|
||||
};
|
||||
|
||||
},{"./implementation":2}],18:[function(require,module,exports){
|
||||
'use strict';
|
||||
|
||||
var define = require('define-properties');
|
||||
var getPolyfill = require('./polyfill');
|
||||
|
||||
module.exports = function shimAssign() {
|
||||
var polyfill = getPolyfill();
|
||||
define(
|
||||
Object,
|
||||
{ assign: polyfill },
|
||||
{ assign: function () { return Object.assign !== polyfill; } }
|
||||
);
|
||||
return polyfill;
|
||||
};
|
||||
|
||||
},{"./polyfill":17,"define-properties":6}]},{},[1]);
|
||||
@@ -0,0 +1,9 @@
|
||||
import Plugin from '../../lib/plugin/Plugin.js';
|
||||
|
||||
class ReplacePlugin extends Plugin {
|
||||
static disablePlugin() {
|
||||
return ['version', 'git', 'npm'];
|
||||
}
|
||||
}
|
||||
|
||||
export default ReplacePlugin;
|
||||
@@ -0,0 +1,23 @@
|
||||
'use strict';
|
||||
|
||||
var $isFinite = require('../helpers/isFinite');
|
||||
var timeConstants = require('../helpers/timeConstants');
|
||||
var msPerSecond = timeConstants.msPerSecond;
|
||||
var msPerMinute = timeConstants.msPerMinute;
|
||||
var msPerHour = timeConstants.msPerHour;
|
||||
|
||||
var ToIntegerOrInfinity = require('./ToIntegerOrInfinity');
|
||||
|
||||
// https://262.ecma-international.org/12.0/#sec-maketime
|
||||
|
||||
module.exports = function MakeTime(hour, min, sec, ms) {
|
||||
if (!$isFinite(hour) || !$isFinite(min) || !$isFinite(sec) || !$isFinite(ms)) {
|
||||
return NaN;
|
||||
}
|
||||
var h = ToIntegerOrInfinity(hour);
|
||||
var m = ToIntegerOrInfinity(min);
|
||||
var s = ToIntegerOrInfinity(sec);
|
||||
var milli = ToIntegerOrInfinity(ms);
|
||||
var t = (h * msPerHour) + (m * msPerMinute) + (s * msPerSecond) + milli;
|
||||
return t;
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Nicolas Gallagher
|
||||
Copyright (c) Jonathan Neal
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
Copyright (c) Adam Wathan
|
||||
Copyright (c) Jonathan Reinink
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
|
||||
var resolveException = require("../lib/resolve-exception")
|
||||
, coerce = require("./coerce");
|
||||
|
||||
module.exports = function (value/*, options*/) {
|
||||
var coerced = coerce(value);
|
||||
if (coerced !== null) return coerced;
|
||||
var options = arguments[1];
|
||||
var errorMessage =
|
||||
options && options.name
|
||||
? "Expected a time value for %n, received %v"
|
||||
: "%v is not a time value";
|
||||
return resolveException(value, errorMessage, options);
|
||||
};
|
||||
@@ -0,0 +1,78 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.hkdf = exports.expand = exports.extract = void 0;
|
||||
const _assert_js_1 = require("./_assert.js");
|
||||
const utils_js_1 = require("./utils.js");
|
||||
const hmac_js_1 = require("./hmac.js");
|
||||
// HKDF (RFC 5869)
|
||||
// https://soatok.blog/2021/11/17/understanding-hkdf/
|
||||
/**
|
||||
* HKDF-Extract(IKM, salt) -> PRK
|
||||
* Arguments position differs from spec (IKM is first one, since it is not optional)
|
||||
* @param hash
|
||||
* @param ikm
|
||||
* @param salt
|
||||
* @returns
|
||||
*/
|
||||
function extract(hash, ikm, salt) {
|
||||
_assert_js_1.default.hash(hash);
|
||||
// NOTE: some libraries treat zero-length array as 'not provided';
|
||||
// we don't, since we have undefined as 'not provided'
|
||||
// https://github.com/RustCrypto/KDFs/issues/15
|
||||
if (salt === undefined)
|
||||
salt = new Uint8Array(hash.outputLen); // if not provided, it is set to a string of HashLen zeros
|
||||
return (0, hmac_js_1.hmac)(hash, (0, utils_js_1.toBytes)(salt), (0, utils_js_1.toBytes)(ikm));
|
||||
}
|
||||
exports.extract = extract;
|
||||
// HKDF-Expand(PRK, info, L) -> OKM
|
||||
const HKDF_COUNTER = new Uint8Array([0]);
|
||||
const EMPTY_BUFFER = new Uint8Array();
|
||||
/**
|
||||
* HKDF-expand from the spec.
|
||||
* @param prk - a pseudorandom key of at least HashLen octets (usually, the output from the extract step)
|
||||
* @param info - optional context and application specific information (can be a zero-length string)
|
||||
* @param length - length of output keying material in octets
|
||||
*/
|
||||
function expand(hash, prk, info, length = 32) {
|
||||
_assert_js_1.default.hash(hash);
|
||||
_assert_js_1.default.number(length);
|
||||
if (length > 255 * hash.outputLen)
|
||||
throw new Error('Length should be <= 255*HashLen');
|
||||
const blocks = Math.ceil(length / hash.outputLen);
|
||||
if (info === undefined)
|
||||
info = EMPTY_BUFFER;
|
||||
// first L(ength) octets of T
|
||||
const okm = new Uint8Array(blocks * hash.outputLen);
|
||||
// Re-use HMAC instance between blocks
|
||||
const HMAC = hmac_js_1.hmac.create(hash, prk);
|
||||
const HMACTmp = HMAC._cloneInto();
|
||||
const T = new Uint8Array(HMAC.outputLen);
|
||||
for (let counter = 0; counter < blocks; counter++) {
|
||||
HKDF_COUNTER[0] = counter + 1;
|
||||
// T(0) = empty string (zero length)
|
||||
// T(N) = HMAC-Hash(PRK, T(N-1) | info | N)
|
||||
HMACTmp.update(counter === 0 ? EMPTY_BUFFER : T)
|
||||
.update(info)
|
||||
.update(HKDF_COUNTER)
|
||||
.digestInto(T);
|
||||
okm.set(T, hash.outputLen * counter);
|
||||
HMAC._cloneInto(HMACTmp);
|
||||
}
|
||||
HMAC.destroy();
|
||||
HMACTmp.destroy();
|
||||
T.fill(0);
|
||||
HKDF_COUNTER.fill(0);
|
||||
return okm.slice(0, length);
|
||||
}
|
||||
exports.expand = expand;
|
||||
/**
|
||||
* HKDF (RFC 5869): extract + expand in one step.
|
||||
* @param hash - hash function that would be used (e.g. sha256)
|
||||
* @param ikm - input keying material, the initial key
|
||||
* @param salt - optional salt value (a non-secret random value)
|
||||
* @param info - optional context and application specific information
|
||||
* @param length - length of output keying material in octets
|
||||
*/
|
||||
const hkdf = (hash, ikm, salt, info, length) => expand(hash, extract(hash, ikm, salt), info, length);
|
||||
exports.hkdf = hkdf;
|
||||
//# sourceMappingURL=hkdf.js.map
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
Get the element type of an `Iterable`/`AsyncIterable`. For example, an array or a generator.
|
||||
|
||||
This can be useful, for example, if you want to get the type that is yielded in a generator function. Often the return type of those functions are not specified.
|
||||
|
||||
This type works with both `Iterable`s and `AsyncIterable`s, so it can be use with synchronous and asynchronous generators.
|
||||
|
||||
Here is an example of `IterableElement` in action with a generator function:
|
||||
|
||||
@example
|
||||
```
|
||||
function * iAmGenerator() {
|
||||
yield 1;
|
||||
yield 2;
|
||||
}
|
||||
|
||||
type MeNumber = IterableElement<ReturnType<typeof iAmGenerator>>
|
||||
```
|
||||
|
||||
And here is an example with an async generator:
|
||||
|
||||
@example
|
||||
```
|
||||
async function * iAmGeneratorAsync() {
|
||||
yield 'hi';
|
||||
yield true;
|
||||
}
|
||||
|
||||
type MeStringOrBoolean = IterableElement<ReturnType<typeof iAmGeneratorAsync>>
|
||||
```
|
||||
|
||||
Many types in JavaScript/TypeScript are iterables. This type works on all types that implement those interfaces. For example, `Array`, `Set`, `Map`, `stream.Readable`, etc.
|
||||
|
||||
An example with an array of strings:
|
||||
|
||||
@example
|
||||
```
|
||||
type MeString = IterableElement<string[]>
|
||||
```
|
||||
|
||||
@category Utilities
|
||||
*/
|
||||
export type IterableElement<TargetIterable> =
|
||||
TargetIterable extends Iterable<infer ElementType> ?
|
||||
ElementType :
|
||||
TargetIterable extends AsyncIterable<infer ElementType> ?
|
||||
ElementType :
|
||||
never;
|
||||
@@ -0,0 +1,6 @@
|
||||
import assertString from './util/assertString';
|
||||
import isHexadecimal from './isHexadecimal';
|
||||
export default function isMongoId(str) {
|
||||
assertString(str);
|
||||
return isHexadecimal(str) && str.length === 24;
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
"use strict";
|
||||
|
||||
var assert = require("chai").assert
|
||||
, coerceToSafeInteger = require("../../safe-integer/coerce");
|
||||
|
||||
describe("safe-integer/coerce", function () {
|
||||
it("Should coerce float to integer", function () {
|
||||
assert.equal(coerceToSafeInteger(123.123), 123);
|
||||
assert.equal(coerceToSafeInteger(123.823), 123);
|
||||
assert.equal(coerceToSafeInteger(-123.123), -123);
|
||||
assert.equal(coerceToSafeInteger(-123.823), -123);
|
||||
});
|
||||
it("Should coerce string", function () { assert.equal(coerceToSafeInteger("12.123"), 12); });
|
||||
it("Should coerce booleans", function () { assert.equal(coerceToSafeInteger(true), 1); });
|
||||
it("Should coerce number objects", function () {
|
||||
assert.equal(coerceToSafeInteger(new Number(343)), 343);
|
||||
});
|
||||
it("Should coerce objects", function () {
|
||||
assert.equal(coerceToSafeInteger({ valueOf: function () { return 23; } }), 23);
|
||||
});
|
||||
it("Should reject infinite number", function () {
|
||||
assert.equal(coerceToSafeInteger(Infinity), null);
|
||||
});
|
||||
it("Should reject number beyond Number.MAX_SAFE_INTEGER", function () {
|
||||
assert.equal(coerceToSafeInteger(9007199254740992), null);
|
||||
});
|
||||
it("Should reject number beyond Number.MIN_SAFE_INTEGER", function () {
|
||||
assert.equal(coerceToSafeInteger(-9007199254740992), null);
|
||||
});
|
||||
|
||||
it("Should reject NaN", function () { assert.equal(coerceToSafeInteger(NaN), null); });
|
||||
|
||||
if (typeof Object.create === "function") {
|
||||
it("Should not coerce objects with no number representation", function () {
|
||||
assert.equal(coerceToSafeInteger(Object.create(null)), null);
|
||||
});
|
||||
}
|
||||
|
||||
it("Should not coerce null", function () { assert.equal(coerceToSafeInteger(null), null); });
|
||||
it("Should not coerce undefined", function () {
|
||||
assert.equal(coerceToSafeInteger(undefined), null);
|
||||
});
|
||||
|
||||
if (typeof Symbol === "function") {
|
||||
it("Should not coerce symbols", function () {
|
||||
assert.equal(coerceToSafeInteger(Symbol("foo")), null);
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
|
||||
var resolveException = require("../lib/resolve-exception")
|
||||
, coerce = require("./coerce");
|
||||
|
||||
module.exports = function (value/*, options*/) {
|
||||
var coerced = coerce(value);
|
||||
if (coerced !== null) return coerced;
|
||||
var options = arguments[1];
|
||||
var errorMessage =
|
||||
options && options.name ? "Expected a string for %n, received %v" : "%v is not a string";
|
||||
return resolveException(value, errorMessage, options);
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
var Token = {
|
||||
AT_RULE: 'at-rule', // e.g. `@import`, `@charset`
|
||||
AT_RULE_BLOCK: 'at-rule-block', // e.g. `@font-face{...}`
|
||||
AT_RULE_BLOCK_SCOPE: 'at-rule-block-scope', // e.g. `@font-face`
|
||||
COMMENT: 'comment', // e.g. `/* comment */`
|
||||
NESTED_BLOCK: 'nested-block', // e.g. `@media screen{...}`, `@keyframes animation {...}`
|
||||
NESTED_BLOCK_SCOPE: 'nested-block-scope', // e.g. `@media`, `@keyframes`
|
||||
PROPERTY: 'property', // e.g. `color:red`
|
||||
PROPERTY_BLOCK: 'property-block', // e.g. `--var:{color:red}`
|
||||
PROPERTY_NAME: 'property-name', // e.g. `color`
|
||||
PROPERTY_VALUE: 'property-value', // e.g. `red`
|
||||
RAW: 'raw', // e.g. anything between /* clean-css ignore:start */ and /* clean-css ignore:end */ comments
|
||||
RULE: 'rule', // e.g `div > a{...}`
|
||||
RULE_SCOPE: 'rule-scope' // e.g `div > a`
|
||||
};
|
||||
|
||||
module.exports = Token;
|
||||
@@ -0,0 +1,397 @@
|
||||
2.1.35 / 2022-03-12
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.52.0
|
||||
- Add extensions from IANA for more `image/*` types
|
||||
- Add extension `.asc` to `application/pgp-keys`
|
||||
- Add extensions to various XML types
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.34 / 2021-11-08
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.51.0
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.33 / 2021-10-01
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.50.0
|
||||
- Add deprecated iWorks mime types and extensions
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.32 / 2021-07-27
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.49.0
|
||||
- Add extension `.trig` to `application/trig`
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.31 / 2021-06-01
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.48.0
|
||||
- Add extension `.mvt` to `application/vnd.mapbox-vector-tile`
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.30 / 2021-04-02
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.47.0
|
||||
- Add extension `.amr` to `audio/amr`
|
||||
- Remove ambigious extensions from IANA for `application/*+xml` types
|
||||
- Update primary extension to `.es` for `application/ecmascript`
|
||||
|
||||
2.1.29 / 2021-02-17
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.46.0
|
||||
- Add extension `.amr` to `audio/amr`
|
||||
- Add extension `.m4s` to `video/iso.segment`
|
||||
- Add extension `.opus` to `audio/ogg`
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.28 / 2021-01-01
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.45.0
|
||||
- Add `application/ubjson` with extension `.ubj`
|
||||
- Add `image/avif` with extension `.avif`
|
||||
- Add `image/ktx2` with extension `.ktx2`
|
||||
- Add extension `.dbf` to `application/vnd.dbf`
|
||||
- Add extension `.rar` to `application/vnd.rar`
|
||||
- Add extension `.td` to `application/urc-targetdesc+xml`
|
||||
- Add new upstream MIME types
|
||||
- Fix extension of `application/vnd.apple.keynote` to be `.key`
|
||||
|
||||
2.1.27 / 2020-04-23
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.44.0
|
||||
- Add charsets from IANA
|
||||
- Add extension `.cjs` to `application/node`
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.26 / 2020-01-05
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.43.0
|
||||
- Add `application/x-keepass2` with extension `.kdbx`
|
||||
- Add extension `.mxmf` to `audio/mobile-xmf`
|
||||
- Add extensions from IANA for `application/*+xml` types
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.25 / 2019-11-12
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.42.0
|
||||
- Add new upstream MIME types
|
||||
- Add `application/toml` with extension `.toml`
|
||||
- Add `image/vnd.ms-dds` with extension `.dds`
|
||||
|
||||
2.1.24 / 2019-04-20
|
||||
===================
|
||||
|
||||
* deps: mime-db@1.40.0
|
||||
- Add extensions from IANA for `model/*` types
|
||||
- Add `text/mdx` with extension `.mdx`
|
||||
|
||||
2.1.23 / 2019-04-17
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.39.0
|
||||
- Add extensions `.siv` and `.sieve` to `application/sieve`
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.22 / 2019-02-14
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.38.0
|
||||
- Add extension `.nq` to `application/n-quads`
|
||||
- Add extension `.nt` to `application/n-triples`
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.21 / 2018-10-19
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.37.0
|
||||
- Add extensions to HEIC image types
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.20 / 2018-08-26
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.36.0
|
||||
- Add Apple file extensions from IANA
|
||||
- Add extensions from IANA for `image/*` types
|
||||
- Add new upstream MIME types
|
||||
|
||||
2.1.19 / 2018-07-17
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.35.0
|
||||
- Add extension `.csl` to `application/vnd.citationstyles.style+xml`
|
||||
- Add extension `.es` to `application/ecmascript`
|
||||
- Add extension `.owl` to `application/rdf+xml`
|
||||
- Add new upstream MIME types
|
||||
- Add UTF-8 as default charset for `text/turtle`
|
||||
|
||||
2.1.18 / 2018-02-16
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.33.0
|
||||
- Add `application/raml+yaml` with extension `.raml`
|
||||
- Add `application/wasm` with extension `.wasm`
|
||||
- Add `text/shex` with extension `.shex`
|
||||
- Add extensions for JPEG-2000 images
|
||||
- Add extensions from IANA for `message/*` types
|
||||
- Add new upstream MIME types
|
||||
- Update font MIME types
|
||||
- Update `text/hjson` to registered `application/hjson`
|
||||
|
||||
2.1.17 / 2017-09-01
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.30.0
|
||||
- Add `application/vnd.ms-outlook`
|
||||
- Add `application/x-arj`
|
||||
- Add extension `.mjs` to `application/javascript`
|
||||
- Add glTF types and extensions
|
||||
- Add new upstream MIME types
|
||||
- Add `text/x-org`
|
||||
- Add VirtualBox MIME types
|
||||
- Fix `source` records for `video/*` types that are IANA
|
||||
- Update `font/opentype` to registered `font/otf`
|
||||
|
||||
2.1.16 / 2017-07-24
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.29.0
|
||||
- Add `application/fido.trusted-apps+json`
|
||||
- Add extension `.wadl` to `application/vnd.sun.wadl+xml`
|
||||
- Add extension `.gz` to `application/gzip`
|
||||
- Add new upstream MIME types
|
||||
- Update extensions `.md` and `.markdown` to be `text/markdown`
|
||||
|
||||
2.1.15 / 2017-03-23
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.27.0
|
||||
- Add new mime types
|
||||
- Add `image/apng`
|
||||
|
||||
2.1.14 / 2017-01-14
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.26.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.13 / 2016-11-18
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.25.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.12 / 2016-09-18
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.24.0
|
||||
- Add new mime types
|
||||
- Add `audio/mp3`
|
||||
|
||||
2.1.11 / 2016-05-01
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.23.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.10 / 2016-02-15
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.22.0
|
||||
- Add new mime types
|
||||
- Fix extension of `application/dash+xml`
|
||||
- Update primary extension for `audio/mp4`
|
||||
|
||||
2.1.9 / 2016-01-06
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.21.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.8 / 2015-11-30
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.20.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.7 / 2015-09-20
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.19.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.6 / 2015-09-03
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.18.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.5 / 2015-08-20
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.17.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.4 / 2015-07-30
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.16.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.3 / 2015-07-13
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.15.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.2 / 2015-06-25
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.14.0
|
||||
- Add new mime types
|
||||
|
||||
2.1.1 / 2015-06-08
|
||||
==================
|
||||
|
||||
* perf: fix deopt during mapping
|
||||
|
||||
2.1.0 / 2015-06-07
|
||||
==================
|
||||
|
||||
* Fix incorrectly treating extension-less file name as extension
|
||||
- i.e. `'path/to/json'` will no longer return `application/json`
|
||||
* Fix `.charset(type)` to accept parameters
|
||||
* Fix `.charset(type)` to match case-insensitive
|
||||
* Improve generation of extension to MIME mapping
|
||||
* Refactor internals for readability and no argument reassignment
|
||||
* Prefer `application/*` MIME types from the same source
|
||||
* Prefer any type over `application/octet-stream`
|
||||
* deps: mime-db@~1.13.0
|
||||
- Add nginx as a source
|
||||
- Add new mime types
|
||||
|
||||
2.0.14 / 2015-06-06
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.12.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.13 / 2015-05-31
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.11.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.12 / 2015-05-19
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.10.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.11 / 2015-05-05
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.9.1
|
||||
- Add new mime types
|
||||
|
||||
2.0.10 / 2015-03-13
|
||||
===================
|
||||
|
||||
* deps: mime-db@~1.8.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.9 / 2015-02-09
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.7.0
|
||||
- Add new mime types
|
||||
- Community extensions ownership transferred from `node-mime`
|
||||
|
||||
2.0.8 / 2015-01-29
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.6.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.7 / 2014-12-30
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.5.0
|
||||
- Add new mime types
|
||||
- Fix various invalid MIME type entries
|
||||
|
||||
2.0.6 / 2014-12-30
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.4.0
|
||||
- Add new mime types
|
||||
- Fix various invalid MIME type entries
|
||||
- Remove example template MIME types
|
||||
|
||||
2.0.5 / 2014-12-29
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.3.1
|
||||
- Fix missing extensions
|
||||
|
||||
2.0.4 / 2014-12-10
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.3.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.3 / 2014-11-09
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.2.0
|
||||
- Add new mime types
|
||||
|
||||
2.0.2 / 2014-09-28
|
||||
==================
|
||||
|
||||
* deps: mime-db@~1.1.0
|
||||
- Add new mime types
|
||||
- Update charsets
|
||||
|
||||
2.0.1 / 2014-09-07
|
||||
==================
|
||||
|
||||
* Support Node.js 0.6
|
||||
|
||||
2.0.0 / 2014-09-02
|
||||
==================
|
||||
|
||||
* Use `mime-db`
|
||||
* Remove `.define()`
|
||||
|
||||
1.0.2 / 2014-08-04
|
||||
==================
|
||||
|
||||
* Set charset=utf-8 for `text/javascript`
|
||||
|
||||
1.0.1 / 2014-06-24
|
||||
==================
|
||||
|
||||
* Add `text/jsx` type
|
||||
|
||||
1.0.0 / 2014-05-12
|
||||
==================
|
||||
|
||||
* Return `false` for unknown types
|
||||
* Set charset=utf-8 for `application/json`
|
||||
|
||||
0.1.0 / 2014-05-02
|
||||
==================
|
||||
|
||||
* Initial release
|
||||
@@ -0,0 +1,17 @@
|
||||
import { VERSION } from "./version";
|
||||
import { paginate } from "./paginate";
|
||||
import { iterator } from "./iterator";
|
||||
export { composePaginateRest } from "./compose-paginate";
|
||||
export { isPaginatingEndpoint, paginatingEndpoints, } from "./paginating-endpoints";
|
||||
/**
|
||||
* @param octokit Octokit instance
|
||||
* @param options Options passed to Octokit constructor
|
||||
*/
|
||||
export function paginateRest(octokit) {
|
||||
return {
|
||||
paginate: Object.assign(paginate.bind(null, octokit), {
|
||||
iterator: iterator.bind(null, octokit),
|
||||
}),
|
||||
};
|
||||
}
|
||||
paginateRest.VERSION = VERSION;
|
||||
@@ -0,0 +1,43 @@
|
||||
var apply = require('./_apply'),
|
||||
createCtor = require('./_createCtor'),
|
||||
root = require('./_root');
|
||||
|
||||
/** Used to compose bitmasks for function metadata. */
|
||||
var WRAP_BIND_FLAG = 1;
|
||||
|
||||
/**
|
||||
* Creates a function that wraps `func` to invoke it with the `this` binding
|
||||
* of `thisArg` and `partials` prepended to the arguments it receives.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {number} bitmask The bitmask flags. See `createWrap` for more details.
|
||||
* @param {*} thisArg The `this` binding of `func`.
|
||||
* @param {Array} partials The arguments to prepend to those provided to
|
||||
* the new function.
|
||||
* @returns {Function} Returns the new wrapped function.
|
||||
*/
|
||||
function createPartial(func, bitmask, thisArg, partials) {
|
||||
var isBind = bitmask & WRAP_BIND_FLAG,
|
||||
Ctor = createCtor(func);
|
||||
|
||||
function wrapper() {
|
||||
var argsIndex = -1,
|
||||
argsLength = arguments.length,
|
||||
leftIndex = -1,
|
||||
leftLength = partials.length,
|
||||
args = Array(leftLength + argsLength),
|
||||
fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;
|
||||
|
||||
while (++leftIndex < leftLength) {
|
||||
args[leftIndex] = partials[leftIndex];
|
||||
}
|
||||
while (argsLength--) {
|
||||
args[leftIndex++] = arguments[++argsIndex];
|
||||
}
|
||||
return apply(fn, isBind ? thisArg : this, args);
|
||||
}
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
module.exports = createPartial;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0.0049,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0.09808,"49":0,"50":0,"51":0,"52":0.01471,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0.0049,"61":0,"62":0,"63":0,"64":0.0049,"65":0,"66":0,"67":0.01471,"68":0.02452,"69":0,"70":0,"71":0,"72":0.01471,"73":0,"74":0,"75":0.06866,"76":0,"77":0,"78":0.10789,"79":0,"80":0,"81":0,"82":0.00981,"83":0.0049,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0.37761,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0.01471,"99":0.02452,"100":0,"101":0.0049,"102":0.10789,"103":0.0049,"104":0.00981,"105":0.00981,"106":0.00981,"107":0.02452,"108":0.06866,"109":1.68207,"110":1.01513,"111":0.0049,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.0049,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0.02452,"68":0,"69":0.0049,"70":0.0049,"71":0.01962,"72":0,"73":0,"74":0.0049,"75":0,"76":0.01471,"77":0,"78":0.0049,"79":0.10789,"80":0.0049,"81":0.08337,"83":0.00981,"84":0.01962,"85":0.19126,"86":0.01471,"87":0.19616,"88":0.0049,"89":0,"90":0,"91":0.0049,"92":0.05394,"93":0.0049,"94":0,"95":0.0049,"96":0.0049,"97":0,"98":0.0049,"99":0.01962,"100":0.00981,"101":0.00981,"102":0.05885,"103":0.21087,"104":0.00981,"105":0.04904,"106":0.02942,"107":0.10789,"108":0.31876,"109":6.03192,"110":3.5554,"111":0,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00981,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0.01962,"66":0,"67":0.0049,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.00981,"94":0.20106,"95":0.1226,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0.01471,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0.0049,"90":0,"91":0,"92":0.00981,"93":0.09318,"94":0,"95":0,"96":0,"97":0,"98":0.0049,"99":0.0049,"100":0,"101":0,"102":0.0049,"103":0,"104":0.0049,"105":0.0049,"106":0.0049,"107":0.00981,"108":0.13731,"109":1.14754,"110":1.07888},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.01471,"14":0.1275,"15":0.01962,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0.00981,"12.1":0.04414,"13.1":0.13241,"14.1":0.33838,"15.1":0.05394,"15.2-15.3":0.04414,"15.4":0.08337,"15.5":0.19126,"15.6":0.84349,"16.0":0.09318,"16.1":0.18635,"16.2":0.93666,"16.3":0.52963,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.01452,"6.0-6.1":0,"7.0-7.1":0.01452,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.09292,"10.0-10.2":0.01452,"10.3":0.05517,"11.0-11.2":0,"11.3-11.4":0.01161,"12.0-12.1":0.04356,"12.2-12.5":0.97854,"13.0-13.1":0.0029,"13.2":0,"13.3":0.01161,"13.4-13.7":0.02904,"14.0-14.4":0.49653,"14.5-14.8":0.99305,"15.0-15.1":0.3194,"15.2-15.3":0.27294,"15.4":0.61848,"15.5":0.77818,"15.6":2.87173,"16.0":2.94722,"16.1":6.70457,"16.2":6.90202,"16.3":3.19694,"16.4":0.01452},P:{"4":0.02064,"20":1.22805,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.1032,"8.2":0,"9.2":0.01032,"10.1":0,"11.1-11.2":0.04128,"12.0":0,"13.0":0.02064,"14.0":0.02064,"15.0":0.02064,"16.0":0.08256,"17.0":0.04128,"18.0":0.12384,"19.0":2.40449},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.09337},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.2403,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.02038},H:{"0":0.97456},L:{"0":42.41827},R:{_:"0"},M:{"0":0.31086},Q:{"13.1":0}};
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"normalize-url","version":"8.0.0","files":{"license":{"checkedAt":1678883669302,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1678883671092,"integrity":"sha512-fZuScebhPoJvmwtY8gFn0BNEVO95FzjNynIyKbKwEIhwAq9wideagBmqvCEGZ6xU/xTkz7z03jh5Fzew1hP45w==","mode":420,"size":8392},"package.json":{"checkedAt":1678883671092,"integrity":"sha512-EAI2TzdvkPQ0xbStGSkZyhd+ukGXcxZY+C5r85LhJUyn3Zr0KYAJLhgg+rKH3b5lcPmf2whxBblb0qsyqoEhVA==","mode":420,"size":893},"readme.md":{"checkedAt":1678883671094,"integrity":"sha512-xXmsVtQ9BpgmgoaJoQHPR1w976FwwFK3i2QOWF3d1Iw35Ftt8bbJp7U2fwKjoTnJAejdRtZOJcP+fJDp6PA1Bw==","mode":420,"size":8085},"index.d.ts":{"checkedAt":1678883671094,"integrity":"sha512-epKTN7aiLv9C1UGIBBjCOMKwz4IQXkbGy/1qa+u48S0Z1v7rK9PTJkDx4ZLs3eAaCRHx12SR3qKMlVgqosol8A==","mode":420,"size":7175}}}
|
||||
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* https://tc39.es/ecma402/#sec-bestavailablelocale
|
||||
* @param availableLocales
|
||||
* @param locale
|
||||
*/
|
||||
export function BestAvailableLocale(availableLocales, locale) {
|
||||
var candidate = locale;
|
||||
while (true) {
|
||||
if (availableLocales.has(candidate)) {
|
||||
return candidate;
|
||||
}
|
||||
var pos = candidate.lastIndexOf('-');
|
||||
if (!~pos) {
|
||||
return undefined;
|
||||
}
|
||||
if (pos >= 2 && candidate[pos - 2] === '-') {
|
||||
pos -= 2;
|
||||
}
|
||||
candidate = candidate.slice(0, pos);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $String = GetIntrinsic('%String%');
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Type = require('../Type');
|
||||
|
||||
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-tostring
|
||||
|
||||
module.exports = function BigIntToString(x) {
|
||||
if (Type(x) !== 'BigInt') {
|
||||
throw new $TypeError('Assertion failed: `x` must be a BigInt');
|
||||
}
|
||||
|
||||
return $String(x);
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('partition', require('../partition'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = function some(array, predicate) {
|
||||
for (var i = 0; i < array.length; i += 1) {
|
||||
if (predicate(array[i], i, array)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"k l m n o p q r s t u f H","2":"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"},C:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h 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 EC FC"},D:{"1":"j k l m n o p q r s t u f H xB yB GC","2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB 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 e i","66":"a b c d"},E:{"2":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"1":"S T U V W X Y Z a b c d e","2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB 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 PC QC RC SC qB AC TC rB"},G:{"2":"E zB UC BC 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"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"2":"H"},N:{"2":"A B"},O:{"2":"vC"},P:{"1":"g 7C 8C","2":"I wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C"},Q:{"2":"1B"},R:{"1":"9C"},S:{"2":"AD BD"}},B:5,C:"WebTransport"};
|
||||
@@ -0,0 +1,41 @@
|
||||
export type Options = {
|
||||
/**
|
||||
By default the wrap is soft, meaning long words may extend past the column width. Setting this to `true` will make it hard wrap at the column width.
|
||||
|
||||
@default false
|
||||
*/
|
||||
readonly hard?: boolean;
|
||||
|
||||
/**
|
||||
By default, an attempt is made to split words at spaces, ensuring that they don't extend past the configured columns. If wordWrap is `false`, each column will instead be completely filled splitting words as necessary.
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly wordWrap?: boolean;
|
||||
|
||||
/**
|
||||
Whitespace on all lines is removed by default. Set this option to `false` if you don't want to trim.
|
||||
|
||||
@default true
|
||||
*/
|
||||
readonly trim?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
Wrap words to the specified column width.
|
||||
|
||||
@param string - String with ANSI escape codes. Like one styled by [`chalk`](https://github.com/chalk/chalk). Newline characters will be normalized to `\n`.
|
||||
@param columns - Number of columns to wrap the text to.
|
||||
|
||||
@example
|
||||
```
|
||||
import chalk from 'chalk';
|
||||
import wrapAnsi from 'wrap-ansi';
|
||||
|
||||
const input = 'The quick brown ' + chalk.red('fox jumped over ') +
|
||||
'the lazy ' + chalk.green('dog and then ran away with the unicorn.');
|
||||
|
||||
console.log(wrapAnsi(input, 20));
|
||||
```
|
||||
*/
|
||||
export default function wrapAnsi(string: string, columns: number, options?: Options): string;
|
||||
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "esbuild",
|
||||
"version": "0.9.7",
|
||||
"description": "An extremely fast JavaScript bundler and minifier.",
|
||||
"repository": "https://github.com/evanw/esbuild",
|
||||
"scripts": {
|
||||
"postinstall": "node install.js"
|
||||
},
|
||||
"main": "lib/main.js",
|
||||
"types": "lib/main.d.ts",
|
||||
"bin": {
|
||||
"esbuild": "bin/esbuild"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
|
||||
|
||||
if ($gOPD) {
|
||||
try {
|
||||
$gOPD([], 'length');
|
||||
} catch (e) {
|
||||
// IE 8 has a broken gOPD
|
||||
$gOPD = null;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = $gOPD;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"M N O","2":"C K L","516":"G","1025":"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":"VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB EC FC","194":"SB TB UB"},D:{"1":"YB uB ZB vB aB bB cB","2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB","516":"RB SB TB UB VB WB XB","1025":"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"},E:{"1":"K L G rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E F A B C HC zB IC JC KC LC 0B qB"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB","2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB PC QC RC SC qB AC TC rB","516":"EB FB GB HB IB JB KB","1025":"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"},G:{"1":"gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC"},H:{"2":"oC"},I:{"2":"tB I pC qC rC sC BC tC uC","1025":"f"},J:{"2":"D A"},K:{"2":"A B C qB AC rB","1025":"h"},L:{"1":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"g yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I","516":"wC xC"},Q:{"1025":"1B"},R:{"1":"9C"},S:{"1":"BD","2":"AD"}},B:5,C:"IntersectionObserver"};
|
||||
@@ -0,0 +1,351 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.keccakprg = exports.m14 = exports.k12 = exports.parallelhash256xof = exports.parallelhash128xof = exports.parallelhash256 = exports.parallelhash128 = exports.tuplehash256xof = exports.tuplehash128xof = exports.tuplehash256 = exports.tuplehash128 = exports.kmac256xof = exports.kmac128xof = exports.kmac256 = exports.kmac128 = exports.cshake256 = exports.cshake128 = void 0;
|
||||
const _assert_js_1 = require("./_assert.js");
|
||||
const utils_js_1 = require("./utils.js");
|
||||
const sha3_js_1 = require("./sha3.js");
|
||||
// cSHAKE && KMAC (NIST SP800-185)
|
||||
function leftEncode(n) {
|
||||
const res = [n & 0xff];
|
||||
n >>= 8;
|
||||
for (; n > 0; n >>= 8)
|
||||
res.unshift(n & 0xff);
|
||||
res.unshift(res.length);
|
||||
return new Uint8Array(res);
|
||||
}
|
||||
function rightEncode(n) {
|
||||
const res = [n & 0xff];
|
||||
n >>= 8;
|
||||
for (; n > 0; n >>= 8)
|
||||
res.unshift(n & 0xff);
|
||||
res.push(res.length);
|
||||
return new Uint8Array(res);
|
||||
}
|
||||
function chooseLen(opts, outputLen) {
|
||||
return opts.dkLen === undefined ? outputLen : opts.dkLen;
|
||||
}
|
||||
const toBytesOptional = (buf) => (buf !== undefined ? (0, utils_js_1.toBytes)(buf) : new Uint8Array([]));
|
||||
// NOTE: second modulo is necessary since we don't need to add padding if current element takes whole block
|
||||
const getPadding = (len, block) => new Uint8Array((block - (len % block)) % block);
|
||||
// Personalization
|
||||
function cshakePers(hash, opts = {}) {
|
||||
if (!opts || (!opts.personalization && !opts.NISTfn))
|
||||
return hash;
|
||||
// Encode and pad inplace to avoid unneccesary memory copies/slices (so we don't need to zero them later)
|
||||
// bytepad(encode_string(N) || encode_string(S), 168)
|
||||
const blockLenBytes = leftEncode(hash.blockLen);
|
||||
const fn = toBytesOptional(opts.NISTfn);
|
||||
const fnLen = leftEncode(8 * fn.length); // length in bits
|
||||
const pers = toBytesOptional(opts.personalization);
|
||||
const persLen = leftEncode(8 * pers.length); // length in bits
|
||||
if (!fn.length && !pers.length)
|
||||
return hash;
|
||||
hash.suffix = 0x04;
|
||||
hash.update(blockLenBytes).update(fnLen).update(fn).update(persLen).update(pers);
|
||||
let totalLen = blockLenBytes.length + fnLen.length + fn.length + persLen.length + pers.length;
|
||||
hash.update(getPadding(totalLen, hash.blockLen));
|
||||
return hash;
|
||||
}
|
||||
const gencShake = (suffix, blockLen, outputLen) => (0, utils_js_1.wrapConstructorWithOpts)((opts = {}) => cshakePers(new sha3_js_1.Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts));
|
||||
exports.cshake128 = gencShake(0x1f, 168, 128 / 8);
|
||||
exports.cshake256 = gencShake(0x1f, 136, 256 / 8);
|
||||
class KMAC extends sha3_js_1.Keccak {
|
||||
constructor(blockLen, outputLen, enableXOF, key, opts = {}) {
|
||||
super(blockLen, 0x1f, outputLen, enableXOF);
|
||||
cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization });
|
||||
key = (0, utils_js_1.toBytes)(key);
|
||||
// 1. newX = bytepad(encode_string(K), 168) || X || right_encode(L).
|
||||
const blockLenBytes = leftEncode(this.blockLen);
|
||||
const keyLen = leftEncode(8 * key.length);
|
||||
this.update(blockLenBytes).update(keyLen).update(key);
|
||||
const totalLen = blockLenBytes.length + keyLen.length + key.length;
|
||||
this.update(getPadding(totalLen, this.blockLen));
|
||||
}
|
||||
finish() {
|
||||
if (!this.finished)
|
||||
this.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits
|
||||
super.finish();
|
||||
}
|
||||
_cloneInto(to) {
|
||||
// Create new instance without calling constructor since key already in state and we don't know it.
|
||||
// Force "to" to be instance of KMAC instead of Sha3.
|
||||
if (!to) {
|
||||
to = Object.create(Object.getPrototypeOf(this), {});
|
||||
to.state = this.state.slice();
|
||||
to.blockLen = this.blockLen;
|
||||
to.state32 = (0, utils_js_1.u32)(to.state);
|
||||
}
|
||||
return super._cloneInto(to);
|
||||
}
|
||||
clone() {
|
||||
return this._cloneInto();
|
||||
}
|
||||
}
|
||||
function genKmac(blockLen, outputLen, xof = false) {
|
||||
const kmac = (key, message, opts) => kmac.create(key, opts).update(message).digest();
|
||||
kmac.create = (key, opts = {}) => new KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts);
|
||||
return kmac;
|
||||
}
|
||||
exports.kmac128 = genKmac(168, 128 / 8);
|
||||
exports.kmac256 = genKmac(136, 256 / 8);
|
||||
exports.kmac128xof = genKmac(168, 128 / 8, true);
|
||||
exports.kmac256xof = genKmac(136, 256 / 8, true);
|
||||
// TupleHash
|
||||
// Usage: tuple(['ab', 'cd']) != tuple(['a', 'bcd'])
|
||||
class TupleHash extends sha3_js_1.Keccak {
|
||||
constructor(blockLen, outputLen, enableXOF, opts = {}) {
|
||||
super(blockLen, 0x1f, outputLen, enableXOF);
|
||||
cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization });
|
||||
// Change update after cshake processed
|
||||
this.update = (data) => {
|
||||
data = (0, utils_js_1.toBytes)(data);
|
||||
super.update(leftEncode(data.length * 8));
|
||||
super.update(data);
|
||||
return this;
|
||||
};
|
||||
}
|
||||
finish() {
|
||||
if (!this.finished)
|
||||
super.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits
|
||||
super.finish();
|
||||
}
|
||||
_cloneInto(to) {
|
||||
to || (to = new TupleHash(this.blockLen, this.outputLen, this.enableXOF));
|
||||
return super._cloneInto(to);
|
||||
}
|
||||
clone() {
|
||||
return this._cloneInto();
|
||||
}
|
||||
}
|
||||
function genTuple(blockLen, outputLen, xof = false) {
|
||||
const tuple = (messages, opts) => {
|
||||
const h = tuple.create(opts);
|
||||
for (const msg of messages)
|
||||
h.update(msg);
|
||||
return h.digest();
|
||||
};
|
||||
tuple.create = (opts = {}) => new TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts);
|
||||
return tuple;
|
||||
}
|
||||
exports.tuplehash128 = genTuple(168, 128 / 8);
|
||||
exports.tuplehash256 = genTuple(136, 256 / 8);
|
||||
exports.tuplehash128xof = genTuple(168, 128 / 8, true);
|
||||
exports.tuplehash256xof = genTuple(136, 256 / 8, true);
|
||||
class ParallelHash extends sha3_js_1.Keccak {
|
||||
constructor(blockLen, outputLen, leafCons, enableXOF, opts = {}) {
|
||||
super(blockLen, 0x1f, outputLen, enableXOF);
|
||||
this.leafCons = leafCons;
|
||||
this.chunkPos = 0; // Position of current block in chunk
|
||||
this.chunksDone = 0; // How many chunks we already have
|
||||
cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization });
|
||||
let { blockLen: B } = opts;
|
||||
B || (B = 8);
|
||||
(0, _assert_js_1.number)(B);
|
||||
this.chunkLen = B;
|
||||
super.update(leftEncode(B));
|
||||
// Change update after cshake processed
|
||||
this.update = (data) => {
|
||||
data = (0, utils_js_1.toBytes)(data);
|
||||
const { chunkLen, leafCons } = this;
|
||||
for (let pos = 0, len = data.length; pos < len;) {
|
||||
if (this.chunkPos == chunkLen || !this.leafHash) {
|
||||
if (this.leafHash) {
|
||||
super.update(this.leafHash.digest());
|
||||
this.chunksDone++;
|
||||
}
|
||||
this.leafHash = leafCons();
|
||||
this.chunkPos = 0;
|
||||
}
|
||||
const take = Math.min(chunkLen - this.chunkPos, len - pos);
|
||||
this.leafHash.update(data.subarray(pos, pos + take));
|
||||
this.chunkPos += take;
|
||||
pos += take;
|
||||
}
|
||||
return this;
|
||||
};
|
||||
}
|
||||
finish() {
|
||||
if (this.finished)
|
||||
return;
|
||||
if (this.leafHash) {
|
||||
super.update(this.leafHash.digest());
|
||||
this.chunksDone++;
|
||||
}
|
||||
super.update(rightEncode(this.chunksDone));
|
||||
super.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits
|
||||
super.finish();
|
||||
}
|
||||
_cloneInto(to) {
|
||||
to || (to = new ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF));
|
||||
if (this.leafHash)
|
||||
to.leafHash = this.leafHash._cloneInto(to.leafHash);
|
||||
to.chunkPos = this.chunkPos;
|
||||
to.chunkLen = this.chunkLen;
|
||||
to.chunksDone = this.chunksDone;
|
||||
return super._cloneInto(to);
|
||||
}
|
||||
destroy() {
|
||||
super.destroy.call(this);
|
||||
if (this.leafHash)
|
||||
this.leafHash.destroy();
|
||||
}
|
||||
clone() {
|
||||
return this._cloneInto();
|
||||
}
|
||||
}
|
||||
function genParallel(blockLen, outputLen, leaf, xof = false) {
|
||||
const parallel = (message, opts) => parallel.create(opts).update(message).digest();
|
||||
parallel.create = (opts = {}) => new ParallelHash(blockLen, chooseLen(opts, outputLen), () => leaf.create({ dkLen: 2 * outputLen }), xof, opts);
|
||||
return parallel;
|
||||
}
|
||||
exports.parallelhash128 = genParallel(168, 128 / 8, exports.cshake128);
|
||||
exports.parallelhash256 = genParallel(136, 256 / 8, exports.cshake256);
|
||||
exports.parallelhash128xof = genParallel(168, 128 / 8, exports.cshake128, true);
|
||||
exports.parallelhash256xof = genParallel(136, 256 / 8, exports.cshake256, true);
|
||||
// Kangaroo
|
||||
// Same as NIST rightEncode, but returns [0] for zero string
|
||||
function rightEncodeK12(n) {
|
||||
const res = [];
|
||||
for (; n > 0; n >>= 8)
|
||||
res.unshift(n & 0xff);
|
||||
res.push(res.length);
|
||||
return new Uint8Array(res);
|
||||
}
|
||||
const EMPTY = new Uint8Array([]);
|
||||
class KangarooTwelve extends sha3_js_1.Keccak {
|
||||
constructor(blockLen, leafLen, outputLen, rounds, opts) {
|
||||
super(blockLen, 0x07, outputLen, true, rounds);
|
||||
this.leafLen = leafLen;
|
||||
this.chunkLen = 8192;
|
||||
this.chunkPos = 0; // Position of current block in chunk
|
||||
this.chunksDone = 0; // How many chunks we already have
|
||||
const { personalization } = opts;
|
||||
this.personalization = toBytesOptional(personalization);
|
||||
}
|
||||
update(data) {
|
||||
data = (0, utils_js_1.toBytes)(data);
|
||||
const { chunkLen, blockLen, leafLen, rounds } = this;
|
||||
for (let pos = 0, len = data.length; pos < len;) {
|
||||
if (this.chunkPos == chunkLen) {
|
||||
if (this.leafHash)
|
||||
super.update(this.leafHash.digest());
|
||||
else {
|
||||
this.suffix = 0x06; // Its safe to change suffix here since its used only in digest()
|
||||
super.update(new Uint8Array([3, 0, 0, 0, 0, 0, 0, 0]));
|
||||
}
|
||||
this.leafHash = new sha3_js_1.Keccak(blockLen, 0x0b, leafLen, false, rounds);
|
||||
this.chunksDone++;
|
||||
this.chunkPos = 0;
|
||||
}
|
||||
const take = Math.min(chunkLen - this.chunkPos, len - pos);
|
||||
const chunk = data.subarray(pos, pos + take);
|
||||
if (this.leafHash)
|
||||
this.leafHash.update(chunk);
|
||||
else
|
||||
super.update(chunk);
|
||||
this.chunkPos += take;
|
||||
pos += take;
|
||||
}
|
||||
return this;
|
||||
}
|
||||
finish() {
|
||||
if (this.finished)
|
||||
return;
|
||||
const { personalization } = this;
|
||||
this.update(personalization).update(rightEncodeK12(personalization.length));
|
||||
// Leaf hash
|
||||
if (this.leafHash) {
|
||||
super.update(this.leafHash.digest());
|
||||
super.update(rightEncodeK12(this.chunksDone));
|
||||
super.update(new Uint8Array([0xff, 0xff]));
|
||||
}
|
||||
super.finish.call(this);
|
||||
}
|
||||
destroy() {
|
||||
super.destroy.call(this);
|
||||
if (this.leafHash)
|
||||
this.leafHash.destroy();
|
||||
// We cannot zero personalization buffer since it is user provided and we don't want to mutate user input
|
||||
this.personalization = EMPTY;
|
||||
}
|
||||
_cloneInto(to) {
|
||||
const { blockLen, leafLen, leafHash, outputLen, rounds } = this;
|
||||
to || (to = new KangarooTwelve(blockLen, leafLen, outputLen, rounds, {}));
|
||||
super._cloneInto(to);
|
||||
if (leafHash)
|
||||
to.leafHash = leafHash._cloneInto(to.leafHash);
|
||||
to.personalization.set(this.personalization);
|
||||
to.leafLen = this.leafLen;
|
||||
to.chunkPos = this.chunkPos;
|
||||
to.chunksDone = this.chunksDone;
|
||||
return to;
|
||||
}
|
||||
clone() {
|
||||
return this._cloneInto();
|
||||
}
|
||||
}
|
||||
// Default to 32 bytes, so it can be used without opts
|
||||
exports.k12 = (0, utils_js_1.wrapConstructorWithOpts)((opts = {}) => new KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts));
|
||||
// MarsupilamiFourteen
|
||||
exports.m14 = (0, utils_js_1.wrapConstructorWithOpts)((opts = {}) => new KangarooTwelve(136, 64, chooseLen(opts, 64), 14, opts));
|
||||
// https://keccak.team/files/CSF-0.1.pdf
|
||||
// + https://github.com/XKCP/XKCP/tree/master/lib/high/Keccak/PRG
|
||||
class KeccakPRG extends sha3_js_1.Keccak {
|
||||
constructor(capacity) {
|
||||
(0, _assert_js_1.number)(capacity);
|
||||
// Rho should be full bytes
|
||||
if (capacity < 0 || capacity > 1600 - 10 || (1600 - capacity - 2) % 8)
|
||||
throw new Error('KeccakPRG: Invalid capacity');
|
||||
// blockLen = rho in bytes
|
||||
super((1600 - capacity - 2) / 8, 0, 0, true);
|
||||
this.rate = 1600 - capacity;
|
||||
this.posOut = Math.floor((this.rate + 7) / 8);
|
||||
}
|
||||
keccak() {
|
||||
// Duplex padding
|
||||
this.state[this.pos] ^= 0x01;
|
||||
this.state[this.blockLen] ^= 0x02; // Rho is full bytes
|
||||
super.keccak();
|
||||
this.pos = 0;
|
||||
this.posOut = 0;
|
||||
}
|
||||
update(data) {
|
||||
super.update(data);
|
||||
this.posOut = this.blockLen;
|
||||
return this;
|
||||
}
|
||||
feed(data) {
|
||||
return this.update(data);
|
||||
}
|
||||
finish() { }
|
||||
digestInto(out) {
|
||||
throw new Error('KeccakPRG: digest is not allowed, please use .fetch instead.');
|
||||
}
|
||||
fetch(bytes) {
|
||||
return this.xof(bytes);
|
||||
}
|
||||
// Ensure irreversibility (even if state leaked previous outputs cannot be computed)
|
||||
forget() {
|
||||
if (this.rate < 1600 / 2 + 1)
|
||||
throw new Error('KeccakPRG: rate too low to use forget');
|
||||
this.keccak();
|
||||
for (let i = 0; i < this.blockLen; i++)
|
||||
this.state[i] = 0;
|
||||
this.pos = this.blockLen;
|
||||
this.keccak();
|
||||
this.posOut = this.blockLen;
|
||||
}
|
||||
_cloneInto(to) {
|
||||
const { rate } = this;
|
||||
to || (to = new KeccakPRG(1600 - rate));
|
||||
super._cloneInto(to);
|
||||
to.rate = rate;
|
||||
return to;
|
||||
}
|
||||
clone() {
|
||||
return this._cloneInto();
|
||||
}
|
||||
}
|
||||
const keccakprg = (capacity = 254) => new KeccakPRG(capacity);
|
||||
exports.keccakprg = keccakprg;
|
||||
//# sourceMappingURL=sha3-addons.js.map
|
||||
@@ -0,0 +1,18 @@
|
||||
var isKeyable = require('./_isKeyable');
|
||||
|
||||
/**
|
||||
* Gets the data for `map`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} map The map to query.
|
||||
* @param {string} key The reference key.
|
||||
* @returns {*} Returns the map data.
|
||||
*/
|
||||
function getMapData(map, key) {
|
||||
var data = map.__data__;
|
||||
return isKeyable(key)
|
||||
? data[typeof key == 'string' ? 'string' : 'hash']
|
||||
: data.map;
|
||||
}
|
||||
|
||||
module.exports = getMapData;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"concatAll.js","sourceRoot":"","sources":["../../../../src/internal/operators/concatAll.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AA2DtC,SAAgB,SAAS;IACvB,OAAO,mBAAQ,CAAC,CAAC,CAAC,CAAC;AACrB,CAAC;AAFD,8BAEC"}
|
||||
@@ -0,0 +1,8 @@
|
||||
import assertString from './util/assertString'; // from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
||||
|
||||
var validISO31661Alpha2CountriesCodes = new Set(['AD', 'AE', 'AF', 'AG', 'AI', 'AL', 'AM', 'AO', 'AQ', 'AR', 'AS', 'AT', 'AU', 'AW', 'AX', 'AZ', 'BA', 'BB', 'BD', 'BE', 'BF', 'BG', 'BH', 'BI', 'BJ', 'BL', 'BM', 'BN', 'BO', 'BQ', 'BR', 'BS', 'BT', 'BV', 'BW', 'BY', 'BZ', 'CA', 'CC', 'CD', 'CF', 'CG', 'CH', 'CI', 'CK', 'CL', 'CM', 'CN', 'CO', 'CR', 'CU', 'CV', 'CW', 'CX', 'CY', 'CZ', 'DE', 'DJ', 'DK', 'DM', 'DO', 'DZ', 'EC', 'EE', 'EG', 'EH', 'ER', 'ES', 'ET', 'FI', 'FJ', 'FK', 'FM', 'FO', 'FR', 'GA', 'GB', 'GD', 'GE', 'GF', 'GG', 'GH', 'GI', 'GL', 'GM', 'GN', 'GP', 'GQ', 'GR', 'GS', 'GT', 'GU', 'GW', 'GY', 'HK', 'HM', 'HN', 'HR', 'HT', 'HU', 'ID', 'IE', 'IL', 'IM', 'IN', 'IO', 'IQ', 'IR', 'IS', 'IT', 'JE', 'JM', 'JO', 'JP', 'KE', 'KG', 'KH', 'KI', 'KM', 'KN', 'KP', 'KR', 'KW', 'KY', 'KZ', 'LA', 'LB', 'LC', 'LI', 'LK', 'LR', 'LS', 'LT', 'LU', 'LV', 'LY', 'MA', 'MC', 'MD', 'ME', 'MF', 'MG', 'MH', 'MK', 'ML', 'MM', 'MN', 'MO', 'MP', 'MQ', 'MR', 'MS', 'MT', 'MU', 'MV', 'MW', 'MX', 'MY', 'MZ', 'NA', 'NC', 'NE', 'NF', 'NG', 'NI', 'NL', 'NO', 'NP', 'NR', 'NU', 'NZ', 'OM', 'PA', 'PE', 'PF', 'PG', 'PH', 'PK', 'PL', 'PM', 'PN', 'PR', 'PS', 'PT', 'PW', 'PY', 'QA', 'RE', 'RO', 'RS', 'RU', 'RW', 'SA', 'SB', 'SC', 'SD', 'SE', 'SG', 'SH', 'SI', 'SJ', 'SK', 'SL', 'SM', 'SN', 'SO', 'SR', 'SS', 'ST', 'SV', 'SX', 'SY', 'SZ', 'TC', 'TD', 'TF', 'TG', 'TH', 'TJ', 'TK', 'TL', 'TM', 'TN', 'TO', 'TR', 'TT', 'TV', 'TW', 'TZ', 'UA', 'UG', 'UM', 'US', 'UY', 'UZ', 'VA', 'VC', 'VE', 'VG', 'VI', 'VN', 'VU', 'WF', 'WS', 'YE', 'YT', 'ZA', 'ZM', 'ZW']);
|
||||
export default function isISO31661Alpha2(str) {
|
||||
assertString(str);
|
||||
return validISO31661Alpha2CountriesCodes.has(str.toUpperCase());
|
||||
}
|
||||
export var CountryCodes = validISO31661Alpha2CountriesCodes;
|
||||
@@ -0,0 +1,110 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createNumberElement = exports.createLiteralElement = exports.isDateTimeSkeleton = exports.isNumberSkeleton = exports.isTagElement = exports.isPoundElement = exports.isPluralElement = exports.isSelectElement = exports.isTimeElement = exports.isDateElement = exports.isNumberElement = exports.isArgumentElement = exports.isLiteralElement = exports.SKELETON_TYPE = exports.TYPE = void 0;
|
||||
var TYPE;
|
||||
(function (TYPE) {
|
||||
/**
|
||||
* Raw text
|
||||
*/
|
||||
TYPE[TYPE["literal"] = 0] = "literal";
|
||||
/**
|
||||
* Variable w/o any format, e.g `var` in `this is a {var}`
|
||||
*/
|
||||
TYPE[TYPE["argument"] = 1] = "argument";
|
||||
/**
|
||||
* Variable w/ number format
|
||||
*/
|
||||
TYPE[TYPE["number"] = 2] = "number";
|
||||
/**
|
||||
* Variable w/ date format
|
||||
*/
|
||||
TYPE[TYPE["date"] = 3] = "date";
|
||||
/**
|
||||
* Variable w/ time format
|
||||
*/
|
||||
TYPE[TYPE["time"] = 4] = "time";
|
||||
/**
|
||||
* Variable w/ select format
|
||||
*/
|
||||
TYPE[TYPE["select"] = 5] = "select";
|
||||
/**
|
||||
* Variable w/ plural format
|
||||
*/
|
||||
TYPE[TYPE["plural"] = 6] = "plural";
|
||||
/**
|
||||
* Only possible within plural argument.
|
||||
* This is the `#` symbol that will be substituted with the count.
|
||||
*/
|
||||
TYPE[TYPE["pound"] = 7] = "pound";
|
||||
/**
|
||||
* XML-like tag
|
||||
*/
|
||||
TYPE[TYPE["tag"] = 8] = "tag";
|
||||
})(TYPE = exports.TYPE || (exports.TYPE = {}));
|
||||
var SKELETON_TYPE;
|
||||
(function (SKELETON_TYPE) {
|
||||
SKELETON_TYPE[SKELETON_TYPE["number"] = 0] = "number";
|
||||
SKELETON_TYPE[SKELETON_TYPE["dateTime"] = 1] = "dateTime";
|
||||
})(SKELETON_TYPE = exports.SKELETON_TYPE || (exports.SKELETON_TYPE = {}));
|
||||
/**
|
||||
* Type Guards
|
||||
*/
|
||||
function isLiteralElement(el) {
|
||||
return el.type === TYPE.literal;
|
||||
}
|
||||
exports.isLiteralElement = isLiteralElement;
|
||||
function isArgumentElement(el) {
|
||||
return el.type === TYPE.argument;
|
||||
}
|
||||
exports.isArgumentElement = isArgumentElement;
|
||||
function isNumberElement(el) {
|
||||
return el.type === TYPE.number;
|
||||
}
|
||||
exports.isNumberElement = isNumberElement;
|
||||
function isDateElement(el) {
|
||||
return el.type === TYPE.date;
|
||||
}
|
||||
exports.isDateElement = isDateElement;
|
||||
function isTimeElement(el) {
|
||||
return el.type === TYPE.time;
|
||||
}
|
||||
exports.isTimeElement = isTimeElement;
|
||||
function isSelectElement(el) {
|
||||
return el.type === TYPE.select;
|
||||
}
|
||||
exports.isSelectElement = isSelectElement;
|
||||
function isPluralElement(el) {
|
||||
return el.type === TYPE.plural;
|
||||
}
|
||||
exports.isPluralElement = isPluralElement;
|
||||
function isPoundElement(el) {
|
||||
return el.type === TYPE.pound;
|
||||
}
|
||||
exports.isPoundElement = isPoundElement;
|
||||
function isTagElement(el) {
|
||||
return el.type === TYPE.tag;
|
||||
}
|
||||
exports.isTagElement = isTagElement;
|
||||
function isNumberSkeleton(el) {
|
||||
return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);
|
||||
}
|
||||
exports.isNumberSkeleton = isNumberSkeleton;
|
||||
function isDateTimeSkeleton(el) {
|
||||
return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);
|
||||
}
|
||||
exports.isDateTimeSkeleton = isDateTimeSkeleton;
|
||||
function createLiteralElement(value) {
|
||||
return {
|
||||
type: TYPE.literal,
|
||||
value: value,
|
||||
};
|
||||
}
|
||||
exports.createLiteralElement = createLiteralElement;
|
||||
function createNumberElement(value, style) {
|
||||
return {
|
||||
type: TYPE.number,
|
||||
value: value,
|
||||
style: style,
|
||||
};
|
||||
}
|
||||
exports.createNumberElement = createNumberElement;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"timeoutProvider.js","sourceRoot":"","sources":["../../../../src/internal/scheduler/timeoutProvider.ts"],"names":[],"mappings":";AAeA,MAAM,CAAC,IAAM,eAAe,GAAoB;IAG9C,UAAU,EAAV,UAAW,OAAmB,EAAE,OAAgB;QAAE,cAAO;aAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;YAAP,6BAAO;;QAC/C,IAAA,QAAQ,GAAK,eAAe,SAApB,CAAqB;QACrC,IAAI,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,EAAE;YACxB,OAAO,QAAQ,CAAC,UAAU,OAAnB,QAAQ,iBAAY,OAAO,EAAE,OAAO,UAAK,IAAI,IAAE;SACvD;QACD,OAAO,UAAU,8BAAC,OAAO,EAAE,OAAO,UAAK,IAAI,IAAE;IAC/C,CAAC;IACD,YAAY,EAAZ,UAAa,MAAM;QACT,IAAA,QAAQ,GAAK,eAAe,SAApB,CAAqB;QACrC,OAAO,CAAC,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,YAAY,KAAI,YAAY,CAAC,CAAC,MAAa,CAAC,CAAC;IACjE,CAAC;IACD,QAAQ,EAAE,SAAS;CACpB,CAAC"}
|
||||
@@ -0,0 +1,103 @@
|
||||
2.0.0 / 2018-10-26
|
||||
==================
|
||||
|
||||
* Drop support for Node.js 0.6
|
||||
* Replace internal `eval` usage with `Function` constructor
|
||||
* Use instance methods on `process` to check for listeners
|
||||
|
||||
1.1.2 / 2018-01-11
|
||||
==================
|
||||
|
||||
* perf: remove argument reassignment
|
||||
* Support Node.js 0.6 to 9.x
|
||||
|
||||
1.1.1 / 2017-07-27
|
||||
==================
|
||||
|
||||
* Remove unnecessary `Buffer` loading
|
||||
* Support Node.js 0.6 to 8.x
|
||||
|
||||
1.1.0 / 2015-09-14
|
||||
==================
|
||||
|
||||
* Enable strict mode in more places
|
||||
* Support io.js 3.x
|
||||
* Support io.js 2.x
|
||||
* Support web browser loading
|
||||
- Requires bundler like Browserify or webpack
|
||||
|
||||
1.0.1 / 2015-04-07
|
||||
==================
|
||||
|
||||
* Fix `TypeError`s when under `'use strict'` code
|
||||
* Fix useless type name on auto-generated messages
|
||||
* Support io.js 1.x
|
||||
* Support Node.js 0.12
|
||||
|
||||
1.0.0 / 2014-09-17
|
||||
==================
|
||||
|
||||
* No changes
|
||||
|
||||
0.4.5 / 2014-09-09
|
||||
==================
|
||||
|
||||
* Improve call speed to functions using the function wrapper
|
||||
* Support Node.js 0.6
|
||||
|
||||
0.4.4 / 2014-07-27
|
||||
==================
|
||||
|
||||
* Work-around v8 generating empty stack traces
|
||||
|
||||
0.4.3 / 2014-07-26
|
||||
==================
|
||||
|
||||
* Fix exception when global `Error.stackTraceLimit` is too low
|
||||
|
||||
0.4.2 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Correct call site for wrapped functions and properties
|
||||
|
||||
0.4.1 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Improve automatic message generation for function properties
|
||||
|
||||
0.4.0 / 2014-07-19
|
||||
==================
|
||||
|
||||
* Add `TRACE_DEPRECATION` environment variable
|
||||
* Remove non-standard grey color from color output
|
||||
* Support `--no-deprecation` argument
|
||||
* Support `--trace-deprecation` argument
|
||||
* Support `deprecate.property(fn, prop, message)`
|
||||
|
||||
0.3.0 / 2014-06-16
|
||||
==================
|
||||
|
||||
* Add `NO_DEPRECATION` environment variable
|
||||
|
||||
0.2.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Add `deprecate.property(obj, prop, message)`
|
||||
* Remove `supports-color` dependency for node.js 0.8
|
||||
|
||||
0.1.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Add `deprecate.function(fn, message)`
|
||||
* Add `process.on('deprecation', fn)` emitter
|
||||
* Automatically generate message when omitted from `deprecate()`
|
||||
|
||||
0.0.1 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Fix warning for dynamic calls at singe call site
|
||||
|
||||
0.0.0 / 2014-06-15
|
||||
==================
|
||||
|
||||
* Initial implementation
|
||||
@@ -0,0 +1,32 @@
|
||||
var basePullAll = require('./_basePullAll');
|
||||
|
||||
/**
|
||||
* This method is like `_.pullAll` except that it accepts `comparator` which
|
||||
* is invoked to compare elements of `array` to `values`. The comparator is
|
||||
* invoked with two arguments: (arrVal, othVal).
|
||||
*
|
||||
* **Note:** Unlike `_.differenceWith`, this method mutates `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.6.0
|
||||
* @category Array
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {Array} values The values to remove.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns `array`.
|
||||
* @example
|
||||
*
|
||||
* var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];
|
||||
*
|
||||
* _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);
|
||||
* console.log(array);
|
||||
* // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]
|
||||
*/
|
||||
function pullAllWith(array, values, comparator) {
|
||||
return (array && array.length && values && values.length)
|
||||
? basePullAll(array, values, undefined, comparator)
|
||||
: array;
|
||||
}
|
||||
|
||||
module.exports = pullAllWith;
|
||||
@@ -0,0 +1,38 @@
|
||||
"use strict";
|
||||
|
||||
var isValue = require("../object/is-value")
|
||||
, toNaturalNumber = require("../number/to-pos-integer");
|
||||
|
||||
var generated = Object.create(null), random = Math.random, uniqTryLimit = 100;
|
||||
|
||||
var getChunk = function () { return random().toString(36).slice(2); };
|
||||
|
||||
var getString = function (/* length */) {
|
||||
var str = getChunk(), length = arguments[0];
|
||||
if (!isValue(length)) return str;
|
||||
while (str.length < length) str += getChunk();
|
||||
return str.slice(0, length);
|
||||
};
|
||||
|
||||
module.exports = function (/* options */) {
|
||||
var options = Object(arguments[0]), length = options.length, isUnique = options.isUnique;
|
||||
|
||||
if (isValue(length)) length = toNaturalNumber(length);
|
||||
|
||||
var str = getString(length);
|
||||
if (isUnique) {
|
||||
var count = 0;
|
||||
while (generated[str]) {
|
||||
if (++count === uniqTryLimit) {
|
||||
throw new Error(
|
||||
"Cannot generate random string.\n" +
|
||||
"String.random is not designed to effectively generate many short and " +
|
||||
"unique random strings"
|
||||
);
|
||||
}
|
||||
str = getString(length);
|
||||
}
|
||||
generated[str] = true;
|
||||
}
|
||||
return str;
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
require('a');
|
||||
require('b');
|
||||
require('c' + x);
|
||||
var moo = require('d' + y).moo;
|
||||
@@ -0,0 +1,26 @@
|
||||
var createRound = require('./_createRound');
|
||||
|
||||
/**
|
||||
* Computes `number` rounded down to `precision`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.10.0
|
||||
* @category Math
|
||||
* @param {number} number The number to round down.
|
||||
* @param {number} [precision=0] The precision to round down to.
|
||||
* @returns {number} Returns the rounded down number.
|
||||
* @example
|
||||
*
|
||||
* _.floor(4.006);
|
||||
* // => 4
|
||||
*
|
||||
* _.floor(0.046, 2);
|
||||
* // => 0.04
|
||||
*
|
||||
* _.floor(4060, -2);
|
||||
* // => 4000
|
||||
*/
|
||||
var floor = createRound('floor');
|
||||
|
||||
module.exports = floor;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/common/util.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAM,gBAAiB,SAAQ,KAAK;IAClC,YACE,OAAe,EACR,OAAqD;QAE5D,KAAK,CAAC,OAAO,CAAC,CAAC;QAFR,YAAO,GAAP,OAAO,CAA8C;IAG9D,CAAC;CACF;AAuBuB,4CAAgB;AArBxC;;;GAGG;AACH,SAAS,YAAY,CAAC,KAAgB;IACpC,KAAK,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE;QACzC,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAC9C,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7C;AACH,CAAC;AAYyC,oCAAY"}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"pify","version":"2.3.0","files":{"license":{"checkedAt":1678883668052,"integrity":"sha512-rnnnpCCaRRrva3j3sLiBcOeiIzUSasNFUiv06v4IGNpYZarhUHxdwCJO+FRUjHId+ahDcYIvNtUMvNl/qUbu6Q==","mode":420,"size":1119},"package.json":{"checkedAt":1678883673199,"integrity":"sha512-3F3LpzPyzggSLdaJd9qUlfS4evtU1OGVjO+uqrzqUUJYNAllLFqJXE5QgroxuEHlQCRlD2pGSg3gXvCQcX3hkg==","mode":420,"size":890},"index.js":{"checkedAt":1678883673199,"integrity":"sha512-PmJpKPZgShzXtOS7WjsCEwkdp1juVItUbgU5GIP6OV6rPySZ6gPmvGvx7BPWMCWAt6niGQ1ik0i0RYjKrGEn5g==","mode":420,"size":1432},"readme.md":{"checkedAt":1678883673199,"integrity":"sha512-ILzQhj8FHObq92P2TmAmUK4c3bMvj9ukqCTS675EwFqybYIrHHzrCWCBUddxtUr9dnHvT92hVUrwBaBkkKhlDw==","mode":420,"size":2579}}}
|
||||
@@ -0,0 +1,9 @@
|
||||
import { Subscriber } from './Subscriber';
|
||||
import { TeardownLogic } from './types';
|
||||
/***
|
||||
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
|
||||
*/
|
||||
export interface Operator<T, R> {
|
||||
call(subscriber: Subscriber<R>, source: any): TeardownLogic;
|
||||
}
|
||||
//# sourceMappingURL=Operator.d.ts.map
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('isMatchWith', require('../isMatchWith'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0.10962,"110":0.05116,"111":0,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0.00731,"73":0,"74":0,"75":0.16078,"76":2.29471,"77":0.2704,"78":0,"79":0.10962,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0.02192,"89":0,"90":0,"91":0,"92":0.01462,"93":0.87696,"94":0.01462,"95":0,"96":0.07308,"97":0,"98":0,"99":0,"100":0.01462,"101":0,"102":0.02923,"103":1.732,"104":0.00731,"105":0.095,"106":0.00731,"107":0.07308,"108":2.99628,"109":12.43091,"110":3.60284,"111":0.00731,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00731,"93":0,"94":0.01462,"95":0.00731,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0.00731,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0.00731,"100":0,"101":0,"102":0,"103":0.00731,"104":0,"105":0,"106":0,"107":0.02923,"108":0.01462,"109":1.22044,"110":1.63699},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.05846,"14":0.04385,"15":0.00731,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0.00731,"12.1":0.05846,"13.1":0.13154,"14.1":0.54079,"15.1":5.91217,"15.2-15.3":0.65772,"15.4":0.60656,"15.5":0.59195,"15.6":4.45788,"16.0":0.39463,"16.1":2.23625,"16.2":4.90367,"16.3":2.25817,"16.4":0.02192},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.02633,"10.0-10.2":0,"10.3":0.01316,"11.0-11.2":0.02194,"11.3-11.4":0,"12.0-12.1":0,"12.2-12.5":0.4476,"13.0-13.1":0,"13.2":0,"13.3":0.02194,"13.4-13.7":0.00439,"14.0-14.4":0.11848,"14.5-14.8":0.09215,"15.0-15.1":0.11409,"15.2-15.3":0.26329,"15.4":0.64068,"15.5":1.07072,"15.6":4.93234,"16.0":3.56761,"16.1":12.85305,"16.2":11.52342,"16.3":5.52036,"16.4":0.05266},P:{"4":0.041,"20":0.05125,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.03075,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0,"12.0":0,"13.0":0,"14.0":0.01025,"15.0":0,"16.0":0.01025,"17.0":0.0205,"18.0":0.01025,"19.0":0.09225},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.13577},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.00538},H:{"0":0.0051},L:{"0":5.69668},R:{_:"0"},M:{"0":0.00808},Q:{"13.1":0.00808}};
|
||||
Reference in New Issue
Block a user