new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
if(typeof cptable === 'undefined') cptable = {};
|
||||
cptable[1141] = (function(){ var d = "\u0000\u0001\u0002\u0003\t\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013
\b\u0018\u0019\u001c\u001d\u001e\u001f\n\u0017\u001b\u0005\u0006\u0007\u0016\u0004\u0014\u0015\u001a â{àáãåçñÄ.<(+!&éêëèíîïì~Ü$*);^-/Â[ÀÁÃÅÇÑö,%_>?øÉÊËÈÍÎÏÌ`:#§'=\"Øabcdefghi«»ðýþ±°jklmnopqrªºæ¸Æ€µßstuvwxyz¡¿ÐÝÞ®¢£¥·©@¶¼½¾¬|¯¨´×äABCDEFGHIô¦òóõüJKLMNOPQR¹û}ùúÿÖ÷STUVWXYZ²Ô\\ÒÓÕ0123456789³Û]ÙÚ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
Binary file not shown.
@@ -0,0 +1,13 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.joinAllInternals = void 0;
|
||||
var identity_1 = require("../util/identity");
|
||||
var mapOneOrManyArgs_1 = require("../util/mapOneOrManyArgs");
|
||||
var pipe_1 = require("../util/pipe");
|
||||
var mergeMap_1 = require("./mergeMap");
|
||||
var toArray_1 = require("./toArray");
|
||||
function joinAllInternals(joinFn, project) {
|
||||
return pipe_1.pipe(toArray_1.toArray(), mergeMap_1.mergeMap(function (sources) { return joinFn(sources); }), project ? mapOneOrManyArgs_1.mapOneOrManyArgs(project) : identity_1.identity);
|
||||
}
|
||||
exports.joinAllInternals = joinAllInternals;
|
||||
//# sourceMappingURL=joinAllInternals.js.map
|
||||
@@ -0,0 +1,73 @@
|
||||
import type {WordSeparators} from '../source/internal';
|
||||
import type {Split} from './split';
|
||||
|
||||
/**
|
||||
Step by step takes the first item in an array literal, formats it and adds it to a string literal, and then recursively appends the remainder.
|
||||
|
||||
Only to be used by `CamelCaseStringArray<>`.
|
||||
|
||||
@see CamelCaseStringArray
|
||||
*/
|
||||
type InnerCamelCaseStringArray<Parts extends readonly any[], PreviousPart> =
|
||||
Parts extends [`${infer FirstPart}`, ...infer RemainingParts]
|
||||
? FirstPart extends undefined
|
||||
? ''
|
||||
: FirstPart extends ''
|
||||
? InnerCamelCaseStringArray<RemainingParts, PreviousPart>
|
||||
: `${PreviousPart extends '' ? FirstPart : Capitalize<FirstPart>}${InnerCamelCaseStringArray<RemainingParts, FirstPart>}`
|
||||
: '';
|
||||
|
||||
/**
|
||||
Starts fusing the output of `Split<>`, an array literal of strings, into a camel-cased string literal.
|
||||
|
||||
It's separate from `InnerCamelCaseStringArray<>` to keep a clean API outwards to the rest of the code.
|
||||
|
||||
@see Split
|
||||
*/
|
||||
type CamelCaseStringArray<Parts extends readonly string[]> =
|
||||
Parts extends [`${infer FirstPart}`, ...infer RemainingParts]
|
||||
? Uncapitalize<`${FirstPart}${InnerCamelCaseStringArray<RemainingParts, FirstPart>}`>
|
||||
: never;
|
||||
|
||||
/**
|
||||
Convert a string literal to camel-case.
|
||||
|
||||
This can be useful when, for example, converting some kebab-cased command-line flags or a snake-cased database result.
|
||||
|
||||
@example
|
||||
```
|
||||
import type {CamelCase} from 'type-fest';
|
||||
|
||||
// Simple
|
||||
|
||||
const someVariable: CamelCase<'foo-bar'> = 'fooBar';
|
||||
|
||||
// Advanced
|
||||
|
||||
type CamelCasedProperties<T> = {
|
||||
[K in keyof T as CamelCase<K>]: T[K]
|
||||
};
|
||||
|
||||
interface RawOptions {
|
||||
'dry-run': boolean;
|
||||
'full_family_name': string;
|
||||
foo: number;
|
||||
BAR: string;
|
||||
QUZ_QUX: number;
|
||||
'OTHER-FIELD': boolean;
|
||||
}
|
||||
|
||||
const dbResult: CamelCasedProperties<RawOptions> = {
|
||||
dryRun: true,
|
||||
fullFamilyName: 'bar.js',
|
||||
foo: 123,
|
||||
bar: 'foo',
|
||||
quzQux: 6,
|
||||
otherField: false
|
||||
};
|
||||
```
|
||||
|
||||
@category Change case
|
||||
@category Template literal
|
||||
*/
|
||||
export type CamelCase<K> = K extends string ? CamelCaseStringArray<Split<K extends Uppercase<K> ? Lowercase<K> : K, WordSeparators>> : K;
|
||||
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = Math.pow(2, 53) - 1;
|
||||
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* The base implementation of `_.isNaN` without support for number objects.
|
||||
*
|
||||
* @private
|
||||
* @param {*} value The value to check.
|
||||
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
|
||||
*/
|
||||
function baseIsNaN(value) {
|
||||
return value !== value;
|
||||
}
|
||||
|
||||
module.exports = baseIsNaN;
|
||||
@@ -0,0 +1,45 @@
|
||||
var arrayFilter = require('./_arrayFilter'),
|
||||
arrayMap = require('./_arrayMap'),
|
||||
baseProperty = require('./_baseProperty'),
|
||||
baseTimes = require('./_baseTimes'),
|
||||
isArrayLikeObject = require('./isArrayLikeObject');
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMax = Math.max;
|
||||
|
||||
/**
|
||||
* This method is like `_.zip` except that it accepts an array of grouped
|
||||
* elements and creates an array regrouping the elements to their pre-zip
|
||||
* configuration.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 1.2.0
|
||||
* @category Array
|
||||
* @param {Array} array The array of grouped elements to process.
|
||||
* @returns {Array} Returns the new array of regrouped elements.
|
||||
* @example
|
||||
*
|
||||
* var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);
|
||||
* // => [['a', 1, true], ['b', 2, false]]
|
||||
*
|
||||
* _.unzip(zipped);
|
||||
* // => [['a', 'b'], [1, 2], [true, false]]
|
||||
*/
|
||||
function unzip(array) {
|
||||
if (!(array && array.length)) {
|
||||
return [];
|
||||
}
|
||||
var length = 0;
|
||||
array = arrayFilter(array, function(group) {
|
||||
if (isArrayLikeObject(group)) {
|
||||
length = nativeMax(group.length, length);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
return baseTimes(length, function(index) {
|
||||
return arrayMap(array, baseProperty(index));
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = unzip;
|
||||
@@ -0,0 +1,46 @@
|
||||
'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
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"E F A B","2":"J D CC"},B:{"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 k l m n o p q r s t u f H"},C:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h 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":"0 1 2 3 4 5 6 7 I v J D E F A B C K L G M N O w g x y z","2":"8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"1":"v J IC","2":"D E F A B C K L G KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","16":"JC","129":"I HC zB"},F:{"1":"F B C G M N O PC QC RC SC qB AC TC rB","2":"0 1 2 3 4 5 6 7 8 9 w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e"},G:{"1":"UC BC VC WC XC","2":"E 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","129":"zB"},H:{"1":"oC"},I:{"1":"tB I pC qC rC sC BC tC","2":"f uC"},J:{"1":"D A"},K:{"1":"A B C qB AC rB","2":"h"},L:{"2":"H"},M:{"2":"H"},N:{"1":"A B"},O:{"2":"vC"},P:{"2":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"2":"1B"},R:{"2":"9C"},S:{"2":"AD BD"}},B:4,C:"display: run-in"};
|
||||
@@ -0,0 +1,3 @@
|
||||
import KeyBlock from '../../nodes/KeyBlock';
|
||||
import Renderer, { RenderOptions } from '../Renderer';
|
||||
export default function (node: KeyBlock, renderer: Renderer, options: RenderOptions): void;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"scheduleReadableStreamLike.d.ts","sourceRoot":"","sources":["../../../../src/internal/scheduled/scheduleReadableStreamLike.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI3C,wBAAgB,0BAA0B,CAAC,CAAC,EAAE,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,aAAa,GAAG,UAAU,CAAC,CAAC,CAAC,CAEnH"}
|
||||
@@ -0,0 +1,11 @@
|
||||
# 2.1.0
|
||||
|
||||
## TypeScript types
|
||||
|
||||
- Add [TypeScript definitions](src/main.d.ts)
|
||||
|
||||
# 2.0.0
|
||||
|
||||
## Breaking changes
|
||||
|
||||
- Minimal supported Node.js version is now `10.17.0`
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { PreprocessorGroup, Options } from '../types';
|
||||
declare const _default: (options?: Options.Less) => PreprocessorGroup;
|
||||
export default _default;
|
||||
@@ -0,0 +1,53 @@
|
||||
export class MissingValueError extends Error {
|
||||
name: 'MissingValueError';
|
||||
message: string;
|
||||
key: string;
|
||||
constructor(key: string);
|
||||
}
|
||||
|
||||
export type Options = {
|
||||
/**
|
||||
By default, Pupa throws a `MissingValueError` when a placeholder resolves to `undefined`. With this option set to `true`, it simply ignores it and leaves the placeholder as is.
|
||||
|
||||
@default false
|
||||
*/
|
||||
ignoreMissing?: boolean;
|
||||
/**
|
||||
Performs arbitrary operation for each interpolation. If the returned value was `undefined`, it behaves differently depending on the `ignoreMissing` option. Otherwise, the returned value will be interpolated into a string (and escaped when double-braced) and embedded into the template.
|
||||
|
||||
@default ({value}) => value
|
||||
*/
|
||||
transform?: (data: {value: unknown; key: string}) => unknown;
|
||||
};
|
||||
|
||||
/**
|
||||
Simple micro templating.
|
||||
|
||||
@param template - Text with placeholders for `data` properties.
|
||||
@param data - Data to interpolate into `template`.
|
||||
|
||||
@example
|
||||
```
|
||||
import pupa from 'pupa';
|
||||
|
||||
pupa('The mobile number of {name} is {phone.mobile}', {
|
||||
name: 'Sindre',
|
||||
phone: {
|
||||
mobile: '609 24 363'
|
||||
}
|
||||
});
|
||||
//=> 'The mobile number of Sindre is 609 24 363'
|
||||
|
||||
pupa('I like {0} and {1}', ['🦄', '🐮']);
|
||||
//=> 'I like 🦄 and 🐮'
|
||||
|
||||
// Double braces encodes the HTML entities to avoid code injection.
|
||||
pupa('I like {{0}} and {{1}}', ['<br>🦄</br>', '<i>🐮</i>']);
|
||||
//=> 'I like <br>🦄</br> and <i>🐮</i>'
|
||||
```
|
||||
*/
|
||||
export default function pupa(
|
||||
template: string,
|
||||
data: unknown[] | Record<string, any>,
|
||||
options?: Options
|
||||
): string;
|
||||
@@ -0,0 +1 @@
|
||||
export default function hash(str: string): string;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"concatAll.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/concatAll.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,eAAe,CAAC,GAAG,CAAC,KAAK,gBAAgB,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAEnG"}
|
||||
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
Check if the process is running inside [Windows Subsystem for Linux](https://msdn.microsoft.com/commandline/wsl/about) (Bash on Windows).
|
||||
|
||||
@example
|
||||
```
|
||||
import isWsl = require('is-wsl');
|
||||
|
||||
// When running inside Windows Subsystem for Linux
|
||||
console.log(isWsl);
|
||||
//=> true
|
||||
```
|
||||
*/
|
||||
declare const isWsl: boolean;
|
||||
|
||||
export = isWsl;
|
||||
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"name": "pify",
|
||||
"version": "2.3.0",
|
||||
"description": "Promisify a callback-style function",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/pify",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && npm run optimization-test",
|
||||
"optimization-test": "node --allow-natives-syntax optimization-test.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"keywords": [
|
||||
"promise",
|
||||
"promises",
|
||||
"promisify",
|
||||
"denodify",
|
||||
"denodeify",
|
||||
"callback",
|
||||
"cb",
|
||||
"node",
|
||||
"then",
|
||||
"thenify",
|
||||
"convert",
|
||||
"transform",
|
||||
"wrap",
|
||||
"wrapper",
|
||||
"bind",
|
||||
"to",
|
||||
"async",
|
||||
"es2015"
|
||||
],
|
||||
"devDependencies": {
|
||||
"ava": "*",
|
||||
"pinkie-promise": "^1.0.0",
|
||||
"v8-natives": "0.0.2",
|
||||
"xo": "*"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
if (!require("./is-implemented")()) {
|
||||
Object.defineProperty(Array.prototype, require("es6-symbol").iterator, {
|
||||
value: require("./shim"),
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('./async').timesSeries;
|
||||
@@ -0,0 +1,3 @@
|
||||
const legacy = require('../dist/legacy-exports')
|
||||
module.exports = legacy.omap
|
||||
legacy.warnFileDeprecation(__filename)
|
||||
@@ -0,0 +1,336 @@
|
||||
/**
|
||||
* https://tc39.es/ecma262/#sec-tostring
|
||||
*/
|
||||
export function ToString(o) {
|
||||
// Only symbol is irregular...
|
||||
if (typeof o === 'symbol') {
|
||||
throw TypeError('Cannot convert a Symbol value to a string');
|
||||
}
|
||||
return String(o);
|
||||
}
|
||||
/**
|
||||
* https://tc39.es/ecma262/#sec-tonumber
|
||||
* @param val
|
||||
*/
|
||||
export function ToNumber(val) {
|
||||
if (val === undefined) {
|
||||
return NaN;
|
||||
}
|
||||
if (val === null) {
|
||||
return +0;
|
||||
}
|
||||
if (typeof val === 'boolean') {
|
||||
return val ? 1 : +0;
|
||||
}
|
||||
if (typeof val === 'number') {
|
||||
return val;
|
||||
}
|
||||
if (typeof val === 'symbol' || typeof val === 'bigint') {
|
||||
throw new TypeError('Cannot convert symbol/bigint to number');
|
||||
}
|
||||
return Number(val);
|
||||
}
|
||||
/**
|
||||
* https://tc39.es/ecma262/#sec-tointeger
|
||||
* @param n
|
||||
*/
|
||||
function ToInteger(n) {
|
||||
var number = ToNumber(n);
|
||||
if (isNaN(number) || SameValue(number, -0)) {
|
||||
return 0;
|
||||
}
|
||||
if (isFinite(number)) {
|
||||
return number;
|
||||
}
|
||||
var integer = Math.floor(Math.abs(number));
|
||||
if (number < 0) {
|
||||
integer = -integer;
|
||||
}
|
||||
if (SameValue(integer, -0)) {
|
||||
return 0;
|
||||
}
|
||||
return integer;
|
||||
}
|
||||
/**
|
||||
* https://tc39.es/ecma262/#sec-timeclip
|
||||
* @param time
|
||||
*/
|
||||
export function TimeClip(time) {
|
||||
if (!isFinite(time)) {
|
||||
return NaN;
|
||||
}
|
||||
if (Math.abs(time) > 8.64 * 1e15) {
|
||||
return NaN;
|
||||
}
|
||||
return ToInteger(time);
|
||||
}
|
||||
/**
|
||||
* https://tc39.es/ecma262/#sec-toobject
|
||||
* @param arg
|
||||
*/
|
||||
export function ToObject(arg) {
|
||||
if (arg == null) {
|
||||
throw new TypeError('undefined/null cannot be converted to object');
|
||||
}
|
||||
return Object(arg);
|
||||
}
|
||||
/**
|
||||
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-samevalue
|
||||
* @param x
|
||||
* @param y
|
||||
*/
|
||||
export function SameValue(x, y) {
|
||||
if (Object.is) {
|
||||
return Object.is(x, y);
|
||||
}
|
||||
// SameValue algorithm
|
||||
if (x === y) {
|
||||
// Steps 1-5, 7-10
|
||||
// Steps 6.b-6.e: +0 != -0
|
||||
return x !== 0 || 1 / x === 1 / y;
|
||||
}
|
||||
// Step 6.a: NaN == NaN
|
||||
return x !== x && y !== y;
|
||||
}
|
||||
/**
|
||||
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-arraycreate
|
||||
* @param len
|
||||
*/
|
||||
export function ArrayCreate(len) {
|
||||
return new Array(len);
|
||||
}
|
||||
/**
|
||||
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-hasownproperty
|
||||
* @param o
|
||||
* @param prop
|
||||
*/
|
||||
export function HasOwnProperty(o, prop) {
|
||||
return Object.prototype.hasOwnProperty.call(o, prop);
|
||||
}
|
||||
/**
|
||||
* https://www.ecma-international.org/ecma-262/11.0/index.html#sec-type
|
||||
* @param x
|
||||
*/
|
||||
export function Type(x) {
|
||||
if (x === null) {
|
||||
return 'Null';
|
||||
}
|
||||
if (typeof x === 'undefined') {
|
||||
return 'Undefined';
|
||||
}
|
||||
if (typeof x === 'function' || typeof x === 'object') {
|
||||
return 'Object';
|
||||
}
|
||||
if (typeof x === 'number') {
|
||||
return 'Number';
|
||||
}
|
||||
if (typeof x === 'boolean') {
|
||||
return 'Boolean';
|
||||
}
|
||||
if (typeof x === 'string') {
|
||||
return 'String';
|
||||
}
|
||||
if (typeof x === 'symbol') {
|
||||
return 'Symbol';
|
||||
}
|
||||
if (typeof x === 'bigint') {
|
||||
return 'BigInt';
|
||||
}
|
||||
}
|
||||
var MS_PER_DAY = 86400000;
|
||||
/**
|
||||
* https://www.ecma-international.org/ecma-262/11.0/index.html#eqn-modulo
|
||||
* @param x
|
||||
* @param y
|
||||
* @return k of the same sign as y
|
||||
*/
|
||||
function mod(x, y) {
|
||||
return x - Math.floor(x / y) * y;
|
||||
}
|
||||
/**
|
||||
* https://tc39.es/ecma262/#eqn-Day
|
||||
* @param t
|
||||
*/
|
||||
export function Day(t) {
|
||||
return Math.floor(t / MS_PER_DAY);
|
||||
}
|
||||
/**
|
||||
* https://tc39.es/ecma262/#sec-week-day
|
||||
* @param t
|
||||
*/
|
||||
export function WeekDay(t) {
|
||||
return mod(Day(t) + 4, 7);
|
||||
}
|
||||
/**
|
||||
* https://tc39.es/ecma262/#sec-year-number
|
||||
* @param y
|
||||
*/
|
||||
export function DayFromYear(y) {
|
||||
return Date.UTC(y, 0) / MS_PER_DAY;
|
||||
}
|
||||
/**
|
||||
* https://tc39.es/ecma262/#sec-year-number
|
||||
* @param y
|
||||
*/
|
||||
export function TimeFromYear(y) {
|
||||
return Date.UTC(y, 0);
|
||||
}
|
||||
/**
|
||||
* https://tc39.es/ecma262/#sec-year-number
|
||||
* @param t
|
||||
*/
|
||||
export function YearFromTime(t) {
|
||||
return new Date(t).getUTCFullYear();
|
||||
}
|
||||
export function DaysInYear(y) {
|
||||
if (y % 4 !== 0) {
|
||||
return 365;
|
||||
}
|
||||
if (y % 100 !== 0) {
|
||||
return 366;
|
||||
}
|
||||
if (y % 400 !== 0) {
|
||||
return 365;
|
||||
}
|
||||
return 366;
|
||||
}
|
||||
export function DayWithinYear(t) {
|
||||
return Day(t) - DayFromYear(YearFromTime(t));
|
||||
}
|
||||
export function InLeapYear(t) {
|
||||
return DaysInYear(YearFromTime(t)) === 365 ? 0 : 1;
|
||||
}
|
||||
/**
|
||||
* https://tc39.es/ecma262/#sec-month-number
|
||||
* @param t
|
||||
*/
|
||||
export function MonthFromTime(t) {
|
||||
var dwy = DayWithinYear(t);
|
||||
var leap = InLeapYear(t);
|
||||
if (dwy >= 0 && dwy < 31) {
|
||||
return 0;
|
||||
}
|
||||
if (dwy < 59 + leap) {
|
||||
return 1;
|
||||
}
|
||||
if (dwy < 90 + leap) {
|
||||
return 2;
|
||||
}
|
||||
if (dwy < 120 + leap) {
|
||||
return 3;
|
||||
}
|
||||
if (dwy < 151 + leap) {
|
||||
return 4;
|
||||
}
|
||||
if (dwy < 181 + leap) {
|
||||
return 5;
|
||||
}
|
||||
if (dwy < 212 + leap) {
|
||||
return 6;
|
||||
}
|
||||
if (dwy < 243 + leap) {
|
||||
return 7;
|
||||
}
|
||||
if (dwy < 273 + leap) {
|
||||
return 8;
|
||||
}
|
||||
if (dwy < 304 + leap) {
|
||||
return 9;
|
||||
}
|
||||
if (dwy < 334 + leap) {
|
||||
return 10;
|
||||
}
|
||||
if (dwy < 365 + leap) {
|
||||
return 11;
|
||||
}
|
||||
throw new Error('Invalid time');
|
||||
}
|
||||
export function DateFromTime(t) {
|
||||
var dwy = DayWithinYear(t);
|
||||
var mft = MonthFromTime(t);
|
||||
var leap = InLeapYear(t);
|
||||
if (mft === 0) {
|
||||
return dwy + 1;
|
||||
}
|
||||
if (mft === 1) {
|
||||
return dwy - 30;
|
||||
}
|
||||
if (mft === 2) {
|
||||
return dwy - 58 - leap;
|
||||
}
|
||||
if (mft === 3) {
|
||||
return dwy - 89 - leap;
|
||||
}
|
||||
if (mft === 4) {
|
||||
return dwy - 119 - leap;
|
||||
}
|
||||
if (mft === 5) {
|
||||
return dwy - 150 - leap;
|
||||
}
|
||||
if (mft === 6) {
|
||||
return dwy - 180 - leap;
|
||||
}
|
||||
if (mft === 7) {
|
||||
return dwy - 211 - leap;
|
||||
}
|
||||
if (mft === 8) {
|
||||
return dwy - 242 - leap;
|
||||
}
|
||||
if (mft === 9) {
|
||||
return dwy - 272 - leap;
|
||||
}
|
||||
if (mft === 10) {
|
||||
return dwy - 303 - leap;
|
||||
}
|
||||
if (mft === 11) {
|
||||
return dwy - 333 - leap;
|
||||
}
|
||||
throw new Error('Invalid time');
|
||||
}
|
||||
var HOURS_PER_DAY = 24;
|
||||
var MINUTES_PER_HOUR = 60;
|
||||
var SECONDS_PER_MINUTE = 60;
|
||||
var MS_PER_SECOND = 1e3;
|
||||
var MS_PER_MINUTE = MS_PER_SECOND * SECONDS_PER_MINUTE;
|
||||
var MS_PER_HOUR = MS_PER_MINUTE * MINUTES_PER_HOUR;
|
||||
export function HourFromTime(t) {
|
||||
return mod(Math.floor(t / MS_PER_HOUR), HOURS_PER_DAY);
|
||||
}
|
||||
export function MinFromTime(t) {
|
||||
return mod(Math.floor(t / MS_PER_MINUTE), MINUTES_PER_HOUR);
|
||||
}
|
||||
export function SecFromTime(t) {
|
||||
return mod(Math.floor(t / MS_PER_SECOND), SECONDS_PER_MINUTE);
|
||||
}
|
||||
function IsCallable(fn) {
|
||||
return typeof fn === 'function';
|
||||
}
|
||||
/**
|
||||
* The abstract operation OrdinaryHasInstance implements
|
||||
* the default algorithm for determining if an object O
|
||||
* inherits from the instance object inheritance path
|
||||
* provided by constructor C.
|
||||
* @param C class
|
||||
* @param O object
|
||||
* @param internalSlots internalSlots
|
||||
*/
|
||||
export function OrdinaryHasInstance(C, O, internalSlots) {
|
||||
if (!IsCallable(C)) {
|
||||
return false;
|
||||
}
|
||||
if (internalSlots === null || internalSlots === void 0 ? void 0 : internalSlots.boundTargetFunction) {
|
||||
var BC = internalSlots === null || internalSlots === void 0 ? void 0 : internalSlots.boundTargetFunction;
|
||||
return O instanceof BC;
|
||||
}
|
||||
if (typeof O !== 'object') {
|
||||
return false;
|
||||
}
|
||||
var P = C.prototype;
|
||||
if (typeof P !== 'object') {
|
||||
throw new TypeError('OrdinaryHasInstance called on an object with an invalid prototype property.');
|
||||
}
|
||||
return Object.prototype.isPrototypeOf.call(P, O);
|
||||
}
|
||||
export function msFromTime(t) {
|
||||
return mod(t, MS_PER_SECOND);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
var build = require('./chunks/dep-66eb515d.js');
|
||||
require('os');
|
||||
require('fs');
|
||||
require('path');
|
||||
require('tty');
|
||||
require('util');
|
||||
require('net');
|
||||
require('events');
|
||||
require('url');
|
||||
require('http');
|
||||
require('stream');
|
||||
require('zlib');
|
||||
require('resolve');
|
||||
require('module');
|
||||
require('readline');
|
||||
require('crypto');
|
||||
require('esbuild');
|
||||
require('worker_threads');
|
||||
require('assert');
|
||||
require('https');
|
||||
require('tls');
|
||||
require('buffer');
|
||||
require('child_process');
|
||||
require('querystring');
|
||||
|
||||
|
||||
|
||||
exports.build = build.build;
|
||||
exports.createLogger = build.createLogger;
|
||||
exports.createServer = build.createServer;
|
||||
exports.defineConfig = build.defineConfig;
|
||||
exports.loadConfigFromFile = build.loadConfigFromFile;
|
||||
exports.loadEnv = build.loadEnv;
|
||||
exports.mergeConfig = build.mergeConfig;
|
||||
exports.normalizePath = build.normalizePath;
|
||||
exports.optimizeDeps = build.optimizeDeps;
|
||||
exports.resolveConfig = build.resolveConfig;
|
||||
exports.resolvePackageData = build.resolvePackageData;
|
||||
exports.resolvePackageEntry = build.resolvePackageEntry;
|
||||
exports.send = build.send;
|
||||
exports.sortUserPlugins = build.sortUserPlugins;
|
||||
@@ -0,0 +1,18 @@
|
||||
import { operate } from '../util/lift';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
import { noop } from '../util/noop';
|
||||
import { innerFrom } from '../observable/innerFrom';
|
||||
export function distinct(keySelector, flushes) {
|
||||
return operate(function (source, subscriber) {
|
||||
var distinctKeys = new Set();
|
||||
source.subscribe(createOperatorSubscriber(subscriber, function (value) {
|
||||
var key = keySelector ? keySelector(value) : value;
|
||||
if (!distinctKeys.has(key)) {
|
||||
distinctKeys.add(key);
|
||||
subscriber.next(value);
|
||||
}
|
||||
}));
|
||||
flushes && innerFrom(flushes).subscribe(createOperatorSubscriber(subscriber, function () { return distinctKeys.clear(); }, noop));
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=distinct.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"empty.js","sourceRoot":"","sources":["../../../../src/internal/observable/empty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAiE3C,MAAM,CAAC,IAAM,KAAK,GAAG,IAAI,UAAU,CAAQ,UAAC,UAAU,IAAK,OAAA,UAAU,CAAC,QAAQ,EAAE,EAArB,CAAqB,CAAC,CAAC;AAOlF,MAAM,UAAU,KAAK,CAAC,SAAyB;IAC7C,OAAO,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AACvD,CAAC;AAED,SAAS,cAAc,CAAC,SAAwB;IAC9C,OAAO,IAAI,UAAU,CAAQ,UAAC,UAAU,IAAK,OAAA,SAAS,CAAC,QAAQ,CAAC,cAAM,OAAA,UAAU,CAAC,QAAQ,EAAE,EAArB,CAAqB,CAAC,EAA/C,CAA+C,CAAC,CAAC;AAChG,CAAC"}
|
||||
@@ -0,0 +1,152 @@
|
||||
{
|
||||
"name": "ext",
|
||||
"version": "1.7.0",
|
||||
"description": "JavaScript utilities with respect to emerging standard",
|
||||
"author": "Mariusz Nowak <medyk@medikoo.com> (http://www.medikoo.com/)",
|
||||
"keywords": [
|
||||
"ecmascript",
|
||||
"es",
|
||||
"es6",
|
||||
"extensions",
|
||||
"ext",
|
||||
"addons",
|
||||
"lodash",
|
||||
"extras",
|
||||
"harmony",
|
||||
"javascript",
|
||||
"polyfill",
|
||||
"shim",
|
||||
"util",
|
||||
"utils",
|
||||
"utilities"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/medikoo/es5-ext#ext"
|
||||
},
|
||||
"dependencies": {
|
||||
"type": "^2.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.3.6",
|
||||
"eslint": "^8.23.0",
|
||||
"eslint-config-medikoo": "^4.1.2",
|
||||
"git-list-updated": "^1.2.1",
|
||||
"github-release-from-cc-changelog": "^2.3.0",
|
||||
"husky": "^4.3.8",
|
||||
"lint-staged": "^13.0.3",
|
||||
"mocha": "^6.2.3",
|
||||
"nyc": "^15.1.0",
|
||||
"prettier-elastic": "^2.2.1",
|
||||
"sinon": "^8.1.1",
|
||||
"timers-ext": "^0.1.7"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": [
|
||||
"eslint"
|
||||
],
|
||||
"*.{css,html,js,json,md,yaml,yml}": [
|
||||
"prettier -c"
|
||||
]
|
||||
},
|
||||
"eslintIgnore": [
|
||||
"_es5-ext"
|
||||
],
|
||||
"eslintConfig": {
|
||||
"extends": "medikoo/es3",
|
||||
"root": true,
|
||||
"overrides": [
|
||||
{
|
||||
"files": "global-this/implementation.js",
|
||||
"globals": {
|
||||
"__global__": true,
|
||||
"self": true,
|
||||
"window": true
|
||||
},
|
||||
"rules": {
|
||||
"no-extend-native": "off",
|
||||
"strict": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"global-this/is-implemented.js",
|
||||
"global-this/index.js"
|
||||
],
|
||||
"globals": {
|
||||
"globalThis": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "string_/camel-to-hyphen.js",
|
||||
"rules": {
|
||||
"id-length": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": "test/**/*.js",
|
||||
"env": {
|
||||
"mocha": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"files": [
|
||||
"test/promise/limit.js",
|
||||
"test/thenable_/finally.js"
|
||||
],
|
||||
"globals": {
|
||||
"Promise": true
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"prettier": {
|
||||
"printWidth": 100,
|
||||
"tabWidth": 4,
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"*.md",
|
||||
"*.yml"
|
||||
],
|
||||
"options": {
|
||||
"tabWidth": 2
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"mocha": {
|
||||
"recursive": true
|
||||
},
|
||||
"nyc": {
|
||||
"all": true,
|
||||
"exclude": [
|
||||
".github",
|
||||
"_es5-ext",
|
||||
"coverage/**",
|
||||
"test/**",
|
||||
"*.config.js"
|
||||
],
|
||||
"reporter": [
|
||||
"lcov",
|
||||
"html",
|
||||
"text-summary"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "nyc npm test",
|
||||
"lint": "eslint .",
|
||||
"lint:updated": "pipe-git-updated --ext=js -- eslint --ignore-pattern '!*'",
|
||||
"prettier-check": "prettier -c --ignore-path .gitignore \"**/*.{css,html,js,json,md,yaml,yml}\"",
|
||||
"prettier-check:updated": "pipe-git-updated --ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier -c",
|
||||
"prettify": "prettier --write --ignore-path .gitignore '**/*.{css,html,js,json,md,yaml,yml}'",
|
||||
"prettify:updated": "pipe-git-updated ---base=main -ext=css --ext=html --ext=js --ext=json --ext=md --ext=yaml --ext=yml -- prettier --write",
|
||||
"test": "mocha"
|
||||
},
|
||||
"license": "ISC"
|
||||
}
|
||||
@@ -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.00584,"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.01168,"91":0,"92":0,"93":0,"94":0.00584,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0.01168,"101":0.01168,"102":0.01168,"103":0.00584,"104":0.01752,"105":0,"106":0,"107":0,"108":0.05257,"109":0.38551,"110":0.29789,"111":0.00584,"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.01752,"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.00584,"74":0,"75":0.00584,"76":0.01752,"77":0.05841,"78":0,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0.02336,"92":0.00584,"93":0.18107,"94":0.02921,"95":0,"96":0,"97":0,"98":0,"99":0.00584,"100":0,"101":0,"102":0.00584,"103":1.15068,"104":0.05257,"105":0,"106":0.18691,"107":0.02336,"108":2.14949,"109":14.36302,"110":8.0489,"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,"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.01168,"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.05257,"95":0.02921,"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,"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.07593,"108":0,"109":1.139,"110":1.4953},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00584,"12":0,"13":0.01168,"14":0.00584,"15":0,_:"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,"12.1":0.01752,"13.1":0.01168,"14.1":0.18107,"15.1":0.11098,"15.2-15.3":0.01168,"15.4":0.00584,"15.5":0.19275,"15.6":0.2278,"16.0":0,"16.1":0.24532,"16.2":0.09346,"16.3":0.16355,"16.4":0},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.03335,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.3713,"10.0-10.2":0,"10.3":0.01556,"11.0-11.2":0,"11.3-11.4":0,"12.0-12.1":0.01556,"12.2-12.5":0.67812,"13.0-13.1":0,"13.2":0,"13.3":0.04891,"13.4-13.7":0,"14.0-14.4":0.29126,"14.5-14.8":1.53856,"15.0-15.1":0.1623,"15.2-15.3":0.22678,"15.4":0.76039,"15.5":0.58252,"15.6":2.16777,"16.0":4.59122,"16.1":3.83306,"16.2":4.21992,"16.3":1.1806,"16.4":0},P:{"4":0.09276,"20":1.09255,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.01031,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.01031,"12.0":0,"13.0":0.01031,"14.0":0,"15.0":0,"16.0":0.06184,"17.0":0,"18.0":0.01031,"19.0":1.08224},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.50385,"4.4":0,"4.4.3-4.4.4":0.25193},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.00584,"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":1.44317},H:{"0":0.04331},L:{"0":39.95574},R:{_:"0"},M:{"0":0.16636},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,136 @@
|
||||
# Release history
|
||||
|
||||
**All notable changes to this project will be documented in this file.**
|
||||
|
||||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
||||
|
||||
<details>
|
||||
<summary><strong>Guiding Principles</strong></summary>
|
||||
|
||||
- Changelogs are for humans, not machines.
|
||||
- There should be an entry for every single version.
|
||||
- The same types of changes should be grouped.
|
||||
- Versions and sections should be linkable.
|
||||
- The latest version comes first.
|
||||
- The release date of each versions is displayed.
|
||||
- Mention whether you follow Semantic Versioning.
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Types of changes</strong></summary>
|
||||
|
||||
Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
|
||||
|
||||
- `Added` for new features.
|
||||
- `Changed` for changes in existing functionality.
|
||||
- `Deprecated` for soon-to-be removed features.
|
||||
- `Removed` for now removed features.
|
||||
- `Fixed` for any bug fixes.
|
||||
- `Security` in case of vulnerabilities.
|
||||
|
||||
</details>
|
||||
|
||||
## 2.3.1 (2022-01-02)
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixes bug when a pattern containing an expression after the closing parenthesis (`/!(*.d).{ts,tsx}`) was incorrectly converted to regexp ([9f241ef](https://github.com/micromatch/picomatch/commit/9f241ef)).
|
||||
|
||||
### Changed
|
||||
|
||||
* Some documentation improvements ([f81d236](https://github.com/micromatch/picomatch/commit/f81d236), [421e0e7](https://github.com/micromatch/picomatch/commit/421e0e7)).
|
||||
|
||||
## 2.3.0 (2021-05-21)
|
||||
|
||||
### Fixed
|
||||
|
||||
* Fixes bug where file names with two dots were not being matched consistently with negation extglobs containing a star ([56083ef](https://github.com/micromatch/picomatch/commit/56083ef))
|
||||
|
||||
## 2.2.3 (2021-04-10)
|
||||
|
||||
### Fixed
|
||||
|
||||
* Do not skip pattern seperator for square brackets ([fb08a30](https://github.com/micromatch/picomatch/commit/fb08a30)).
|
||||
* Set negatedExtGlob also if it does not span the whole pattern ([032e3f5](https://github.com/micromatch/picomatch/commit/032e3f5)).
|
||||
|
||||
## 2.2.2 (2020-03-21)
|
||||
|
||||
### Fixed
|
||||
|
||||
* Correctly handle parts of the pattern after parentheses in the `scan` method ([e15b920](https://github.com/micromatch/picomatch/commit/e15b920)).
|
||||
|
||||
## 2.2.1 (2020-01-04)
|
||||
|
||||
* Fixes [#49](https://github.com/micromatch/picomatch/issues/49), so that braces with no sets or ranges are now propertly treated as literals.
|
||||
|
||||
## 2.2.0 (2020-01-04)
|
||||
|
||||
* Disable fastpaths mode for the parse method ([5b8d33f](https://github.com/micromatch/picomatch/commit/5b8d33f))
|
||||
* Add `tokens`, `slashes`, and `parts` to the object returned by `picomatch.scan()`.
|
||||
|
||||
## 2.1.0 (2019-10-31)
|
||||
|
||||
* add benchmarks for scan ([4793b92](https://github.com/micromatch/picomatch/commit/4793b92))
|
||||
* Add eslint object-curly-spacing rule ([707c650](https://github.com/micromatch/picomatch/commit/707c650))
|
||||
* Add prefer-const eslint rule ([5c7501c](https://github.com/micromatch/picomatch/commit/5c7501c))
|
||||
* Add support for nonegate in scan API ([275c9b9](https://github.com/micromatch/picomatch/commit/275c9b9))
|
||||
* Change lets to consts. Move root import up. ([4840625](https://github.com/micromatch/picomatch/commit/4840625))
|
||||
* closes https://github.com/micromatch/picomatch/issues/21 ([766bcb0](https://github.com/micromatch/picomatch/commit/766bcb0))
|
||||
* Fix "Extglobs" table in readme ([eb19da8](https://github.com/micromatch/picomatch/commit/eb19da8))
|
||||
* fixes https://github.com/micromatch/picomatch/issues/20 ([9caca07](https://github.com/micromatch/picomatch/commit/9caca07))
|
||||
* fixes https://github.com/micromatch/picomatch/issues/26 ([fa58f45](https://github.com/micromatch/picomatch/commit/fa58f45))
|
||||
* Lint test ([d433a34](https://github.com/micromatch/picomatch/commit/d433a34))
|
||||
* lint unit tests ([0159b55](https://github.com/micromatch/picomatch/commit/0159b55))
|
||||
* Make scan work with noext ([6c02e03](https://github.com/micromatch/picomatch/commit/6c02e03))
|
||||
* minor linting ([c2a2b87](https://github.com/micromatch/picomatch/commit/c2a2b87))
|
||||
* minor parser improvements ([197671d](https://github.com/micromatch/picomatch/commit/197671d))
|
||||
* remove eslint since it... ([07876fa](https://github.com/micromatch/picomatch/commit/07876fa))
|
||||
* remove funding file ([8ebe96d](https://github.com/micromatch/picomatch/commit/8ebe96d))
|
||||
* Remove unused funks ([cbc6d54](https://github.com/micromatch/picomatch/commit/cbc6d54))
|
||||
* Run eslint during pretest, fix existing eslint findings ([0682367](https://github.com/micromatch/picomatch/commit/0682367))
|
||||
* support `noparen` in scan ([3d37569](https://github.com/micromatch/picomatch/commit/3d37569))
|
||||
* update changelog ([7b34e77](https://github.com/micromatch/picomatch/commit/7b34e77))
|
||||
* update travis ([777f038](https://github.com/micromatch/picomatch/commit/777f038))
|
||||
* Use eslint-disable-next-line instead of eslint-disable ([4e7c1fd](https://github.com/micromatch/picomatch/commit/4e7c1fd))
|
||||
|
||||
## 2.0.7 (2019-05-14)
|
||||
|
||||
* 2.0.7 ([9eb9a71](https://github.com/micromatch/picomatch/commit/9eb9a71))
|
||||
* supports lookbehinds ([1f63f7e](https://github.com/micromatch/picomatch/commit/1f63f7e))
|
||||
* update .verb.md file with typo change ([2741279](https://github.com/micromatch/picomatch/commit/2741279))
|
||||
* fix: typo in README ([0753e44](https://github.com/micromatch/picomatch/commit/0753e44))
|
||||
|
||||
## 2.0.4 (2019-04-10)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Readme link [fixed](https://github.com/micromatch/picomatch/pull/13/commits/a96ab3aa2b11b6861c23289964613d85563b05df) by @danez.
|
||||
- `options.capture` now works as expected when fastpaths are enabled. See https://github.com/micromatch/picomatch/pull/12/commits/26aefd71f1cfaf95c37f1c1fcab68a693b037304. Thanks to @DrPizza.
|
||||
|
||||
## 2.0.0 (2019-04-10)
|
||||
|
||||
### Added
|
||||
|
||||
- Adds support for `options.onIgnore`. See the readme for details
|
||||
- Adds support for `options.onResult`. See the readme for details
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- The unixify option was renamed to `windows`
|
||||
- caching and all related options and methods have been removed
|
||||
|
||||
## 1.0.0 (2018-11-05)
|
||||
|
||||
- adds `.onMatch` option
|
||||
- improvements to `.scan` method
|
||||
- numerous improvements and optimizations for matching and parsing
|
||||
- better windows path handling
|
||||
|
||||
## 0.1.0 - 2017-04-13
|
||||
|
||||
First release.
|
||||
|
||||
|
||||
[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
|
||||
@@ -0,0 +1,177 @@
|
||||
{
|
||||
"name": "@noble/hashes",
|
||||
"version": "1.2.0",
|
||||
"description": "Audited & minimal 0-dependency JS implementation of SHA2, SHA3, RIPEMD, BLAKE2/3, HMAC, HKDF, PBKDF2, Scrypt",
|
||||
"files": [
|
||||
"/*.js",
|
||||
"/*.d.ts",
|
||||
"/*.js.map",
|
||||
"esm",
|
||||
"src/*.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"bench": "node test/benchmark/index.js noble",
|
||||
"bench:all": "node test/benchmark/index.js",
|
||||
"bench:install": "cd test/benchmark && npm install && cd ../../",
|
||||
"build": "npm run build:clean; tsc && tsc -p tsconfig.esm.json",
|
||||
"build:release": "rollup -c build/rollup.config.js",
|
||||
"build:clean": "rm *.{js,d.ts,js.map} esm/*.{js,js.map}",
|
||||
"lint": "prettier --check 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'",
|
||||
"format": "prettier --write 'src/**/*.{js,ts}' 'test/**/*.{js,ts}'",
|
||||
"test": "node test/index.js",
|
||||
"test:dos": "node test/slow-dos.test.js",
|
||||
"test:big": "node test/slow-big.test.js"
|
||||
},
|
||||
"author": "Paul Miller (https://paulmillr.com)",
|
||||
"homepage": "https://paulmillr.com/noble/",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/paulmillr/noble-hashes.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"browser": {
|
||||
"crypto": false,
|
||||
"./crypto": "./cryptoBrowser.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-node-resolve": "13.3.0",
|
||||
"micro-bmark": "0.2.0",
|
||||
"micro-should": "0.2.0",
|
||||
"prettier": "2.6.2",
|
||||
"rollup": "2.75.5",
|
||||
"typescript": "4.7.3"
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./index.d.ts",
|
||||
"import": "./esm/index.js",
|
||||
"default": "./index.js"
|
||||
},
|
||||
"./crypto": {
|
||||
"types": "./crypto.d.ts",
|
||||
"browser": {
|
||||
"import": "./esm/cryptoBrowser.js",
|
||||
"default": "./cryptoBrowser.js"
|
||||
},
|
||||
"import": "./esm/crypto.js",
|
||||
"default": "./crypto.js"
|
||||
},
|
||||
"./_assert": {
|
||||
"types": "./_assert.d.ts",
|
||||
"import": "./esm/_assert.js",
|
||||
"default": "./_assert.js"
|
||||
},
|
||||
"./_sha2": {
|
||||
"types": "./_sha2.d.ts",
|
||||
"import": "./esm/_sha2.js",
|
||||
"default": "./_sha2.js"
|
||||
},
|
||||
"./argon2": {
|
||||
"types": "./argon2.d.ts",
|
||||
"import": "./esm/argon2.js",
|
||||
"default": "./argon2.js"
|
||||
},
|
||||
"./blake2b": {
|
||||
"types": "./blake2b.d.ts",
|
||||
"import": "./esm/blake2b.js",
|
||||
"default": "./blake2b.js"
|
||||
},
|
||||
"./blake2s": {
|
||||
"types": "./blake2s.d.ts",
|
||||
"import": "./esm/blake2s.js",
|
||||
"default": "./blake2s.js"
|
||||
},
|
||||
"./blake3": {
|
||||
"types": "./blake3.d.ts",
|
||||
"import": "./esm/blake3.js",
|
||||
"default": "./blake3.js"
|
||||
},
|
||||
"./eskdf": {
|
||||
"types": "./eskdf.d.ts",
|
||||
"import": "./esm/eskdf.js",
|
||||
"default": "./eskdf.js"
|
||||
},
|
||||
"./hkdf": {
|
||||
"types": "./hkdf.d.ts",
|
||||
"import": "./esm/hkdf.js",
|
||||
"default": "./hkdf.js"
|
||||
},
|
||||
"./hmac": {
|
||||
"types": "./hmac.d.ts",
|
||||
"import": "./esm/hmac.js",
|
||||
"default": "./hmac.js"
|
||||
},
|
||||
"./pbkdf2": {
|
||||
"types": "./pbkdf2.d.ts",
|
||||
"import": "./esm/pbkdf2.js",
|
||||
"default": "./pbkdf2.js"
|
||||
},
|
||||
"./ripemd160": {
|
||||
"types": "./ripemd160.d.ts",
|
||||
"import": "./esm/ripemd160.js",
|
||||
"default": "./ripemd160.js"
|
||||
},
|
||||
"./scrypt": {
|
||||
"types": "./scrypt.d.ts",
|
||||
"import": "./esm/scrypt.js",
|
||||
"default": "./scrypt.js"
|
||||
},
|
||||
"./sha1": {
|
||||
"types": "./sha1.d.ts",
|
||||
"import": "./esm/sha1.js",
|
||||
"default": "./sha1.js"
|
||||
},
|
||||
"./sha3-addons": {
|
||||
"types": "./sha3-addons.d.ts",
|
||||
"import": "./esm/sha3-addons.js",
|
||||
"default": "./sha3-addons.js"
|
||||
},
|
||||
"./sha3": {
|
||||
"types": "./sha3.d.ts",
|
||||
"import": "./esm/sha3.js",
|
||||
"default": "./sha3.js"
|
||||
},
|
||||
"./sha256": {
|
||||
"types": "./sha256.d.ts",
|
||||
"import": "./esm/sha256.js",
|
||||
"default": "./sha256.js"
|
||||
},
|
||||
"./sha512": {
|
||||
"types": "./sha512.d.ts",
|
||||
"import": "./esm/sha512.js",
|
||||
"default": "./sha512.js"
|
||||
},
|
||||
"./utils": {
|
||||
"types": "./utils.d.ts",
|
||||
"import": "./esm/utils.js",
|
||||
"default": "./utils.js"
|
||||
}
|
||||
},
|
||||
"keywords": [
|
||||
"sha",
|
||||
"sha2",
|
||||
"sha3",
|
||||
"sha256",
|
||||
"sha512",
|
||||
"keccak",
|
||||
"kangarootwelve",
|
||||
"ripemd160",
|
||||
"blake2",
|
||||
"blake3",
|
||||
"hmac",
|
||||
"hkdf",
|
||||
"pbkdf2",
|
||||
"scrypt",
|
||||
"kdf",
|
||||
"hash",
|
||||
"cryptography",
|
||||
"security",
|
||||
"noble"
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://paulmillr.com/funding/"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export type CreateRunnerOrganization = {
|
||||
address?: any;
|
||||
registrationEnabled?: boolean;
|
||||
name: string;
|
||||
contact?: number;
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
import assertString from './util/assertString';
|
||||
export default function toInt(str, radix) {
|
||||
assertString(str);
|
||||
return parseInt(str, radix || 10);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
|
||||
var isPlainObject = require("./is-plain-object")
|
||||
, forEach = require("./for-each")
|
||||
, process;
|
||||
|
||||
process = function self(value, key) {
|
||||
if (isPlainObject(value)) forEach(value, self, this);
|
||||
else this[key] = value;
|
||||
};
|
||||
|
||||
module.exports = function (obj) {
|
||||
var flattened = {};
|
||||
forEach(obj, process, flattened);
|
||||
return flattened;
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createDirentFromStats = void 0;
|
||||
class DirentFromStats {
|
||||
constructor(name, stats) {
|
||||
this.name = name;
|
||||
this.isBlockDevice = stats.isBlockDevice.bind(stats);
|
||||
this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
|
||||
this.isDirectory = stats.isDirectory.bind(stats);
|
||||
this.isFIFO = stats.isFIFO.bind(stats);
|
||||
this.isFile = stats.isFile.bind(stats);
|
||||
this.isSocket = stats.isSocket.bind(stats);
|
||||
this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
|
||||
}
|
||||
}
|
||||
function createDirentFromStats(name, stats) {
|
||||
return new DirentFromStats(name, stats);
|
||||
}
|
||||
exports.createDirentFromStats = createDirentFromStats;
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
describe("CSVError", function () {
|
||||
it("should toString()", function () {
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiL1VzZXJzL2t4aWFuZy93b3JrL3Byb2plY3RzL2NzdjJqc29uL3NyYy9DU1ZFcnJvci50ZXN0LnRzIiwic291cmNlcyI6WyIvVXNlcnMva3hpYW5nL3dvcmsvcHJvamVjdHMvY3N2Mmpzb24vc3JjL0NTVkVycm9yLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFFQSxRQUFRLENBQUMsVUFBVSxFQUFDO0lBQ2xCLEVBQUUsQ0FBRSxtQkFBbUIsRUFBQztJQUN4QixDQUFDLENBQUMsQ0FBQTtBQUNKLENBQUMsQ0FBQyxDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IENTVkVycm9yIGZyb20gXCIuL0NTVkVycm9yXCI7XG5pbXBvcnQgYXNzZXJ0IGZyb20gXCJhc3NlcnRcIjtcbmRlc2NyaWJlKFwiQ1NWRXJyb3JcIiwoKT0+e1xuICBpdCAoXCJzaG91bGQgdG9TdHJpbmcoKVwiLCgpPT57XG4gIH0pXG59KSJdfQ==
|
||||
@@ -0,0 +1,396 @@
|
||||
import { number as assertNumber } from './_assert.js';
|
||||
import { Input, toBytes, wrapConstructorWithOpts, u32, Hash, HashXOF } from './utils.js';
|
||||
import { Keccak, ShakeOpts } from './sha3.js';
|
||||
// cSHAKE && KMAC (NIST SP800-185)
|
||||
function leftEncode(n: number): Uint8Array {
|
||||
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: number): Uint8Array {
|
||||
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: ShakeOpts, outputLen: number): number {
|
||||
return opts.dkLen === undefined ? outputLen : opts.dkLen;
|
||||
}
|
||||
|
||||
const toBytesOptional = (buf?: Input) => (buf !== undefined ? 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: number, block: number) => new Uint8Array((block - (len % block)) % block);
|
||||
export type cShakeOpts = ShakeOpts & { personalization?: Input; NISTfn?: Input };
|
||||
|
||||
// Personalization
|
||||
function cshakePers(hash: Keccak, opts: cShakeOpts = {}): Keccak {
|
||||
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: number, blockLen: number, outputLen: number) =>
|
||||
wrapConstructorWithOpts<Keccak, cShakeOpts>((opts: cShakeOpts = {}) =>
|
||||
cshakePers(new Keccak(blockLen, suffix, chooseLen(opts, outputLen), true), opts)
|
||||
);
|
||||
|
||||
export const cshake128 = gencShake(0x1f, 168, 128 / 8);
|
||||
export const cshake256 = gencShake(0x1f, 136, 256 / 8);
|
||||
|
||||
class KMAC extends Keccak implements HashXOF<KMAC> {
|
||||
constructor(
|
||||
blockLen: number,
|
||||
outputLen: number,
|
||||
enableXOF: boolean,
|
||||
key: Input,
|
||||
opts: cShakeOpts = {}
|
||||
) {
|
||||
super(blockLen, 0x1f, outputLen, enableXOF);
|
||||
cshakePers(this, { NISTfn: 'KMAC', personalization: opts.personalization });
|
||||
key = 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));
|
||||
}
|
||||
protected finish() {
|
||||
if (!this.finished) this.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits
|
||||
super.finish();
|
||||
}
|
||||
_cloneInto(to?: KMAC): KMAC {
|
||||
// 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), {}) as KMAC;
|
||||
to.state = this.state.slice();
|
||||
to.blockLen = this.blockLen;
|
||||
to.state32 = u32(to.state);
|
||||
}
|
||||
return super._cloneInto(to) as KMAC;
|
||||
}
|
||||
clone(): KMAC {
|
||||
return this._cloneInto();
|
||||
}
|
||||
}
|
||||
|
||||
function genKmac(blockLen: number, outputLen: number, xof = false) {
|
||||
const kmac = (key: Input, message: Input, opts?: cShakeOpts): Uint8Array =>
|
||||
kmac.create(key, opts).update(message).digest();
|
||||
kmac.create = (key: Input, opts: cShakeOpts = {}) =>
|
||||
new KMAC(blockLen, chooseLen(opts, outputLen), xof, key, opts);
|
||||
return kmac;
|
||||
}
|
||||
|
||||
export const kmac128 = genKmac(168, 128 / 8);
|
||||
export const kmac256 = genKmac(136, 256 / 8);
|
||||
export const kmac128xof = genKmac(168, 128 / 8, true);
|
||||
export const kmac256xof = genKmac(136, 256 / 8, true);
|
||||
|
||||
// TupleHash
|
||||
// Usage: tuple(['ab', 'cd']) != tuple(['a', 'bcd'])
|
||||
class TupleHash extends Keccak implements HashXOF<TupleHash> {
|
||||
constructor(blockLen: number, outputLen: number, enableXOF: boolean, opts: cShakeOpts = {}) {
|
||||
super(blockLen, 0x1f, outputLen, enableXOF);
|
||||
cshakePers(this, { NISTfn: 'TupleHash', personalization: opts.personalization });
|
||||
// Change update after cshake processed
|
||||
this.update = (data: Input) => {
|
||||
data = toBytes(data);
|
||||
super.update(leftEncode(data.length * 8));
|
||||
super.update(data);
|
||||
return this;
|
||||
};
|
||||
}
|
||||
protected finish() {
|
||||
if (!this.finished) super.update(rightEncode(this.enableXOF ? 0 : this.outputLen * 8)); // outputLen in bits
|
||||
super.finish();
|
||||
}
|
||||
_cloneInto(to?: TupleHash): TupleHash {
|
||||
to ||= new TupleHash(this.blockLen, this.outputLen, this.enableXOF);
|
||||
return super._cloneInto(to) as TupleHash;
|
||||
}
|
||||
clone(): TupleHash {
|
||||
return this._cloneInto();
|
||||
}
|
||||
}
|
||||
|
||||
function genTuple(blockLen: number, outputLen: number, xof = false) {
|
||||
const tuple = (messages: Input[], opts?: cShakeOpts): Uint8Array => {
|
||||
const h = tuple.create(opts);
|
||||
for (const msg of messages) h.update(msg);
|
||||
return h.digest();
|
||||
};
|
||||
tuple.create = (opts: cShakeOpts = {}) =>
|
||||
new TupleHash(blockLen, chooseLen(opts, outputLen), xof, opts);
|
||||
return tuple;
|
||||
}
|
||||
|
||||
export const tuplehash128 = genTuple(168, 128 / 8);
|
||||
export const tuplehash256 = genTuple(136, 256 / 8);
|
||||
export const tuplehash128xof = genTuple(168, 128 / 8, true);
|
||||
export const tuplehash256xof = genTuple(136, 256 / 8, true);
|
||||
|
||||
// ParallelHash (same as K12/M14, but without speedup for inputs less 8kb, reduced number of rounds and more simple)
|
||||
type ParallelOpts = cShakeOpts & { blockLen?: number };
|
||||
|
||||
class ParallelHash extends Keccak implements HashXOF<ParallelHash> {
|
||||
private leafHash?: Hash<Keccak>;
|
||||
private chunkPos = 0; // Position of current block in chunk
|
||||
private chunksDone = 0; // How many chunks we already have
|
||||
private chunkLen: number;
|
||||
constructor(
|
||||
blockLen: number,
|
||||
outputLen: number,
|
||||
protected leafCons: () => Hash<Keccak>,
|
||||
enableXOF: boolean,
|
||||
opts: ParallelOpts = {}
|
||||
) {
|
||||
super(blockLen, 0x1f, outputLen, enableXOF);
|
||||
cshakePers(this, { NISTfn: 'ParallelHash', personalization: opts.personalization });
|
||||
let { blockLen: B } = opts;
|
||||
B ||= 8;
|
||||
assertNumber(B);
|
||||
this.chunkLen = B;
|
||||
super.update(leftEncode(B));
|
||||
// Change update after cshake processed
|
||||
this.update = (data: Input) => {
|
||||
data = 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;
|
||||
};
|
||||
}
|
||||
protected 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?: ParallelHash): ParallelHash {
|
||||
to ||= new ParallelHash(this.blockLen, this.outputLen, this.leafCons, this.enableXOF);
|
||||
if (this.leafHash) to.leafHash = this.leafHash._cloneInto(to.leafHash as Keccak);
|
||||
to.chunkPos = this.chunkPos;
|
||||
to.chunkLen = this.chunkLen;
|
||||
to.chunksDone = this.chunksDone;
|
||||
return super._cloneInto(to) as ParallelHash;
|
||||
}
|
||||
destroy() {
|
||||
super.destroy.call(this);
|
||||
if (this.leafHash) this.leafHash.destroy();
|
||||
}
|
||||
clone(): ParallelHash {
|
||||
return this._cloneInto();
|
||||
}
|
||||
}
|
||||
|
||||
function genParallel(
|
||||
blockLen: number,
|
||||
outputLen: number,
|
||||
leaf: ReturnType<typeof gencShake>,
|
||||
xof = false
|
||||
) {
|
||||
const parallel = (message: Input, opts?: ParallelOpts): Uint8Array =>
|
||||
parallel.create(opts).update(message).digest();
|
||||
parallel.create = (opts: ParallelOpts = {}) =>
|
||||
new ParallelHash(
|
||||
blockLen,
|
||||
chooseLen(opts, outputLen),
|
||||
() => leaf.create({ dkLen: 2 * outputLen }),
|
||||
xof,
|
||||
opts
|
||||
);
|
||||
return parallel;
|
||||
}
|
||||
|
||||
export const parallelhash128 = genParallel(168, 128 / 8, cshake128);
|
||||
export const parallelhash256 = genParallel(136, 256 / 8, cshake256);
|
||||
export const parallelhash128xof = genParallel(168, 128 / 8, cshake128, true);
|
||||
export const parallelhash256xof = genParallel(136, 256 / 8, cshake256, true);
|
||||
|
||||
// Kangaroo
|
||||
// Same as NIST rightEncode, but returns [0] for zero string
|
||||
function rightEncodeK12(n: number): Uint8Array {
|
||||
const res = [];
|
||||
for (; n > 0; n >>= 8) res.unshift(n & 0xff);
|
||||
res.push(res.length);
|
||||
return new Uint8Array(res);
|
||||
}
|
||||
|
||||
export type KangarooOpts = { dkLen?: number; personalization?: Input };
|
||||
const EMPTY = new Uint8Array([]);
|
||||
|
||||
class KangarooTwelve extends Keccak implements HashXOF<KangarooTwelve> {
|
||||
readonly chunkLen = 8192;
|
||||
private leafHash?: Keccak;
|
||||
private personalization: Uint8Array;
|
||||
private chunkPos = 0; // Position of current block in chunk
|
||||
private chunksDone = 0; // How many chunks we already have
|
||||
constructor(
|
||||
blockLen: number,
|
||||
protected leafLen: number,
|
||||
outputLen: number,
|
||||
rounds: number,
|
||||
opts: KangarooOpts
|
||||
) {
|
||||
super(blockLen, 0x07, outputLen, true, rounds);
|
||||
const { personalization } = opts;
|
||||
this.personalization = toBytesOptional(personalization);
|
||||
}
|
||||
update(data: Input) {
|
||||
data = 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 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;
|
||||
}
|
||||
protected 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?: KangarooTwelve): KangarooTwelve {
|
||||
const { blockLen, leafLen, leafHash, outputLen, rounds } = this;
|
||||
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(): KangarooTwelve {
|
||||
return this._cloneInto();
|
||||
}
|
||||
}
|
||||
// Default to 32 bytes, so it can be used without opts
|
||||
export const k12 = wrapConstructorWithOpts<KangarooTwelve, KangarooOpts>(
|
||||
(opts: KangarooOpts = {}) => new KangarooTwelve(168, 32, chooseLen(opts, 32), 12, opts)
|
||||
);
|
||||
// MarsupilamiFourteen
|
||||
export const m14 = wrapConstructorWithOpts<KangarooTwelve, KangarooOpts>(
|
||||
(opts: KangarooOpts = {}) => 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 Keccak {
|
||||
protected rate: number;
|
||||
constructor(capacity: number) {
|
||||
assertNumber(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: Input) {
|
||||
super.update(data);
|
||||
this.posOut = this.blockLen;
|
||||
return this;
|
||||
}
|
||||
feed(data: Input) {
|
||||
return this.update(data);
|
||||
}
|
||||
protected finish() {}
|
||||
digestInto(out: Uint8Array): Uint8Array {
|
||||
throw new Error('KeccakPRG: digest is not allowed, please use .fetch instead.');
|
||||
}
|
||||
fetch(bytes: number): Uint8Array {
|
||||
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?: KeccakPRG): KeccakPRG {
|
||||
const { rate } = this;
|
||||
to ||= new KeccakPRG(1600 - rate);
|
||||
super._cloneInto(to);
|
||||
to.rate = rate;
|
||||
return to;
|
||||
}
|
||||
clone(): KeccakPRG {
|
||||
return this._cloneInto();
|
||||
}
|
||||
}
|
||||
|
||||
export const keccakprg = (capacity = 254) => new KeccakPRG(capacity);
|
||||
@@ -0,0 +1,3 @@
|
||||
/** @type {typeof globalThis.Blob} */
|
||||
export const Blob: typeof globalThis.Blob;
|
||||
export default Blob;
|
||||
@@ -0,0 +1,2 @@
|
||||
declare const queueMicrotask: (cb: () => void) => void
|
||||
export = queueMicrotask
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('times', require('../times'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* This function is like `baseIndexOf` except that it accepts a comparator.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {*} value The value to search for.
|
||||
* @param {number} fromIndex The index to search from.
|
||||
* @param {Function} comparator The comparator invoked per element.
|
||||
* @returns {number} Returns the index of the matched value, else `-1`.
|
||||
*/
|
||||
function baseIndexOfWith(array, value, fromIndex, comparator) {
|
||||
var index = fromIndex - 1,
|
||||
length = array.length;
|
||||
|
||||
while (++index < length) {
|
||||
if (comparator(array[index], value)) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
module.exports = baseIndexOfWith;
|
||||
@@ -0,0 +1,17 @@
|
||||
var baseInverter = require('./_baseInverter');
|
||||
|
||||
/**
|
||||
* Creates a function like `_.invertBy`.
|
||||
*
|
||||
* @private
|
||||
* @param {Function} setter The function to set accumulator values.
|
||||
* @param {Function} toIteratee The function to resolve iteratees.
|
||||
* @returns {Function} Returns the new inverter function.
|
||||
*/
|
||||
function createInverter(setter, toIteratee) {
|
||||
return function(object, iteratee) {
|
||||
return baseInverter(object, setter, toIteratee(iteratee), {});
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = createInverter;
|
||||
@@ -0,0 +1,13 @@
|
||||
import Node from './shared/Node';
|
||||
import Expression from './shared/Expression';
|
||||
import Component from '../Component';
|
||||
import TemplateScope from './shared/TemplateScope';
|
||||
import { Directive } from '../../interfaces';
|
||||
export default class Action extends Node {
|
||||
type: 'Action';
|
||||
name: string;
|
||||
expression: Expression;
|
||||
uses_context: boolean;
|
||||
template_scope: TemplateScope;
|
||||
constructor(component: Component, parent: Node, scope: TemplateScope, info: Directive);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"name": "web-streams-ponyfill-es2018",
|
||||
"main": "../../dist/ponyfill.es2018",
|
||||
"module": "../../dist/ponyfill.es2018.mjs",
|
||||
"types": "../../dist/types/polyfill.d.ts"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
import e from"mri";const t="__all__",i="__default__",s="\n";function r(e){if(!e.length)return"";let t=function(e){let t=0,i=0,s=0,r=e.length;if(r)for(;r--;)i=e[r].length,i>t&&(s=r,t=i);return e[s].length}(e.map(e=>e[0]))+4;return e.map(e=>e[0]+" ".repeat(t-e[0].length)+e[1]+(null==e[2]?"":` (default ${e[2]})`))}function n(e){return e}function l(e,t,i){if(!t||!t.length)return"";let r=0,n="";for(n+="\n "+e;r<t.length;r++)n+="\n "+i(t[r]);return n+s}function a(e,t,i=1){let s=l("ERROR",[t],n);s+=`\n Run \`$ ${e} --help\` for more info.\n`,console.error(s),process.exit(i)}class o{constructor(e,s){let[r,...n]=e.split(/\s+/);s=s||n.length>0,this.bin=r,this.ver="0.0.0",this.default="",this.tree={},this.command(t),this.command([i].concat(s?n:"<command>").join(" ")),this.single=s,this.curr=""}command(e,t,i={}){if(this.single)throw new Error('Disable "single" mode to add commands');let s=[],r=[],n=/(\[|<)/;if(e.split(/\s+/).forEach(e=>{(n.test(e.charAt(0))?r:s).push(e)}),s=s.join(" "),s in this.tree)throw new Error("Command already exists: "+s);return s.includes("__")||r.unshift(s),r=r.join(" "),this.curr=s,i.default&&(this.default=s),this.tree[s]={usage:r,alibi:[],options:[],alias:{},default:{},examples:[]},i.alias&&this.alias(i.alias),t&&this.describe(t),this}describe(e){return this.tree[this.curr||i].describe=Array.isArray(e)?e:function(e){return(e||"").replace(/([.?!])\s*(?=[A-Z])/g,"$1|").split("|")}(e),this}alias(...e){if(this.single)throw new Error('Cannot call `alias()` in "single" mode');if(!this.curr)throw new Error("Cannot call `alias()` before defining a command");return(this.tree[this.curr].alibi=this.tree[this.curr].alibi.concat(...e)).forEach(e=>this.tree[e]=this.curr),this}option(e,i,s){let r=this.tree[this.curr||t],[n,l]=function(e){return(e||"").split(/^-{1,2}|,|\s+-{1,2}|\s+/).filter(Boolean)}(e);if(l&&l.length>1&&([n,l]=[l,n]),e="--"+n,l&&l.length>0){e=`-${l}, ${e}`;let t=r.alias[l];r.alias[l]=(t||[]).concat(n)}let a=[e,i||""];return void 0!==s?(a.push(s),r.default[n]=s):l||(r.default[n]=void 0),r.options.push(a),this}action(e){return this.tree[this.curr||i].handler=e,this}example(e){return this.tree[this.curr||i].examples.push(e),this}version(e){return this.ver=e,this}parse(s,r={}){s=s.slice();let n,l,o,h,u=2,f=e(s.slice(u),{alias:{h:"help",v:"version"}}),c=this.single,p=this.bin,d="";if(c)h=this.tree[i];else{let e,t=1,i=f._.length+1;for(;t<i;t++)if(n=f._.slice(0,t).join(" "),e=this.tree[n],"string"==typeof e)l=(d=e).split(" "),s.splice(s.indexOf(f._[0]),t,...l),t+=l.length-t;else if(e)d=n;else if(d)break;if(h=this.tree[d],o=void 0===h,o)if(this.default)d=this.default,h=this.tree[d],s.unshift(d),u++;else if(n)return a(p,"Invalid command: "+n)}if(f.help)return this.help(!c&&!o&&d);if(f.version)return this._version();if(!c&&void 0===h)return a(p,"No command specified.");let g=this.tree[t];r.alias=Object.assign(g.alias,h.alias,r.alias),r.default=Object.assign(g.default,h.default,r.default),n=d.split(" "),l=s.indexOf(n[0],2),~l&&s.splice(l,n.length);let m=e(s.slice(u),r);if(!m||"string"==typeof m)return a(p,m||"Parsed unknown option flag(s)!");let b=h.usage.split(/\s+/),_=b.filter(e=>"<"===e.charAt(0)),v=m._.splice(0,_.length);if(v.length<_.length)return d&&(p+=" "+d),a(p,"Insufficient arguments!");b.filter(e=>"["===e.charAt(0)).forEach(e=>{v.push(m._.shift())}),v.push(m);let $=h.handler;return r.lazy?{args:v,name:d,handler:$}:$.apply(null,v)}help(e){console.log(function(e,a,o,h){let u="",f=a[o],c="$ "+e,p=a[t],d=e=>`${c} ${e}`.replace(/\s+/g," "),g=[["-h, --help","Displays this message"]];if(o===i&&g.unshift(["-v, --version","Displays current version"]),f.options=(f.options||[]).concat(p.options,g),f.options.length>0&&(f.usage+=" [options]"),u+=l("Description",f.describe,n),u+=l("Usage",[f.usage],d),h||o!==i)h||o===i||(u+=l("Aliases",f.alibi,d));else{let e,t=/^__/,i="",o=[];for(e in a)"string"==typeof a[e]||t.test(e)||o.push([e,(a[e].describe||[""])[0]])<3&&(i+=`\n ${c} ${e} --help`);u+=l("Available Commands",r(o),n),u+="\n For more info, run any command with the `--help` flag"+i+s}return u+=l("Options",r(f.options),n),u+=l("Examples",f.examples.map(d),n),u}(this.bin,this.tree,e||i,this.single))}_version(){console.log(`${this.bin}, ${this.ver}`)}}export default(e,t)=>new o(e,t);
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require('./forEach');
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('tail', require('../tail'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "import-fresh",
|
||||
"version": "3.3.0",
|
||||
"description": "Import a module while bypassing the cache",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/import-fresh",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd",
|
||||
"heapdump": "node heapdump.js"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"require",
|
||||
"cache",
|
||||
"uncache",
|
||||
"uncached",
|
||||
"module",
|
||||
"fresh",
|
||||
"bypass"
|
||||
],
|
||||
"dependencies": {
|
||||
"parent-module": "^1.0.0",
|
||||
"resolve-from": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^1.0.1",
|
||||
"heapdump": "^0.3.12",
|
||||
"tsd": "^0.7.3",
|
||||
"xo": "^0.23.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
export type AddressCityEmptyError = {
|
||||
name: string;
|
||||
message: string;
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
import { urlAlphabet } from './url-alphabet/index.js'
|
||||
let random = bytes => crypto.getRandomValues(new Uint8Array(bytes))
|
||||
let customRandom = (alphabet, defaultSize, getRandom) => {
|
||||
let mask = (2 << (Math.log(alphabet.length - 1) / Math.LN2)) - 1
|
||||
let step = -~((1.6 * mask * defaultSize) / alphabet.length)
|
||||
return (size = defaultSize) => {
|
||||
let id = ''
|
||||
while (true) {
|
||||
let bytes = getRandom(step)
|
||||
let j = step
|
||||
while (j--) {
|
||||
id += alphabet[bytes[j] & mask] || ''
|
||||
if (id.length === size) return id
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let customAlphabet = (alphabet, size = 21) =>
|
||||
customRandom(alphabet, size, random)
|
||||
let nanoid = (size = 21) =>
|
||||
crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
|
||||
byte &= 63
|
||||
if (byte < 36) {
|
||||
id += byte.toString(36)
|
||||
} else if (byte < 62) {
|
||||
id += (byte - 26).toString(36).toUpperCase()
|
||||
} else if (byte > 62) {
|
||||
id += '-'
|
||||
} else {
|
||||
id += '_'
|
||||
}
|
||||
return id
|
||||
}, '')
|
||||
export { nanoid, customAlphabet, customRandom, urlAlphabet, random }
|
||||
@@ -0,0 +1,18 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Type = require('../Type');
|
||||
|
||||
// https://262.ecma-international.org/11.0/#sec-numeric-types-bigint-add
|
||||
|
||||
module.exports = function BigIntAdd(x, y) {
|
||||
if (Type(x) !== 'BigInt' || Type(y) !== 'BigInt') {
|
||||
throw new $TypeError('Assertion failed: `x` and `y` arguments must be BigInts');
|
||||
}
|
||||
|
||||
// shortcut for the actual spec mechanics
|
||||
return x + y;
|
||||
};
|
||||
Reference in New Issue
Block a user