new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"merge.js","sourceRoot":"","sources":["../../../../src/internal/operators/merge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAiB1C,MAAM,UAAU,KAAK,CAAI,GAAG,IAAe;IACzC,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,UAAU,GAAG,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC7C,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAE5B,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,QAAQ,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,GAAI,IAA6B,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAC3G,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var value = require('es5-ext/object/valid-object')
|
||||
|
||||
, hasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
module.exports = function (emitter/*, type*/) {
|
||||
var type = arguments[1], data;
|
||||
|
||||
value(emitter);
|
||||
|
||||
if (type !== undefined) {
|
||||
data = hasOwnProperty.call(emitter, '__ee__') && emitter.__ee__;
|
||||
if (!data) return;
|
||||
if (data[type]) delete data[type];
|
||||
return;
|
||||
}
|
||||
if (hasOwnProperty.call(emitter, '__ee__')) delete emitter.__ee__;
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ReceiveBuffer = void 0;
|
||||
class ReceiveBuffer {
|
||||
constructor(size = 4096) {
|
||||
this.buffer = Buffer.allocUnsafe(size);
|
||||
this.offset = 0;
|
||||
this.originalSize = size;
|
||||
}
|
||||
get length() {
|
||||
return this.offset;
|
||||
}
|
||||
append(data) {
|
||||
if (!Buffer.isBuffer(data)) {
|
||||
throw new Error('Attempted to append a non-buffer instance to ReceiveBuffer.');
|
||||
}
|
||||
if (this.offset + data.length >= this.buffer.length) {
|
||||
const tmp = this.buffer;
|
||||
this.buffer = Buffer.allocUnsafe(Math.max(this.buffer.length + this.originalSize, this.buffer.length + data.length));
|
||||
tmp.copy(this.buffer);
|
||||
}
|
||||
data.copy(this.buffer, this.offset);
|
||||
return (this.offset += data.length);
|
||||
}
|
||||
peek(length) {
|
||||
if (length > this.offset) {
|
||||
throw new Error('Attempted to read beyond the bounds of the managed internal data.');
|
||||
}
|
||||
return this.buffer.slice(0, length);
|
||||
}
|
||||
get(length) {
|
||||
if (length > this.offset) {
|
||||
throw new Error('Attempted to read beyond the bounds of the managed internal data.');
|
||||
}
|
||||
const value = Buffer.allocUnsafe(length);
|
||||
this.buffer.slice(0, length).copy(value);
|
||||
this.buffer.copyWithin(0, length, length + this.offset - length);
|
||||
this.offset -= length;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
exports.ReceiveBuffer = ReceiveBuffer;
|
||||
//# sourceMappingURL=receivebuffer.js.map
|
||||
@@ -0,0 +1,51 @@
|
||||
var baseTimes = require('./_baseTimes'),
|
||||
castFunction = require('./_castFunction'),
|
||||
toInteger = require('./toInteger');
|
||||
|
||||
/** Used as references for various `Number` constants. */
|
||||
var MAX_SAFE_INTEGER = 9007199254740991;
|
||||
|
||||
/** Used as references for the maximum length and index of an array. */
|
||||
var MAX_ARRAY_LENGTH = 4294967295;
|
||||
|
||||
/* Built-in method references for those with the same name as other `lodash` methods. */
|
||||
var nativeMin = Math.min;
|
||||
|
||||
/**
|
||||
* Invokes the iteratee `n` times, returning an array of the results of
|
||||
* each invocation. The iteratee is invoked with one argument; (index).
|
||||
*
|
||||
* @static
|
||||
* @since 0.1.0
|
||||
* @memberOf _
|
||||
* @category Util
|
||||
* @param {number} n The number of times to invoke `iteratee`.
|
||||
* @param {Function} [iteratee=_.identity] The function invoked per iteration.
|
||||
* @returns {Array} Returns the array of results.
|
||||
* @example
|
||||
*
|
||||
* _.times(3, String);
|
||||
* // => ['0', '1', '2']
|
||||
*
|
||||
* _.times(4, _.constant(0));
|
||||
* // => [0, 0, 0, 0]
|
||||
*/
|
||||
function times(n, iteratee) {
|
||||
n = toInteger(n);
|
||||
if (n < 1 || n > MAX_SAFE_INTEGER) {
|
||||
return [];
|
||||
}
|
||||
var index = MAX_ARRAY_LENGTH,
|
||||
length = nativeMin(n, MAX_ARRAY_LENGTH);
|
||||
|
||||
iteratee = castFunction(iteratee);
|
||||
n -= MAX_ARRAY_LENGTH;
|
||||
|
||||
var result = baseTimes(length, iteratee);
|
||||
while (++index < n) {
|
||||
iteratee(index);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = times;
|
||||
@@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isCreditCard;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
var _isLuhnNumber = _interopRequireDefault(require("./isLuhnNumber"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var cards = {
|
||||
amex: /^3[47][0-9]{13}$/,
|
||||
dinersclub: /^3(?:0[0-5]|[68][0-9])[0-9]{11}$/,
|
||||
discover: /^6(?:011|5[0-9][0-9])[0-9]{12,15}$/,
|
||||
jcb: /^(?:2131|1800|35\d{3})\d{11}$/,
|
||||
mastercard: /^5[1-5][0-9]{2}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$/,
|
||||
// /^[25][1-7][0-9]{14}$/;
|
||||
unionpay: /^(6[27][0-9]{14}|^(81[0-9]{14,17}))$/,
|
||||
visa: /^(?:4[0-9]{12})(?:[0-9]{3,6})?$/
|
||||
};
|
||||
/* eslint-disable max-len */
|
||||
|
||||
var allCards = /^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14}|^(81[0-9]{14,17}))$/;
|
||||
/* eslint-enable max-len */
|
||||
|
||||
function isCreditCard(card) {
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
(0, _assertString.default)(card);
|
||||
var provider = options.provider;
|
||||
var sanitized = card.replace(/[- ]+/g, '');
|
||||
|
||||
if (provider && provider.toLowerCase() in cards) {
|
||||
// specific provider in the list
|
||||
if (!cards[provider.toLowerCase()].test(sanitized)) {
|
||||
return false;
|
||||
}
|
||||
} else if (provider && !(provider.toLowerCase() in cards)) {
|
||||
/* specific provider not in the list */
|
||||
throw new Error("".concat(provider, " is not a valid credit card provider."));
|
||||
} else if (!allCards.test(sanitized)) {
|
||||
// no specific provider
|
||||
return false;
|
||||
}
|
||||
|
||||
return (0, _isLuhnNumber.default)(card);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,2 @@
|
||||
if(typeof cptable === 'undefined') cptable = {};
|
||||
cptable[10007] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"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"}
|
||||
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
|
||||
var isValue = require("es5-ext/object/is-value")
|
||||
, isPromise = require("es5-ext/object/is-promise")
|
||||
, nextTick = require("next-tick")
|
||||
, ensureTimeout = require("../valid-timeout");
|
||||
|
||||
module.exports = function (/* timeout */) {
|
||||
var Constructor = isPromise(this) ? this.constructor : Promise;
|
||||
var timeout = arguments[0];
|
||||
if (isValue(timeout)) timeout = ensureTimeout(timeout);
|
||||
return new Constructor(function (resolve) {
|
||||
if (isValue(timeout)) {
|
||||
setTimeout(function () {
|
||||
resolve();
|
||||
}, timeout);
|
||||
} else {
|
||||
nextTick(resolve);
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
1.0.2 / 2015-10-07
|
||||
==================
|
||||
|
||||
* use try/catch when checking `localStorage` (#3, @kumavis)
|
||||
|
||||
1.0.1 / 2014-11-25
|
||||
==================
|
||||
|
||||
* browser: use `console.warn()` for deprecation calls
|
||||
* browser: more jsdocs
|
||||
|
||||
1.0.0 / 2014-04-30
|
||||
==================
|
||||
|
||||
* initial commit
|
||||
@@ -0,0 +1,64 @@
|
||||
import type * as postcss from 'postcss';
|
||||
import type { Options as SassOptions, render, renderSync } from 'sass';
|
||||
import type { Options as PugOptions } from 'pug';
|
||||
import type { TransformOptions as BabelOptions } from '@babel/core';
|
||||
declare type ContentModifier = {
|
||||
prependData?: string;
|
||||
stripIndent?: boolean;
|
||||
};
|
||||
declare type MarkupOptions = {
|
||||
markupTagName?: string;
|
||||
};
|
||||
export declare type Coffeescript = {
|
||||
sourceMap?: boolean;
|
||||
filename?: never;
|
||||
bare?: never;
|
||||
} & ContentModifier;
|
||||
export declare type Postcss = postcss.ProcessOptions & {
|
||||
plugins?: postcss.AcceptedPlugin[];
|
||||
configFilePath?: string;
|
||||
} & ContentModifier;
|
||||
export declare type Babel = BabelOptions & {
|
||||
sourceType?: 'module';
|
||||
minified?: false;
|
||||
ast?: false;
|
||||
code?: true;
|
||||
sourceMaps?: boolean;
|
||||
} & ContentModifier;
|
||||
export declare type Pug = Omit<PugOptions, 'filename' | 'doctype' | 'compileDebug'> & ContentModifier & MarkupOptions;
|
||||
export declare type Sass = Omit<SassOptions, 'file' | 'data'> & {
|
||||
implementation?: {
|
||||
render?: typeof render;
|
||||
renderSync?: typeof renderSync;
|
||||
};
|
||||
renderSync?: boolean;
|
||||
} & ContentModifier;
|
||||
export declare type Less = {
|
||||
paths?: string[];
|
||||
plugins?: any[];
|
||||
strictImports?: boolean;
|
||||
maxLineLen?: number;
|
||||
dumpLineNumbers?: 'comment' | string;
|
||||
silent?: boolean;
|
||||
strictUnits?: boolean;
|
||||
globalVars?: Record<string, string>;
|
||||
modifyVars?: Record<string, string>;
|
||||
} & ContentModifier;
|
||||
export declare type Stylus = {
|
||||
globals?: Record<string, any>;
|
||||
functions?: Record<string, any>;
|
||||
imports?: string[];
|
||||
paths?: string[];
|
||||
sourcemap?: boolean;
|
||||
} & ContentModifier;
|
||||
export declare type Typescript = {
|
||||
compilerOptions?: any;
|
||||
tsconfigFile?: string | boolean;
|
||||
tsconfigDirectory?: string | boolean;
|
||||
reportDiagnostics?: boolean;
|
||||
} & ContentModifier;
|
||||
export interface GlobalStyle {
|
||||
sourceMap: boolean;
|
||||
}
|
||||
export declare type Replace = Array<[string | RegExp, string] | [RegExp, (substring: string, ...args: any[]) => string]>;
|
||||
export {};
|
||||
@@ -0,0 +1,123 @@
|
||||
'use strict';
|
||||
|
||||
var ee = require('../');
|
||||
|
||||
module.exports = function (t) {
|
||||
|
||||
return {
|
||||
"": function (a) {
|
||||
var x = {}, y = {}, z = {}, count, count2, count3;
|
||||
|
||||
ee(x);
|
||||
ee(y);
|
||||
ee(z);
|
||||
|
||||
count = 0;
|
||||
count2 = 0;
|
||||
count3 = 0;
|
||||
x.on('foo', function () { ++count; });
|
||||
y.on('foo', function () { ++count2; });
|
||||
z.on('foo', function () { ++count3; });
|
||||
|
||||
x.emit('foo');
|
||||
a(count, 1, "Pre unify, x");
|
||||
a(count2, 0, "Pre unify, y");
|
||||
a(count3, 0, "Pre unify, z");
|
||||
|
||||
t(x, y);
|
||||
a(x.__ee__, y.__ee__, "Post unify y");
|
||||
x.emit('foo');
|
||||
a(count, 2, "Post unify, x");
|
||||
a(count2, 1, "Post unify, y");
|
||||
a(count3, 0, "Post unify, z");
|
||||
|
||||
y.emit('foo');
|
||||
a(count, 3, "Post unify, on y, x");
|
||||
a(count2, 2, "Post unify, on y, y");
|
||||
a(count3, 0, "Post unify, on y, z");
|
||||
|
||||
t(x, z);
|
||||
a(x.__ee__, x.__ee__, "Post unify z");
|
||||
x.emit('foo');
|
||||
a(count, 4, "Post unify z, x");
|
||||
a(count2, 3, "Post unify z, y");
|
||||
a(count3, 1, "Post unify z, z");
|
||||
},
|
||||
"On empty": function (a) {
|
||||
var x = {}, y = {}, z = {}, count, count2, count3;
|
||||
|
||||
ee(x);
|
||||
ee(y);
|
||||
ee(z);
|
||||
|
||||
count = 0;
|
||||
count2 = 0;
|
||||
count3 = 0;
|
||||
y.on('foo', function () { ++count2; });
|
||||
x.emit('foo');
|
||||
a(count, 0, "Pre unify, x");
|
||||
a(count2, 0, "Pre unify, y");
|
||||
a(count3, 0, "Pre unify, z");
|
||||
|
||||
t(x, y);
|
||||
a(x.__ee__, y.__ee__, "Post unify y");
|
||||
x.on('foo', function () { ++count; });
|
||||
x.emit('foo');
|
||||
a(count, 1, "Post unify, x");
|
||||
a(count2, 1, "Post unify, y");
|
||||
a(count3, 0, "Post unify, z");
|
||||
|
||||
y.emit('foo');
|
||||
a(count, 2, "Post unify, on y, x");
|
||||
a(count2, 2, "Post unify, on y, y");
|
||||
a(count3, 0, "Post unify, on y, z");
|
||||
|
||||
t(x, z);
|
||||
a(x.__ee__, z.__ee__, "Post unify z");
|
||||
z.on('foo', function () { ++count3; });
|
||||
x.emit('foo');
|
||||
a(count, 3, "Post unify z, x");
|
||||
a(count2, 3, "Post unify z, y");
|
||||
a(count3, 1, "Post unify z, z");
|
||||
},
|
||||
Many: function (a) {
|
||||
var x = {}, y = {}, z = {}, count, count2, count3;
|
||||
|
||||
ee(x);
|
||||
ee(y);
|
||||
ee(z);
|
||||
|
||||
count = 0;
|
||||
count2 = 0;
|
||||
count3 = 0;
|
||||
x.on('foo', function () { ++count; });
|
||||
y.on('foo', function () { ++count2; });
|
||||
y.on('foo', function () { ++count2; });
|
||||
z.on('foo', function () { ++count3; });
|
||||
|
||||
x.emit('foo');
|
||||
a(count, 1, "Pre unify, x");
|
||||
a(count2, 0, "Pre unify, y");
|
||||
a(count3, 0, "Pre unify, z");
|
||||
|
||||
t(x, y);
|
||||
a(x.__ee__, y.__ee__, "Post unify y");
|
||||
x.emit('foo');
|
||||
a(count, 2, "Post unify, x");
|
||||
a(count2, 2, "Post unify, y");
|
||||
a(count3, 0, "Post unify, z");
|
||||
|
||||
y.emit('foo');
|
||||
a(count, 3, "Post unify, on y, x");
|
||||
a(count2, 4, "Post unify, on y, y");
|
||||
a(count3, 0, "Post unify, on y, z");
|
||||
|
||||
t(x, z);
|
||||
a(x.__ee__, x.__ee__, "Post unify z");
|
||||
x.emit('foo');
|
||||
a(count, 4, "Post unify z, x");
|
||||
a(count2, 6, "Post unify z, y");
|
||||
a(count3, 1, "Post unify z, z");
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
'use strict';
|
||||
module.exports = /^#!(.*)/;
|
||||
@@ -0,0 +1,52 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { Subscription } from '../Subscription';
|
||||
import { Scheduler } from '../Scheduler';
|
||||
import { TestMessage } from './TestMessage';
|
||||
import { SubscriptionLog } from './SubscriptionLog';
|
||||
import { SubscriptionLoggable } from './SubscriptionLoggable';
|
||||
import { applyMixins } from '../util/applyMixins';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { observeNotification } from '../Notification';
|
||||
|
||||
export class ColdObservable<T> extends Observable<T> implements SubscriptionLoggable {
|
||||
public subscriptions: SubscriptionLog[] = [];
|
||||
scheduler: Scheduler;
|
||||
// @ts-ignore: Property has no initializer and is not definitely assigned
|
||||
logSubscribedFrame: () => number;
|
||||
// @ts-ignore: Property has no initializer and is not definitely assigned
|
||||
logUnsubscribedFrame: (index: number) => void;
|
||||
|
||||
constructor(public messages: TestMessage[], scheduler: Scheduler) {
|
||||
super(function (this: Observable<T>, subscriber: Subscriber<any>) {
|
||||
const observable: ColdObservable<T> = this as any;
|
||||
const index = observable.logSubscribedFrame();
|
||||
const subscription = new Subscription();
|
||||
subscription.add(
|
||||
new Subscription(() => {
|
||||
observable.logUnsubscribedFrame(index);
|
||||
})
|
||||
);
|
||||
observable.scheduleMessages(subscriber);
|
||||
return subscription;
|
||||
});
|
||||
this.scheduler = scheduler;
|
||||
}
|
||||
|
||||
scheduleMessages(subscriber: Subscriber<any>) {
|
||||
const messagesLength = this.messages.length;
|
||||
for (let i = 0; i < messagesLength; i++) {
|
||||
const message = this.messages[i];
|
||||
subscriber.add(
|
||||
this.scheduler.schedule(
|
||||
(state) => {
|
||||
const { message: { notification }, subscriber: destination } = state!;
|
||||
observeNotification(notification, destination);
|
||||
},
|
||||
message.frame,
|
||||
{ message, subscriber }
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
applyMixins(ColdObservable, [SubscriptionLoggable]);
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"joinAllInternals.js","sourceRoot":"","sources":["../../../../src/internal/operators/joinAllInternals.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYpC,MAAM,UAAU,gBAAgB,CAAO,MAAwD,EAAE,OAA+B;IAC9H,OAAO,IAAI,CAGT,OAAO,EAAgE,EAEvE,QAAQ,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAEtC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,QAAgB,CACxD,CAAC;AACJ,CAAC"}
|
||||
@@ -0,0 +1,246 @@
|
||||
import assert from './_assert.js';
|
||||
import u64 from './_u64.js';
|
||||
import { BLAKE2 } from './_blake2.js';
|
||||
import { compress, IV } from './blake2s.js';
|
||||
import { Input, u8, u32, toBytes, wrapConstructorWithOpts, HashXOF } from './utils.js';
|
||||
|
||||
// Flag bitset
|
||||
enum Flags {
|
||||
CHUNK_START = 1 << 0,
|
||||
CHUNK_END = 1 << 1,
|
||||
PARENT = 1 << 2,
|
||||
ROOT = 1 << 3,
|
||||
KEYED_HASH = 1 << 4,
|
||||
DERIVE_KEY_CONTEXT = 1 << 5,
|
||||
DERIVE_KEY_MATERIAL = 1 << 6,
|
||||
}
|
||||
|
||||
const SIGMA: Uint8Array = (() => {
|
||||
const Id = Array.from({ length: 16 }, (_, i) => i);
|
||||
const permute = (arr: number[]) =>
|
||||
[2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8].map((i) => arr[i]);
|
||||
const res: number[] = [];
|
||||
for (let i = 0, v = Id; i < 7; i++, v = permute(v)) res.push(...v);
|
||||
return Uint8Array.from(res);
|
||||
})();
|
||||
|
||||
// - key: is 256-bit key
|
||||
// - context: string should be hardcoded, globally unique, and application - specific.
|
||||
// A good default format for the context string is "[application] [commit timestamp] [purpose]"
|
||||
// - Only one of 'key' (keyed mode) or 'context' (derive key mode) can be used at same time
|
||||
export type Blake3Opts = { dkLen?: number; key?: Input; context?: Input };
|
||||
|
||||
// Why is this so slow? It should be 6x faster than blake2b.
|
||||
// - There is only 30% reduction in number of rounds from blake2s
|
||||
// - This function uses tree mode to achive parallelisation via SIMD and threading,
|
||||
// however in JS we don't have threads and SIMD, so we get only overhead from tree structure
|
||||
// - It is possible to speed it up via Web Workers, hovewer it will make code singnificantly more
|
||||
// complicated, which we are trying to avoid, since this library is intended to be used
|
||||
// for cryptographic purposes. Also, parallelization happens only on chunk level (1024 bytes),
|
||||
// which won't really benefit small inputs.
|
||||
class BLAKE3 extends BLAKE2<BLAKE3> implements HashXOF<BLAKE3> {
|
||||
private IV: Uint32Array;
|
||||
private flags = 0 | 0;
|
||||
private state: Uint32Array;
|
||||
private chunkPos = 0; // Position of current block in chunk
|
||||
private chunksDone = 0; // How many chunks we already have
|
||||
private stack: Uint32Array[] = [];
|
||||
// Output
|
||||
private posOut = 0;
|
||||
private bufferOut32 = new Uint32Array(16);
|
||||
private bufferOut: Uint8Array;
|
||||
private chunkOut = 0; // index of output chunk
|
||||
private enableXOF = true;
|
||||
|
||||
constructor(opts: Blake3Opts = {}, flags = 0) {
|
||||
super(64, opts.dkLen === undefined ? 32 : opts.dkLen, {}, Number.MAX_SAFE_INTEGER, 0, 0);
|
||||
this.outputLen = opts.dkLen === undefined ? 32 : opts.dkLen;
|
||||
assert.number(this.outputLen);
|
||||
if (opts.key !== undefined && opts.context !== undefined)
|
||||
throw new Error('Blake3: only key or context can be specified at same time');
|
||||
else if (opts.key !== undefined) {
|
||||
const key = toBytes(opts.key);
|
||||
if (key.length !== 32) throw new Error('Blake3: key should be 32 byte');
|
||||
this.IV = u32(key);
|
||||
this.flags = flags | Flags.KEYED_HASH;
|
||||
} else if (opts.context !== undefined) {
|
||||
const context_key = new BLAKE3({ dkLen: 32 }, Flags.DERIVE_KEY_CONTEXT)
|
||||
.update(opts.context)
|
||||
.digest();
|
||||
this.IV = u32(context_key);
|
||||
this.flags = flags | Flags.DERIVE_KEY_MATERIAL;
|
||||
} else {
|
||||
this.IV = IV.slice();
|
||||
this.flags = flags;
|
||||
}
|
||||
this.state = this.IV.slice();
|
||||
this.bufferOut = u8(this.bufferOut32);
|
||||
}
|
||||
// Unused
|
||||
protected get() {
|
||||
return [];
|
||||
}
|
||||
protected set() {}
|
||||
private b2Compress(counter: number, flags: number, buf: Uint32Array, bufPos: number = 0) {
|
||||
const { state: s, pos } = this;
|
||||
const { h, l } = u64.fromBig(BigInt(counter), true);
|
||||
// prettier-ignore
|
||||
const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } =
|
||||
compress(
|
||||
SIGMA, bufPos, buf, 7,
|
||||
s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7],
|
||||
IV[0], IV[1], IV[2], IV[3], h, l, pos, flags
|
||||
);
|
||||
s[0] = v0 ^ v8;
|
||||
s[1] = v1 ^ v9;
|
||||
s[2] = v2 ^ v10;
|
||||
s[3] = v3 ^ v11;
|
||||
s[4] = v4 ^ v12;
|
||||
s[5] = v5 ^ v13;
|
||||
s[6] = v6 ^ v14;
|
||||
s[7] = v7 ^ v15;
|
||||
}
|
||||
protected compress(buf: Uint32Array, bufPos: number = 0, isLast: boolean = false) {
|
||||
// Compress last block
|
||||
let flags = this.flags;
|
||||
if (!this.chunkPos) flags |= Flags.CHUNK_START;
|
||||
if (this.chunkPos === 15 || isLast) flags |= Flags.CHUNK_END;
|
||||
if (!isLast) this.pos = this.blockLen;
|
||||
this.b2Compress(this.chunksDone, flags, buf, bufPos);
|
||||
this.chunkPos += 1;
|
||||
// If current block is last in chunk (16 blocks), then compress chunks
|
||||
if (this.chunkPos === 16 || isLast) {
|
||||
let chunk = this.state;
|
||||
this.state = this.IV.slice();
|
||||
// If not the last one, compress only when there are trailing zeros in chunk counter
|
||||
// chunks used as binary tree where current stack is path. Zero means current leaf is finished and can be compressed.
|
||||
// 1 (001) - leaf not finished (just push current chunk to stack)
|
||||
// 2 (010) - leaf finished at depth=1 (merge with last elm on stack and push back)
|
||||
// 3 (011) - last leaf not finished
|
||||
// 4 (100) - leafs finished at depth=1 and depth=2
|
||||
for (let last, chunks = this.chunksDone + 1; isLast || !(chunks & 1); chunks >>= 1) {
|
||||
if (!(last = this.stack.pop())) break;
|
||||
this.buffer32.set(last, 0);
|
||||
this.buffer32.set(chunk, 8);
|
||||
this.pos = this.blockLen;
|
||||
this.b2Compress(0, this.flags | Flags.PARENT, this.buffer32, 0);
|
||||
chunk = this.state;
|
||||
this.state = this.IV.slice();
|
||||
}
|
||||
this.chunksDone++;
|
||||
this.chunkPos = 0;
|
||||
this.stack.push(chunk);
|
||||
}
|
||||
this.pos = 0;
|
||||
}
|
||||
_cloneInto(to?: BLAKE3): BLAKE3 {
|
||||
to = super._cloneInto(to) as BLAKE3;
|
||||
const { IV, flags, state, chunkPos, posOut, chunkOut, stack, chunksDone } = this;
|
||||
to.state.set(state.slice());
|
||||
to.stack = stack.map((i) => Uint32Array.from(i));
|
||||
to.IV.set(IV);
|
||||
to.flags = flags;
|
||||
to.chunkPos = chunkPos;
|
||||
to.chunksDone = chunksDone;
|
||||
to.posOut = posOut;
|
||||
to.chunkOut = chunkOut;
|
||||
to.enableXOF = this.enableXOF;
|
||||
to.bufferOut32.set(this.bufferOut32);
|
||||
return to;
|
||||
}
|
||||
destroy() {
|
||||
this.destroyed = true;
|
||||
this.state.fill(0);
|
||||
this.buffer32.fill(0);
|
||||
this.IV.fill(0);
|
||||
this.bufferOut32.fill(0);
|
||||
for (let i of this.stack) i.fill(0);
|
||||
}
|
||||
// Same as b2Compress, but doesn't modify state and returns 16 u32 array (instead of 8)
|
||||
private b2CompressOut() {
|
||||
const { state: s, pos, flags, buffer32, bufferOut32: out32 } = this;
|
||||
const { h, l } = u64.fromBig(BigInt(this.chunkOut++));
|
||||
// prettier-ignore
|
||||
const { v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, v10, v11, v12, v13, v14, v15 } =
|
||||
compress(
|
||||
SIGMA, 0, buffer32, 7,
|
||||
s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7],
|
||||
IV[0], IV[1], IV[2], IV[3], l, h, pos, flags
|
||||
);
|
||||
out32[0] = v0 ^ v8;
|
||||
out32[1] = v1 ^ v9;
|
||||
out32[2] = v2 ^ v10;
|
||||
out32[3] = v3 ^ v11;
|
||||
out32[4] = v4 ^ v12;
|
||||
out32[5] = v5 ^ v13;
|
||||
out32[6] = v6 ^ v14;
|
||||
out32[7] = v7 ^ v15;
|
||||
out32[8] = s[0] ^ v8;
|
||||
out32[9] = s[1] ^ v9;
|
||||
out32[10] = s[2] ^ v10;
|
||||
out32[11] = s[3] ^ v11;
|
||||
out32[12] = s[4] ^ v12;
|
||||
out32[13] = s[5] ^ v13;
|
||||
out32[14] = s[6] ^ v14;
|
||||
out32[15] = s[7] ^ v15;
|
||||
this.posOut = 0;
|
||||
}
|
||||
protected finish() {
|
||||
if (this.finished) return;
|
||||
this.finished = true;
|
||||
// Padding
|
||||
this.buffer.fill(0, this.pos);
|
||||
// Process last chunk
|
||||
let flags = this.flags | Flags.ROOT;
|
||||
if (this.stack.length) {
|
||||
flags |= Flags.PARENT;
|
||||
this.compress(this.buffer32, 0, true);
|
||||
this.chunksDone = 0;
|
||||
this.pos = this.blockLen;
|
||||
} else {
|
||||
flags |= (!this.chunkPos ? Flags.CHUNK_START : 0) | Flags.CHUNK_END;
|
||||
}
|
||||
this.flags = flags;
|
||||
this.b2CompressOut();
|
||||
}
|
||||
private writeInto(out: Uint8Array) {
|
||||
assert.exists(this, false);
|
||||
assert.bytes(out);
|
||||
this.finish();
|
||||
const { blockLen, bufferOut } = this;
|
||||
for (let pos = 0, len = out.length; pos < len; ) {
|
||||
if (this.posOut >= blockLen) this.b2CompressOut();
|
||||
const take = Math.min(blockLen - this.posOut, len - pos);
|
||||
out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
|
||||
this.posOut += take;
|
||||
pos += take;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
xofInto(out: Uint8Array): Uint8Array {
|
||||
if (!this.enableXOF) throw new Error('XOF is not possible after digest call');
|
||||
return this.writeInto(out);
|
||||
}
|
||||
xof(bytes: number): Uint8Array {
|
||||
assert.number(bytes);
|
||||
return this.xofInto(new Uint8Array(bytes));
|
||||
}
|
||||
digestInto(out: Uint8Array) {
|
||||
assert.output(out, this);
|
||||
if (this.finished) throw new Error('digest() was already called');
|
||||
this.enableXOF = false;
|
||||
this.writeInto(out);
|
||||
this.destroy();
|
||||
return out;
|
||||
}
|
||||
digest() {
|
||||
return this.digestInto(new Uint8Array(this.outputLen));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* BLAKE3 hash function.
|
||||
* @param msg - message that would be hashed
|
||||
* @param opts - dkLen, key, context
|
||||
*/
|
||||
export const blake3 = wrapConstructorWithOpts<BLAKE3, Blake3Opts>((opts) => new BLAKE3(opts));
|
||||
@@ -0,0 +1,48 @@
|
||||
# function-bind
|
||||
|
||||
<!--
|
||||
[![build status][travis-svg]][travis-url]
|
||||
[![NPM version][npm-badge-svg]][npm-url]
|
||||
[![Coverage Status][5]][6]
|
||||
[![gemnasium Dependency Status][7]][8]
|
||||
[![Dependency status][deps-svg]][deps-url]
|
||||
[![Dev Dependency status][dev-deps-svg]][dev-deps-url]
|
||||
-->
|
||||
|
||||
<!-- [![browser support][11]][12] -->
|
||||
|
||||
Implementation of function.prototype.bind
|
||||
|
||||
## Example
|
||||
|
||||
I mainly do this for unit tests I run on phantomjs.
|
||||
PhantomJS does not have Function.prototype.bind :(
|
||||
|
||||
```js
|
||||
Function.prototype.bind = require("function-bind")
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
`npm install function-bind`
|
||||
|
||||
## Contributors
|
||||
|
||||
- Raynos
|
||||
|
||||
## MIT Licenced
|
||||
|
||||
[travis-svg]: https://travis-ci.org/Raynos/function-bind.svg
|
||||
[travis-url]: https://travis-ci.org/Raynos/function-bind
|
||||
[npm-badge-svg]: https://badge.fury.io/js/function-bind.svg
|
||||
[npm-url]: https://npmjs.org/package/function-bind
|
||||
[5]: https://coveralls.io/repos/Raynos/function-bind/badge.png
|
||||
[6]: https://coveralls.io/r/Raynos/function-bind
|
||||
[7]: https://gemnasium.com/Raynos/function-bind.png
|
||||
[8]: https://gemnasium.com/Raynos/function-bind
|
||||
[deps-svg]: https://david-dm.org/Raynos/function-bind.svg
|
||||
[deps-url]: https://david-dm.org/Raynos/function-bind
|
||||
[dev-deps-svg]: https://david-dm.org/Raynos/function-bind/dev-status.svg
|
||||
[dev-deps-url]: https://david-dm.org/Raynos/function-bind#info=devDependencies
|
||||
[11]: https://ci.testling.com/Raynos/function-bind.png
|
||||
[12]: https://ci.testling.com/Raynos/function-bind
|
||||
@@ -0,0 +1,43 @@
|
||||
// TypeScript Version: 3.2
|
||||
|
||||
/// <reference types="node" lib="esnext" />
|
||||
|
||||
import * as fs from 'fs';
|
||||
import { Readable } from 'stream';
|
||||
|
||||
declare namespace readdir {
|
||||
interface EntryInfo {
|
||||
path: string;
|
||||
fullPath: string;
|
||||
basename: string;
|
||||
stats?: fs.Stats;
|
||||
dirent?: fs.Dirent;
|
||||
}
|
||||
|
||||
interface ReaddirpOptions {
|
||||
root?: string;
|
||||
fileFilter?: string | string[] | ((entry: EntryInfo) => boolean);
|
||||
directoryFilter?: string | string[] | ((entry: EntryInfo) => boolean);
|
||||
type?: 'files' | 'directories' | 'files_directories' | 'all';
|
||||
lstat?: boolean;
|
||||
depth?: number;
|
||||
alwaysStat?: boolean;
|
||||
}
|
||||
|
||||
interface ReaddirpStream extends Readable, AsyncIterable<EntryInfo> {
|
||||
read(): EntryInfo;
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<EntryInfo>;
|
||||
}
|
||||
|
||||
function promise(
|
||||
root: string,
|
||||
options?: ReaddirpOptions
|
||||
): Promise<EntryInfo[]>;
|
||||
}
|
||||
|
||||
declare function readdir(
|
||||
root: string,
|
||||
options?: readdir.ReaddirpOptions
|
||||
): readdir.ReaddirpStream;
|
||||
|
||||
export = readdir;
|
||||
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"name": "is-plain-object",
|
||||
"description": "Returns true if an object was created by the `Object` constructor, or Object.create(null).",
|
||||
"version": "5.0.0",
|
||||
"homepage": "https://github.com/jonschlinkert/is-plain-object",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"contributors": [
|
||||
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
|
||||
"Osman Nuri Okumuş (http://onokumus.com)",
|
||||
"Steven Vachon (https://svachon.com)",
|
||||
"(https://github.com/wtgtybhertgeghgtwtg)",
|
||||
"Bogdan Chadkin (https://github.com/TrySound)"
|
||||
],
|
||||
"repository": "jonschlinkert/is-plain-object",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/is-plain-object/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "dist/is-plain-object.js",
|
||||
"module": "dist/is-plain-object.mjs",
|
||||
"types": "is-plain-object.d.ts",
|
||||
"files": [
|
||||
"is-plain-object.d.ts",
|
||||
"dist"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./dist/is-plain-object.mjs",
|
||||
"require": "./dist/is-plain-object.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"test_browser": "mocha-headless-chrome --args=disable-web-security -f test/browser.html",
|
||||
"test_node": "mocha -r esm",
|
||||
"test": "npm run test_node && npm run build && npm run test_browser",
|
||||
"prepare": "rollup -c"
|
||||
},
|
||||
"devDependencies": {
|
||||
"chai": "^4.2.0",
|
||||
"esm": "^3.2.22",
|
||||
"gulp-format-md": "^1.0.0",
|
||||
"mocha": "^6.1.4",
|
||||
"mocha-headless-chrome": "^3.1.0",
|
||||
"rollup": "^2.22.1"
|
||||
},
|
||||
"keywords": [
|
||||
"check",
|
||||
"is",
|
||||
"is-object",
|
||||
"isobject",
|
||||
"javascript",
|
||||
"kind",
|
||||
"kind-of",
|
||||
"object",
|
||||
"plain",
|
||||
"type",
|
||||
"typeof",
|
||||
"value"
|
||||
],
|
||||
"verb": {
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"is-number",
|
||||
"isobject",
|
||||
"kind-of"
|
||||
]
|
||||
},
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
'use strict';
|
||||
|
||||
var isGlob = require('is-glob');
|
||||
var pathPosixDirname = require('path').posix.dirname;
|
||||
var isWin32 = require('os').platform() === 'win32';
|
||||
|
||||
var slash = '/';
|
||||
var backslash = /\\/g;
|
||||
var escaped = /\\([!*?|[\](){}])/g;
|
||||
|
||||
/**
|
||||
* @param {string} str
|
||||
* @param {Object} opts
|
||||
* @param {boolean} [opts.flipBackslashes=true]
|
||||
*/
|
||||
module.exports = function globParent(str, opts) {
|
||||
var options = Object.assign({ flipBackslashes: true }, opts);
|
||||
|
||||
// flip windows path separators
|
||||
if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
|
||||
str = str.replace(backslash, slash);
|
||||
}
|
||||
|
||||
// special case for strings ending in enclosure containing path separator
|
||||
if (isEnclosure(str)) {
|
||||
str += slash;
|
||||
}
|
||||
|
||||
// preserves full path in case of trailing path separator
|
||||
str += 'a';
|
||||
|
||||
// remove path parts that are globby
|
||||
do {
|
||||
str = pathPosixDirname(str);
|
||||
} while (isGlobby(str));
|
||||
|
||||
// remove escape chars and return result
|
||||
return str.replace(escaped, '$1');
|
||||
};
|
||||
|
||||
function isEnclosure(str) {
|
||||
var lastChar = str.slice(-1);
|
||||
|
||||
var enclosureStart;
|
||||
switch (lastChar) {
|
||||
case '}':
|
||||
enclosureStart = '{';
|
||||
break;
|
||||
case ']':
|
||||
enclosureStart = '[';
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
||||
var foundIndex = str.indexOf(enclosureStart);
|
||||
if (foundIndex < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return str.slice(foundIndex + 1, -1).includes(slash);
|
||||
}
|
||||
|
||||
function isGlobby(str) {
|
||||
if (/\([^()]+$/.test(str)) {
|
||||
return true;
|
||||
}
|
||||
if (str[0] === '{' || str[0] === '[') {
|
||||
return true;
|
||||
}
|
||||
if (/[^\\][{[]/.test(str)) {
|
||||
return true;
|
||||
}
|
||||
return isGlob(str);
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = highlight;
|
||||
exports.getChalk = getChalk;
|
||||
exports.shouldHighlight = shouldHighlight;
|
||||
|
||||
var _jsTokens = require("js-tokens");
|
||||
|
||||
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
|
||||
|
||||
var _chalk = require("chalk");
|
||||
|
||||
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
|
||||
|
||||
function getDefs(chalk) {
|
||||
return {
|
||||
keyword: chalk.cyan,
|
||||
capitalized: chalk.yellow,
|
||||
jsxIdentifier: chalk.yellow,
|
||||
punctuator: chalk.yellow,
|
||||
number: chalk.magenta,
|
||||
string: chalk.green,
|
||||
regex: chalk.magenta,
|
||||
comment: chalk.grey,
|
||||
invalid: chalk.white.bgRed.bold
|
||||
};
|
||||
}
|
||||
|
||||
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
||||
const BRACKET = /^[()[\]{}]$/;
|
||||
let tokenize;
|
||||
{
|
||||
const JSX_TAG = /^[a-z][\w-]*$/i;
|
||||
|
||||
const getTokenType = function (token, offset, text) {
|
||||
if (token.type === "name") {
|
||||
if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) {
|
||||
return "keyword";
|
||||
}
|
||||
|
||||
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) == "</")) {
|
||||
return "jsxIdentifier";
|
||||
}
|
||||
|
||||
if (token.value[0] !== token.value[0].toLowerCase()) {
|
||||
return "capitalized";
|
||||
}
|
||||
}
|
||||
|
||||
if (token.type === "punctuator" && BRACKET.test(token.value)) {
|
||||
return "bracket";
|
||||
}
|
||||
|
||||
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
|
||||
return "punctuator";
|
||||
}
|
||||
|
||||
return token.type;
|
||||
};
|
||||
|
||||
tokenize = function* (text) {
|
||||
let match;
|
||||
|
||||
while (match = _jsTokens.default.exec(text)) {
|
||||
const token = _jsTokens.matchToToken(match);
|
||||
|
||||
yield {
|
||||
type: getTokenType(token, match.index, text),
|
||||
value: token.value
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function highlightTokens(defs, text) {
|
||||
let highlighted = "";
|
||||
|
||||
for (const {
|
||||
type,
|
||||
value
|
||||
} of tokenize(text)) {
|
||||
const colorize = defs[type];
|
||||
|
||||
if (colorize) {
|
||||
highlighted += value.split(NEWLINE).map(str => colorize(str)).join("\n");
|
||||
} else {
|
||||
highlighted += value;
|
||||
}
|
||||
}
|
||||
|
||||
return highlighted;
|
||||
}
|
||||
|
||||
function shouldHighlight(options) {
|
||||
return !!_chalk.supportsColor || options.forceColor;
|
||||
}
|
||||
|
||||
function getChalk(options) {
|
||||
return options.forceColor ? new _chalk.constructor({
|
||||
enabled: true,
|
||||
level: 1
|
||||
}) : _chalk;
|
||||
}
|
||||
|
||||
function highlight(code, options = {}) {
|
||||
if (code !== "" && shouldHighlight(options)) {
|
||||
const chalk = getChalk(options);
|
||||
const defs = getDefs(chalk);
|
||||
return highlightTokens(defs, code);
|
||||
} else {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
var baseMerge = require('./_baseMerge'),
|
||||
createAssigner = require('./_createAssigner');
|
||||
|
||||
/**
|
||||
* This method is like `_.assign` except that it recursively merges own and
|
||||
* inherited enumerable string keyed properties of source objects into the
|
||||
* destination object. Source properties that resolve to `undefined` are
|
||||
* skipped if a destination value exists. Array and plain object properties
|
||||
* are merged recursively. Other objects and value types are overridden by
|
||||
* assignment. Source objects are applied from left to right. Subsequent
|
||||
* sources overwrite property assignments of previous sources.
|
||||
*
|
||||
* **Note:** This method mutates `object`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 0.5.0
|
||||
* @category Object
|
||||
* @param {Object} object The destination object.
|
||||
* @param {...Object} [sources] The source objects.
|
||||
* @returns {Object} Returns `object`.
|
||||
* @example
|
||||
*
|
||||
* var object = {
|
||||
* 'a': [{ 'b': 2 }, { 'd': 4 }]
|
||||
* };
|
||||
*
|
||||
* var other = {
|
||||
* 'a': [{ 'c': 3 }, { 'e': 5 }]
|
||||
* };
|
||||
*
|
||||
* _.merge(object, other);
|
||||
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
|
||||
*/
|
||||
var merge = createAssigner(function(object, source, srcIndex) {
|
||||
baseMerge(object, source, srcIndex);
|
||||
});
|
||||
|
||||
module.exports = merge;
|
||||
@@ -0,0 +1,73 @@
|
||||
# which-boxed-primitive <sup>[![Version Badge][2]][1]</sup>
|
||||
|
||||
[![dependency status][5]][6]
|
||||
[![dev dependency status][7]][8]
|
||||
[![License][license-image]][license-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
|
||||
[![npm badge][11]][1]
|
||||
|
||||
Which kind of boxed JS primitive is this? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and works despite ES6 Symbol.toStringTag.
|
||||
|
||||
## Example
|
||||
|
||||
```js
|
||||
var whichBoxedPrimitive = require('which-boxed-primitive');
|
||||
var assert = require('assert');
|
||||
|
||||
// unboxed primitives return `null`
|
||||
// boxed primitives return the builtin constructor name
|
||||
|
||||
assert.equal(whichBoxedPrimitive(undefined), null);
|
||||
assert.equal(whichBoxedPrimitive(null), null);
|
||||
|
||||
assert.equal(whichBoxedPrimitive(false), null);
|
||||
assert.equal(whichBoxedPrimitive(true), null);
|
||||
assert.equal(whichBoxedPrimitive(new Boolean(false)), 'Boolean');
|
||||
assert.equal(whichBoxedPrimitive(new Boolean(true)), 'Boolean');
|
||||
|
||||
assert.equal(whichBoxedPrimitive(42), null);
|
||||
assert.equal(whichBoxedPrimitive(NaN), null);
|
||||
assert.equal(whichBoxedPrimitive(Infinity), null);
|
||||
assert.equal(whichBoxedPrimitive(new Number(42)), 'Number');
|
||||
assert.equal(whichBoxedPrimitive(new Number(NaN)), 'Number');
|
||||
assert.equal(whichBoxedPrimitive(new Number(Infinity)), 'Number');
|
||||
|
||||
assert.equal(whichBoxedPrimitive(''), null);
|
||||
assert.equal(whichBoxedPrimitive('foo'), null);
|
||||
assert.equal(whichBoxedPrimitive(new String('')), 'String');
|
||||
assert.equal(whichBoxedPrimitive(new String('foo')), 'String');
|
||||
|
||||
assert.equal(whichBoxedPrimitive(Symbol()), null);
|
||||
assert.equal(whichBoxedPrimitive(Object(Symbol()), 'Symbol');
|
||||
|
||||
assert.equal(whichBoxedPrimitive(42n), null);
|
||||
assert.equal(whichBoxedPrimitive(Object(42n), 'BigInt');
|
||||
|
||||
// non-boxed-primitive objects return `undefined`
|
||||
assert.equal(whichBoxedPrimitive([]), undefined);
|
||||
assert.equal(whichBoxedPrimitive({}), undefined);
|
||||
assert.equal(whichBoxedPrimitive(/a/g), undefined);
|
||||
assert.equal(whichBoxedPrimitive(new RegExp('a', 'g')), undefined);
|
||||
assert.equal(whichBoxedPrimitive(new Date()), undefined);
|
||||
assert.equal(whichBoxedPrimitive(function () {}), undefined);
|
||||
assert.equal(whichBoxedPrimitive(function* () {}), undefined);
|
||||
assert.equal(whichBoxedPrimitive(x => x * x), undefined);
|
||||
assert.equal(whichBoxedPrimitive([]), undefined);
|
||||
|
||||
```
|
||||
|
||||
## Tests
|
||||
Simply clone the repo, `npm install`, and run `npm test`
|
||||
|
||||
[1]: https://npmjs.org/package/which-boxed-primitive
|
||||
[2]: https://versionbadg.es/inspect-js/which-boxed-primitive.svg
|
||||
[5]: https://david-dm.org/inspect-js/which-boxed-primitive.svg
|
||||
[6]: https://david-dm.org/inspect-js/which-boxed-primitive
|
||||
[7]: https://david-dm.org/inspect-js/which-boxed-primitive/dev-status.svg
|
||||
[8]: https://david-dm.org/inspect-js/which-boxed-primitive#info=devDependencies
|
||||
[11]: https://nodei.co/npm/which-boxed-primitive.png?downloads=true&stars=true
|
||||
[license-image]: https://img.shields.io/npm/l/which-boxed-primitive.svg
|
||||
[license-url]: LICENSE
|
||||
[downloads-image]: https://img.shields.io/npm/dm/which-boxed-primitive.svg
|
||||
[downloads-url]: https://npm-stat.com/charts.html?package=which-boxed-primitive
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F CC","164":"A B"},B:{"66":"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","164":"C K L G M N O"},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:{"2":"0 1 2 3 4 I v J D E F A B C K L G M N O w g x y z","66":"5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R 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:{"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:{"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 PC QC RC SC qB AC TC rB","66":"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:{"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:{"292":"oC"},I:{"2":"tB I f pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"2":"A h","292":"B C qB AC rB"},L:{"2":"H"},M:{"2":"H"},N:{"164":"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:{"66":"1B"},R:{"2":"9C"},S:{"2":"AD BD"}},B:5,C:"CSS Device Adaptation"};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B 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:{"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 a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"2":"I v J D E F A HC zB IC JC KC LC 0B","130":"B C K L G qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"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 S T U V W X Y Z a b c d e PC QC RC SC qB AC TC rB"},G:{"2":"E zB UC BC VC WC XC YC ZC aC bC cC","130":"dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"2":"tB I f pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"2":"A B C h qB AC rB"},L:{"2":"H"},M:{"2":"H"},N:{"2":"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:6,C:"HEIF/ISO Base Media File Format"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"reportUnhandledError.js","sourceRoot":"","sources":["../../../../src/internal/util/reportUnhandledError.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAW/D,MAAM,UAAU,oBAAoB,CAAC,GAAQ;IAC3C,eAAe,CAAC,UAAU,CAAC;QACjB,IAAA,gBAAgB,GAAK,MAAM,iBAAX,CAAY;QACpC,IAAI,gBAAgB,EAAE;YAEpB,gBAAgB,CAAC,GAAG,CAAC,CAAC;SACvB;aAAM;YAEL,MAAM,GAAG,CAAC;SACX;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "event-emitter",
|
||||
"version": "0.3.5",
|
||||
"description": "Environment agnostic event emitter",
|
||||
"author": "Mariusz Nowak <medyk@medikoo.com> (http://www.medikoo.com/)",
|
||||
"keywords": [
|
||||
"event",
|
||||
"events",
|
||||
"trigger",
|
||||
"observer",
|
||||
"listener",
|
||||
"emitter",
|
||||
"pubsub"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/medikoo/event-emitter.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"es5-ext": "~0.10.14",
|
||||
"d": "1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tad": "~0.2.7",
|
||||
"xlint": "~0.2.2",
|
||||
"xlint-jslint-medikoo": "~0.1.4"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --no-cache --no-stream",
|
||||
"lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch",
|
||||
"test": "node ./node_modules/tad/bin/tad"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require('./constant');
|
||||
@@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "ansi-styles",
|
||||
"version": "4.3.0",
|
||||
"description": "ANSI escape codes for styling strings in the terminal",
|
||||
"license": "MIT",
|
||||
"repository": "chalk/ansi-styles",
|
||||
"funding": "https://github.com/chalk/ansi-styles?sponsor=1",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd",
|
||||
"screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"styles",
|
||||
"color",
|
||||
"colour",
|
||||
"colors",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"formatting",
|
||||
"rgb",
|
||||
"256",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text"
|
||||
],
|
||||
"dependencies": {
|
||||
"color-convert": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/color-convert": "^1.9.0",
|
||||
"ava": "^2.3.0",
|
||||
"svg-term-cli": "^2.1.1",
|
||||
"tsd": "^0.11.0",
|
||||
"xo": "^0.25.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
(function (global, factory) {
|
||||
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
||||
typeof define === 'function' && define.amd ? define(factory) :
|
||||
(global = global || self, global.deepmerge = factory());
|
||||
}(this, function () { 'use strict';
|
||||
|
||||
var isMergeableObject = function isMergeableObject(value) {
|
||||
return isNonNullObject(value)
|
||||
&& !isSpecial(value)
|
||||
};
|
||||
|
||||
function isNonNullObject(value) {
|
||||
return !!value && typeof value === 'object'
|
||||
}
|
||||
|
||||
function isSpecial(value) {
|
||||
var stringValue = Object.prototype.toString.call(value);
|
||||
|
||||
return stringValue === '[object RegExp]'
|
||||
|| stringValue === '[object Date]'
|
||||
|| isReactElement(value)
|
||||
}
|
||||
|
||||
// see https://github.com/facebook/react/blob/b5ac963fb791d1298e7f396236383bc955f916c1/src/isomorphic/classic/element/ReactElement.js#L21-L25
|
||||
var canUseSymbol = typeof Symbol === 'function' && Symbol.for;
|
||||
var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for('react.element') : 0xeac7;
|
||||
|
||||
function isReactElement(value) {
|
||||
return value.$$typeof === REACT_ELEMENT_TYPE
|
||||
}
|
||||
|
||||
function emptyTarget(val) {
|
||||
return Array.isArray(val) ? [] : {}
|
||||
}
|
||||
|
||||
function cloneUnlessOtherwiseSpecified(value, options) {
|
||||
return (options.clone !== false && options.isMergeableObject(value))
|
||||
? deepmerge(emptyTarget(value), value, options)
|
||||
: value
|
||||
}
|
||||
|
||||
function defaultArrayMerge(target, source, options) {
|
||||
return target.concat(source).map(function(element) {
|
||||
return cloneUnlessOtherwiseSpecified(element, options)
|
||||
})
|
||||
}
|
||||
|
||||
function getMergeFunction(key, options) {
|
||||
if (!options.customMerge) {
|
||||
return deepmerge
|
||||
}
|
||||
var customMerge = options.customMerge(key);
|
||||
return typeof customMerge === 'function' ? customMerge : deepmerge
|
||||
}
|
||||
|
||||
function getEnumerableOwnPropertySymbols(target) {
|
||||
return Object.getOwnPropertySymbols
|
||||
? Object.getOwnPropertySymbols(target).filter(function(symbol) {
|
||||
return Object.propertyIsEnumerable.call(target, symbol)
|
||||
})
|
||||
: []
|
||||
}
|
||||
|
||||
function getKeys(target) {
|
||||
return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target))
|
||||
}
|
||||
|
||||
function propertyIsOnObject(object, property) {
|
||||
try {
|
||||
return property in object
|
||||
} catch(_) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
// Protects from prototype poisoning and unexpected merging up the prototype chain.
|
||||
function propertyIsUnsafe(target, key) {
|
||||
return propertyIsOnObject(target, key) // Properties are safe to merge if they don't exist in the target yet,
|
||||
&& !(Object.hasOwnProperty.call(target, key) // unsafe if they exist up the prototype chain,
|
||||
&& Object.propertyIsEnumerable.call(target, key)) // and also unsafe if they're nonenumerable.
|
||||
}
|
||||
|
||||
function mergeObject(target, source, options) {
|
||||
var destination = {};
|
||||
if (options.isMergeableObject(target)) {
|
||||
getKeys(target).forEach(function(key) {
|
||||
destination[key] = cloneUnlessOtherwiseSpecified(target[key], options);
|
||||
});
|
||||
}
|
||||
getKeys(source).forEach(function(key) {
|
||||
if (propertyIsUnsafe(target, key)) {
|
||||
return
|
||||
}
|
||||
|
||||
if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) {
|
||||
destination[key] = getMergeFunction(key, options)(target[key], source[key], options);
|
||||
} else {
|
||||
destination[key] = cloneUnlessOtherwiseSpecified(source[key], options);
|
||||
}
|
||||
});
|
||||
return destination
|
||||
}
|
||||
|
||||
function deepmerge(target, source, options) {
|
||||
options = options || {};
|
||||
options.arrayMerge = options.arrayMerge || defaultArrayMerge;
|
||||
options.isMergeableObject = options.isMergeableObject || isMergeableObject;
|
||||
// cloneUnlessOtherwiseSpecified is added to `options` so that custom arrayMerge()
|
||||
// implementations can use it. The caller may not replace it.
|
||||
options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified;
|
||||
|
||||
var sourceIsArray = Array.isArray(source);
|
||||
var targetIsArray = Array.isArray(target);
|
||||
var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray;
|
||||
|
||||
if (!sourceAndTargetTypesMatch) {
|
||||
return cloneUnlessOtherwiseSpecified(source, options)
|
||||
} else if (sourceIsArray) {
|
||||
return options.arrayMerge(target, source, options)
|
||||
} else {
|
||||
return mergeObject(target, source, options)
|
||||
}
|
||||
}
|
||||
|
||||
deepmerge.all = function deepmergeAll(array, options) {
|
||||
if (!Array.isArray(array)) {
|
||||
throw new Error('first argument should be an array')
|
||||
}
|
||||
|
||||
return array.reduce(function(prev, next) {
|
||||
return deepmerge(prev, next, options)
|
||||
}, {})
|
||||
};
|
||||
|
||||
var deepmerge_1 = deepmerge;
|
||||
|
||||
return deepmerge_1;
|
||||
|
||||
}));
|
||||
@@ -0,0 +1,5 @@
|
||||
import { combineLatest } from './combineLatest';
|
||||
export function combineLatestWith(...otherSources) {
|
||||
return combineLatest(...otherSources);
|
||||
}
|
||||
//# sourceMappingURL=combineLatestWith.js.map
|
||||
@@ -0,0 +1,4 @@
|
||||
export declare const debounce: <F extends (...args: any[]) => any>(
|
||||
func: F,
|
||||
waitFor: number,
|
||||
) => (...args: Parameters<F>) => Promise<ReturnType<F>>;
|
||||
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
Escape a string for use in HTML.
|
||||
|
||||
Escapes the following characters in the given `string` argument: `&` `<` `>` `"` `'`.
|
||||
|
||||
@example
|
||||
```
|
||||
import {htmlEscape} from 'escape-goat';
|
||||
|
||||
htmlEscape('🦄 & 🐐');
|
||||
//=> '🦄 & 🐐'
|
||||
|
||||
htmlEscape('Hello <em>World</em>');
|
||||
//=> 'Hello <em>World</em>'
|
||||
```
|
||||
*/
|
||||
export function htmlEscape(string: string): string;
|
||||
|
||||
/**
|
||||
[Tagged template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) that escapes interpolated values.
|
||||
|
||||
@example
|
||||
```
|
||||
import {htmlEscape} from 'escape-goat';
|
||||
|
||||
const url = 'https://sindresorhus.com?x="🦄"';
|
||||
|
||||
htmlEscape`<a href="${url}">Unicorn</a>`;
|
||||
//=> '<a href="https://sindresorhus.com?x="🦄"">Unicorn</a>'
|
||||
```
|
||||
*/
|
||||
export function htmlEscape(template: TemplateStringsArray, ...substitutions: readonly unknown[]): string;
|
||||
|
||||
/**
|
||||
Unescape an HTML string to use as a plain string.
|
||||
|
||||
Unescapes the following HTML entities in the given `htmlString` argument: `&` `<` `>` `"` `'`.
|
||||
|
||||
@example
|
||||
```
|
||||
import {htmlUnescape} from 'escape-goat';
|
||||
|
||||
htmlUnescape('🦄 & 🐐');
|
||||
//=> '🦄 & 🐐'
|
||||
```
|
||||
*/
|
||||
export function htmlUnescape(htmlString: string): string;
|
||||
|
||||
/**
|
||||
[Tagged template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) that unescapes interpolated values.
|
||||
|
||||
@example
|
||||
```
|
||||
import {htmlUnescape} from 'escape-goat';
|
||||
|
||||
const escapedUrl = 'https://sindresorhus.com?x="🦄"';
|
||||
|
||||
htmlUnescape`URL from HTML: ${url}`;
|
||||
//=> 'URL from HTML: https://sindresorhus.com?x="🦄"'
|
||||
```
|
||||
*/
|
||||
export function htmlUnescape(template: TemplateStringsArray, ...substitutions: readonly unknown[]): string;
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('unescape', require('../unescape'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,5 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "6"
|
||||
- "8"
|
||||
- "10"
|
||||
@@ -0,0 +1,187 @@
|
||||
import is, { assert } from '@sindresorhus/is';
|
||||
import asPromise from './as-promise/index.js';
|
||||
import Request from './core/index.js';
|
||||
import Options from './core/options.js';
|
||||
// The `delay` package weighs 10KB (!)
|
||||
const delay = async (ms) => new Promise(resolve => {
|
||||
setTimeout(resolve, ms);
|
||||
});
|
||||
const isGotInstance = (value) => is.function_(value);
|
||||
const aliases = [
|
||||
'get',
|
||||
'post',
|
||||
'put',
|
||||
'patch',
|
||||
'head',
|
||||
'delete',
|
||||
];
|
||||
const create = (defaults) => {
|
||||
defaults = {
|
||||
options: new Options(undefined, undefined, defaults.options),
|
||||
handlers: [...defaults.handlers],
|
||||
mutableDefaults: defaults.mutableDefaults,
|
||||
};
|
||||
Object.defineProperty(defaults, 'mutableDefaults', {
|
||||
enumerable: true,
|
||||
configurable: false,
|
||||
writable: false,
|
||||
});
|
||||
// Got interface
|
||||
const got = ((url, options, defaultOptions = defaults.options) => {
|
||||
const request = new Request(url, options, defaultOptions);
|
||||
let promise;
|
||||
const lastHandler = (normalized) => {
|
||||
// Note: `options` is `undefined` when `new Options(...)` fails
|
||||
request.options = normalized;
|
||||
request._noPipe = !normalized.isStream;
|
||||
void request.flush();
|
||||
if (normalized.isStream) {
|
||||
return request;
|
||||
}
|
||||
if (!promise) {
|
||||
promise = asPromise(request);
|
||||
}
|
||||
return promise;
|
||||
};
|
||||
let iteration = 0;
|
||||
const iterateHandlers = (newOptions) => {
|
||||
const handler = defaults.handlers[iteration++] ?? lastHandler;
|
||||
const result = handler(newOptions, iterateHandlers);
|
||||
if (is.promise(result) && !request.options.isStream) {
|
||||
if (!promise) {
|
||||
promise = asPromise(request);
|
||||
}
|
||||
if (result !== promise) {
|
||||
const descriptors = Object.getOwnPropertyDescriptors(promise);
|
||||
for (const key in descriptors) {
|
||||
if (key in result) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
||||
delete descriptors[key];
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
Object.defineProperties(result, descriptors);
|
||||
result.cancel = promise.cancel;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
return iterateHandlers(request.options);
|
||||
});
|
||||
got.extend = (...instancesOrOptions) => {
|
||||
const options = new Options(undefined, undefined, defaults.options);
|
||||
const handlers = [...defaults.handlers];
|
||||
let mutableDefaults;
|
||||
for (const value of instancesOrOptions) {
|
||||
if (isGotInstance(value)) {
|
||||
options.merge(value.defaults.options);
|
||||
handlers.push(...value.defaults.handlers);
|
||||
mutableDefaults = value.defaults.mutableDefaults;
|
||||
}
|
||||
else {
|
||||
options.merge(value);
|
||||
if (value.handlers) {
|
||||
handlers.push(...value.handlers);
|
||||
}
|
||||
mutableDefaults = value.mutableDefaults;
|
||||
}
|
||||
}
|
||||
return create({
|
||||
options,
|
||||
handlers,
|
||||
mutableDefaults: Boolean(mutableDefaults),
|
||||
});
|
||||
};
|
||||
// Pagination
|
||||
const paginateEach = (async function* (url, options) {
|
||||
let normalizedOptions = new Options(url, options, defaults.options);
|
||||
normalizedOptions.resolveBodyOnly = false;
|
||||
const { pagination } = normalizedOptions;
|
||||
assert.function_(pagination.transform);
|
||||
assert.function_(pagination.shouldContinue);
|
||||
assert.function_(pagination.filter);
|
||||
assert.function_(pagination.paginate);
|
||||
assert.number(pagination.countLimit);
|
||||
assert.number(pagination.requestLimit);
|
||||
assert.number(pagination.backoff);
|
||||
const allItems = [];
|
||||
let { countLimit } = pagination;
|
||||
let numberOfRequests = 0;
|
||||
while (numberOfRequests < pagination.requestLimit) {
|
||||
if (numberOfRequests !== 0) {
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
await delay(pagination.backoff);
|
||||
}
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const response = (await got(undefined, undefined, normalizedOptions));
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
const parsed = await pagination.transform(response);
|
||||
const currentItems = [];
|
||||
assert.array(parsed);
|
||||
for (const item of parsed) {
|
||||
if (pagination.filter({ item, currentItems, allItems })) {
|
||||
if (!pagination.shouldContinue({ item, currentItems, allItems })) {
|
||||
return;
|
||||
}
|
||||
yield item;
|
||||
if (pagination.stackAllItems) {
|
||||
allItems.push(item);
|
||||
}
|
||||
currentItems.push(item);
|
||||
if (--countLimit <= 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
const optionsToMerge = pagination.paginate({
|
||||
response,
|
||||
currentItems,
|
||||
allItems,
|
||||
});
|
||||
if (optionsToMerge === false) {
|
||||
return;
|
||||
}
|
||||
if (optionsToMerge === response.request.options) {
|
||||
normalizedOptions = response.request.options;
|
||||
}
|
||||
else {
|
||||
normalizedOptions.merge(optionsToMerge);
|
||||
assert.any([is.urlInstance, is.undefined], optionsToMerge.url);
|
||||
if (optionsToMerge.url !== undefined) {
|
||||
normalizedOptions.prefixUrl = '';
|
||||
normalizedOptions.url = optionsToMerge.url;
|
||||
}
|
||||
}
|
||||
numberOfRequests++;
|
||||
}
|
||||
});
|
||||
got.paginate = paginateEach;
|
||||
got.paginate.all = (async (url, options) => {
|
||||
const results = [];
|
||||
for await (const item of paginateEach(url, options)) {
|
||||
results.push(item);
|
||||
}
|
||||
return results;
|
||||
});
|
||||
// For those who like very descriptive names
|
||||
got.paginate.each = paginateEach;
|
||||
// Stream API
|
||||
got.stream = ((url, options) => got(url, { ...options, isStream: true }));
|
||||
// Shortcuts
|
||||
for (const method of aliases) {
|
||||
got[method] = ((url, options) => got(url, { ...options, method }));
|
||||
got.stream[method] = ((url, options) => got(url, { ...options, method, isStream: true }));
|
||||
}
|
||||
if (!defaults.mutableDefaults) {
|
||||
Object.freeze(defaults.handlers);
|
||||
defaults.options.freeze();
|
||||
}
|
||||
Object.defineProperty(got, 'defaults', {
|
||||
value: defaults,
|
||||
writable: false,
|
||||
configurable: false,
|
||||
enumerable: true,
|
||||
});
|
||||
return got;
|
||||
};
|
||||
export default create;
|
||||
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (C) 2013 Jordan Harband
|
||||
|
||||
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,26 @@
|
||||
"use strict";
|
||||
|
||||
var isPrototype = require("../prototype/is");
|
||||
|
||||
var dateValueOf = Date.prototype.valueOf;
|
||||
|
||||
module.exports = function (value) {
|
||||
if (!value) return false;
|
||||
|
||||
try {
|
||||
// Sanity check (reject objects which do not expose common Date interface)
|
||||
if (typeof value.getFullYear !== "function") return false;
|
||||
if (typeof value.getTimezoneOffset !== "function") return false;
|
||||
if (typeof value.setFullYear !== "function") return false;
|
||||
|
||||
// Ensure its native Date object (has [[DateValue]] slot)
|
||||
dateValueOf.call(value);
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Ensure it hosts valid date
|
||||
if (isNaN(value)) return false;
|
||||
|
||||
return !isPrototype(value);
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","2":"C K L G M N O"},C:{"1":"EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"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 EC FC"},D:{"1":"UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"0 1 2 3 4 5 6 7 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"},E:{"1":"3B 4B 5B sB 6B 7B 8B 9B OC","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"},F:{"1":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"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 PC QC RC SC qB AC TC rB"},G:{"1":"3B 4B 5B sB 6B 7B 8B 9B","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"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"g yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I wC xC"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:1,C:"BroadcastChannel"};
|
||||
@@ -0,0 +1,30 @@
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
const homeDirectory = os.homedir();
|
||||
const {env} = process;
|
||||
|
||||
export const xdgData = env.XDG_DATA_HOME ||
|
||||
(homeDirectory ? path.join(homeDirectory, '.local', 'share') : undefined);
|
||||
|
||||
export const xdgConfig = env.XDG_CONFIG_HOME ||
|
||||
(homeDirectory ? path.join(homeDirectory, '.config') : undefined);
|
||||
|
||||
export const xdgState = env.XDG_STATE_HOME ||
|
||||
(homeDirectory ? path.join(homeDirectory, '.local', 'state') : undefined);
|
||||
|
||||
export const xdgCache = env.XDG_CACHE_HOME || (homeDirectory ? path.join(homeDirectory, '.cache') : undefined);
|
||||
|
||||
export const xdgRuntime = env.XDG_RUNTIME_DIR || undefined;
|
||||
|
||||
export const xdgDataDirectories = (env.XDG_DATA_DIRS || '/usr/local/share/:/usr/share/').split(':');
|
||||
|
||||
if (xdgData) {
|
||||
xdgDataDirectories.unshift(xdgData);
|
||||
}
|
||||
|
||||
export const xdgConfigDirectories = (env.XDG_CONFIG_DIRS || '/etc/xdg').split(':');
|
||||
|
||||
if (xdgConfig) {
|
||||
xdgConfigDirectories.unshift(xdgConfig);
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
/**
|
||||
* @preserve
|
||||
* JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
|
||||
*
|
||||
* @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
|
||||
* @see http://github.com/homebrewing/brauhaus-diff
|
||||
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
|
||||
* @see http://github.com/garycourt/murmurhash-js
|
||||
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
|
||||
* @see http://sites.google.com/site/murmurhash/
|
||||
*/
|
||||
(function(){
|
||||
var cache;
|
||||
|
||||
// Call this function without `new` to use the cached object (good for
|
||||
// single-threaded environments), or with `new` to create a new object.
|
||||
//
|
||||
// @param {string} key A UTF-16 or ASCII string
|
||||
// @param {number} seed An optional positive integer
|
||||
// @return {object} A MurmurHash3 object for incremental hashing
|
||||
function MurmurHash3(key, seed) {
|
||||
var m = this instanceof MurmurHash3 ? this : cache;
|
||||
m.reset(seed)
|
||||
if (typeof key === 'string' && key.length > 0) {
|
||||
m.hash(key);
|
||||
}
|
||||
|
||||
if (m !== this) {
|
||||
return m;
|
||||
}
|
||||
};
|
||||
|
||||
// Incrementally add a string to this hash
|
||||
//
|
||||
// @param {string} key A UTF-16 or ASCII string
|
||||
// @return {object} this
|
||||
MurmurHash3.prototype.hash = function(key) {
|
||||
var h1, k1, i, top, len;
|
||||
|
||||
len = key.length;
|
||||
this.len += len;
|
||||
|
||||
k1 = this.k1;
|
||||
i = 0;
|
||||
switch (this.rem) {
|
||||
case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0;
|
||||
case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0;
|
||||
case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0;
|
||||
case 3:
|
||||
k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0;
|
||||
k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0;
|
||||
}
|
||||
|
||||
this.rem = (len + this.rem) & 3; // & 3 is same as % 4
|
||||
len -= this.rem;
|
||||
if (len > 0) {
|
||||
h1 = this.h1;
|
||||
while (1) {
|
||||
k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;
|
||||
k1 = (k1 << 15) | (k1 >>> 17);
|
||||
k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;
|
||||
|
||||
h1 ^= k1;
|
||||
h1 = (h1 << 13) | (h1 >>> 19);
|
||||
h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff;
|
||||
|
||||
if (i >= len) {
|
||||
break;
|
||||
}
|
||||
|
||||
k1 = ((key.charCodeAt(i++) & 0xffff)) ^
|
||||
((key.charCodeAt(i++) & 0xffff) << 8) ^
|
||||
((key.charCodeAt(i++) & 0xffff) << 16);
|
||||
top = key.charCodeAt(i++);
|
||||
k1 ^= ((top & 0xff) << 24) ^
|
||||
((top & 0xff00) >> 8);
|
||||
}
|
||||
|
||||
k1 = 0;
|
||||
switch (this.rem) {
|
||||
case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16;
|
||||
case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8;
|
||||
case 1: k1 ^= (key.charCodeAt(i) & 0xffff);
|
||||
}
|
||||
|
||||
this.h1 = h1;
|
||||
}
|
||||
|
||||
this.k1 = k1;
|
||||
return this;
|
||||
};
|
||||
|
||||
// Get the result of this hash
|
||||
//
|
||||
// @return {number} The 32-bit hash
|
||||
MurmurHash3.prototype.result = function() {
|
||||
var k1, h1;
|
||||
|
||||
k1 = this.k1;
|
||||
h1 = this.h1;
|
||||
|
||||
if (k1 > 0) {
|
||||
k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;
|
||||
k1 = (k1 << 15) | (k1 >>> 17);
|
||||
k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;
|
||||
h1 ^= k1;
|
||||
}
|
||||
|
||||
h1 ^= this.len;
|
||||
|
||||
h1 ^= h1 >>> 16;
|
||||
h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff;
|
||||
h1 ^= h1 >>> 13;
|
||||
h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff;
|
||||
h1 ^= h1 >>> 16;
|
||||
|
||||
return h1 >>> 0;
|
||||
};
|
||||
|
||||
// Reset the hash object for reuse
|
||||
//
|
||||
// @param {number} seed An optional positive integer
|
||||
MurmurHash3.prototype.reset = function(seed) {
|
||||
this.h1 = typeof seed === 'number' ? seed : 0;
|
||||
this.rem = this.k1 = this.len = 0;
|
||||
return this;
|
||||
};
|
||||
|
||||
// A cached object to use. This can be safely used if you're in a single-
|
||||
// threaded environment, otherwise you need to create new hashes to use.
|
||||
cache = new MurmurHash3();
|
||||
|
||||
if (typeof(module) != 'undefined') {
|
||||
module.exports = MurmurHash3;
|
||||
} else {
|
||||
this.MurmurHash3 = MurmurHash3;
|
||||
}
|
||||
}());
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
require('./');
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../../../src/internal/scheduler/Action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAE3C;;;;;;;;;;;;;GAaG;AACH,qBAAa,MAAM,CAAC,CAAC,CAAE,SAAQ,YAAY;gBAC7B,SAAS,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,IAAI;IAGrF;;;;;;;;;OASG;IACI,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,GAAE,MAAU,GAAG,YAAY;CAG5D"}
|
||||
@@ -0,0 +1,4 @@
|
||||
export type CreateRunnerCard = {
|
||||
runner?: number;
|
||||
enabled: boolean;
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
var ary = require('./ary');
|
||||
|
||||
/**
|
||||
* Creates a function that accepts up to one argument, ignoring any
|
||||
* additional arguments.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Function
|
||||
* @param {Function} func The function to cap arguments for.
|
||||
* @returns {Function} Returns the new capped function.
|
||||
* @example
|
||||
*
|
||||
* _.map(['6', '8', '10'], _.unary(parseInt));
|
||||
* // => [6, 8, 10]
|
||||
*/
|
||||
function unary(func) {
|
||||
return ary(func, 1);
|
||||
}
|
||||
|
||||
module.exports = unary;
|
||||
Reference in New Issue
Block a user