new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
|
||||
var assert = require("chai").assert
|
||||
, ensureObject = require("../../object/ensure");
|
||||
|
||||
describe("object/ensure", function () {
|
||||
it("Should return input value", function () {
|
||||
var value = {};
|
||||
assert.equal(ensureObject(value), value);
|
||||
});
|
||||
it("Should crash on no value", function () {
|
||||
try {
|
||||
ensureObject(null);
|
||||
throw new Error("Unexpected");
|
||||
} catch (error) {
|
||||
assert.equal(error.name, "TypeError");
|
||||
assert.equal(error.message, "null is not an object");
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,16 @@
|
||||
"use strict";;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var tslib_1 = require("tslib");
|
||||
var es7_1 = tslib_1.__importDefault(require("./es7"));
|
||||
var types_1 = tslib_1.__importDefault(require("../lib/types"));
|
||||
function default_1(fork) {
|
||||
fork.use(es7_1.default);
|
||||
var types = fork.use(types_1.default);
|
||||
var def = types.Type.def;
|
||||
def("ImportExpression")
|
||||
.bases("Expression")
|
||||
.build("source")
|
||||
.field("source", def("Expression"));
|
||||
}
|
||||
exports.default = default_1;
|
||||
module.exports = exports["default"];
|
||||
@@ -0,0 +1,52 @@
|
||||
import { __spreadArray } from "tslib";
|
||||
import { isPluralElement, isSelectElement, } from './types';
|
||||
function cloneDeep(obj) {
|
||||
if (Array.isArray(obj)) {
|
||||
// @ts-expect-error meh
|
||||
return __spreadArray([], obj.map(cloneDeep), true);
|
||||
}
|
||||
if (typeof obj === 'object') {
|
||||
// @ts-expect-error meh
|
||||
return Object.keys(obj).reduce(function (cloned, k) {
|
||||
// @ts-expect-error meh
|
||||
cloned[k] = cloneDeep(obj[k]);
|
||||
return cloned;
|
||||
}, {});
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
/**
|
||||
* Hoist all selectors to the beginning of the AST & flatten the
|
||||
* resulting options. E.g:
|
||||
* "I have {count, plural, one{a dog} other{many dogs}}"
|
||||
* becomes "{count, plural, one{I have a dog} other{I have many dogs}}".
|
||||
* If there are multiple selectors, the order of which one is hoisted 1st
|
||||
* is non-deterministic.
|
||||
* The goal is to provide as many full sentences as possible since fragmented
|
||||
* sentences are not translator-friendly
|
||||
* @param ast AST
|
||||
*/
|
||||
export function hoistSelectors(ast) {
|
||||
var _loop_1 = function (i) {
|
||||
var el = ast[i];
|
||||
if (isPluralElement(el) || isSelectElement(el)) {
|
||||
// pull this out of the ast and move it to the top
|
||||
var cloned = cloneDeep(el);
|
||||
var options_1 = cloned.options;
|
||||
cloned.options = Object.keys(options_1).reduce(function (all, k) {
|
||||
var newValue = hoistSelectors(__spreadArray(__spreadArray(__spreadArray([], ast.slice(0, i), true), options_1[k].value, true), ast.slice(i + 1), true));
|
||||
all[k] = {
|
||||
value: newValue,
|
||||
};
|
||||
return all;
|
||||
}, {});
|
||||
return { value: [cloned] };
|
||||
}
|
||||
};
|
||||
for (var i = 0; i < ast.length; i++) {
|
||||
var state_1 = _loop_1(i);
|
||||
if (typeof state_1 === "object")
|
||||
return state_1.value;
|
||||
}
|
||||
return ast;
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
declare module "safe-buffer" {
|
||||
export class Buffer {
|
||||
length: number
|
||||
write(string: string, offset?: number, length?: number, encoding?: string): number;
|
||||
toString(encoding?: string, start?: number, end?: number): string;
|
||||
toJSON(): { type: 'Buffer', data: any[] };
|
||||
equals(otherBuffer: Buffer): boolean;
|
||||
compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
|
||||
copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
|
||||
slice(start?: number, end?: number): Buffer;
|
||||
writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
||||
writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
||||
writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
||||
writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;
|
||||
readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
||||
readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
||||
readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;
|
||||
readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;
|
||||
readUInt8(offset: number, noAssert?: boolean): number;
|
||||
readUInt16LE(offset: number, noAssert?: boolean): number;
|
||||
readUInt16BE(offset: number, noAssert?: boolean): number;
|
||||
readUInt32LE(offset: number, noAssert?: boolean): number;
|
||||
readUInt32BE(offset: number, noAssert?: boolean): number;
|
||||
readInt8(offset: number, noAssert?: boolean): number;
|
||||
readInt16LE(offset: number, noAssert?: boolean): number;
|
||||
readInt16BE(offset: number, noAssert?: boolean): number;
|
||||
readInt32LE(offset: number, noAssert?: boolean): number;
|
||||
readInt32BE(offset: number, noAssert?: boolean): number;
|
||||
readFloatLE(offset: number, noAssert?: boolean): number;
|
||||
readFloatBE(offset: number, noAssert?: boolean): number;
|
||||
readDoubleLE(offset: number, noAssert?: boolean): number;
|
||||
readDoubleBE(offset: number, noAssert?: boolean): number;
|
||||
swap16(): Buffer;
|
||||
swap32(): Buffer;
|
||||
swap64(): Buffer;
|
||||
writeUInt8(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeInt8(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeInt16LE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeInt16BE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeInt32LE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeInt32BE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeFloatLE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeFloatBE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;
|
||||
writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;
|
||||
fill(value: any, offset?: number, end?: number): this;
|
||||
indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
|
||||
lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;
|
||||
includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;
|
||||
|
||||
/**
|
||||
* Allocates a new buffer containing the given {str}.
|
||||
*
|
||||
* @param str String to store in buffer.
|
||||
* @param encoding encoding to use, optional. Default is 'utf8'
|
||||
*/
|
||||
constructor (str: string, encoding?: string);
|
||||
/**
|
||||
* Allocates a new buffer of {size} octets.
|
||||
*
|
||||
* @param size count of octets to allocate.
|
||||
*/
|
||||
constructor (size: number);
|
||||
/**
|
||||
* Allocates a new buffer containing the given {array} of octets.
|
||||
*
|
||||
* @param array The octets to store.
|
||||
*/
|
||||
constructor (array: Uint8Array);
|
||||
/**
|
||||
* Produces a Buffer backed by the same allocated memory as
|
||||
* the given {ArrayBuffer}.
|
||||
*
|
||||
*
|
||||
* @param arrayBuffer The ArrayBuffer with which to share memory.
|
||||
*/
|
||||
constructor (arrayBuffer: ArrayBuffer);
|
||||
/**
|
||||
* Allocates a new buffer containing the given {array} of octets.
|
||||
*
|
||||
* @param array The octets to store.
|
||||
*/
|
||||
constructor (array: any[]);
|
||||
/**
|
||||
* Copies the passed {buffer} data onto a new {Buffer} instance.
|
||||
*
|
||||
* @param buffer The buffer to copy.
|
||||
*/
|
||||
constructor (buffer: Buffer);
|
||||
prototype: Buffer;
|
||||
/**
|
||||
* Allocates a new Buffer using an {array} of octets.
|
||||
*
|
||||
* @param array
|
||||
*/
|
||||
static from(array: any[]): Buffer;
|
||||
/**
|
||||
* When passed a reference to the .buffer property of a TypedArray instance,
|
||||
* the newly created Buffer will share the same allocated memory as the TypedArray.
|
||||
* The optional {byteOffset} and {length} arguments specify a memory range
|
||||
* within the {arrayBuffer} that will be shared by the Buffer.
|
||||
*
|
||||
* @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()
|
||||
* @param byteOffset
|
||||
* @param length
|
||||
*/
|
||||
static from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;
|
||||
/**
|
||||
* Copies the passed {buffer} data onto a new Buffer instance.
|
||||
*
|
||||
* @param buffer
|
||||
*/
|
||||
static from(buffer: Buffer): Buffer;
|
||||
/**
|
||||
* Creates a new Buffer containing the given JavaScript string {str}.
|
||||
* If provided, the {encoding} parameter identifies the character encoding.
|
||||
* If not provided, {encoding} defaults to 'utf8'.
|
||||
*
|
||||
* @param str
|
||||
*/
|
||||
static from(str: string, encoding?: string): Buffer;
|
||||
/**
|
||||
* Returns true if {obj} is a Buffer
|
||||
*
|
||||
* @param obj object to test.
|
||||
*/
|
||||
static isBuffer(obj: any): obj is Buffer;
|
||||
/**
|
||||
* Returns true if {encoding} is a valid encoding argument.
|
||||
* Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
|
||||
*
|
||||
* @param encoding string to test.
|
||||
*/
|
||||
static isEncoding(encoding: string): boolean;
|
||||
/**
|
||||
* Gives the actual byte length of a string. encoding defaults to 'utf8'.
|
||||
* This is not the same as String.prototype.length since that returns the number of characters in a string.
|
||||
*
|
||||
* @param string string to test.
|
||||
* @param encoding encoding used to evaluate (defaults to 'utf8')
|
||||
*/
|
||||
static byteLength(string: string, encoding?: string): number;
|
||||
/**
|
||||
* Returns a buffer which is the result of concatenating all the buffers in the list together.
|
||||
*
|
||||
* If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.
|
||||
* If the list has exactly one item, then the first item of the list is returned.
|
||||
* If the list has more than one item, then a new Buffer is created.
|
||||
*
|
||||
* @param list An array of Buffer objects to concatenate
|
||||
* @param totalLength Total length of the buffers when concatenated.
|
||||
* If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
|
||||
*/
|
||||
static concat(list: Buffer[], totalLength?: number): Buffer;
|
||||
/**
|
||||
* The same as buf1.compare(buf2).
|
||||
*/
|
||||
static compare(buf1: Buffer, buf2: Buffer): number;
|
||||
/**
|
||||
* Allocates a new buffer of {size} octets.
|
||||
*
|
||||
* @param size count of octets to allocate.
|
||||
* @param fill if specified, buffer will be initialized by calling buf.fill(fill).
|
||||
* If parameter is omitted, buffer will be filled with zeros.
|
||||
* @param encoding encoding used for call to buf.fill while initalizing
|
||||
*/
|
||||
static alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;
|
||||
/**
|
||||
* Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
|
||||
* of the newly created Buffer are unknown and may contain sensitive data.
|
||||
*
|
||||
* @param size count of octets to allocate
|
||||
*/
|
||||
static allocUnsafe(size: number): Buffer;
|
||||
/**
|
||||
* Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
|
||||
* of the newly created Buffer are unknown and may contain sensitive data.
|
||||
*
|
||||
* @param size count of octets to allocate
|
||||
*/
|
||||
static allocUnsafeSlow(size: number): Buffer;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import { asyncScheduler } from '../scheduler/async';
|
||||
import { isValidDate } from '../util/isDate';
|
||||
import { operate } from '../util/lift';
|
||||
import { innerFrom } from '../observable/innerFrom';
|
||||
import { createErrorClass } from '../util/createErrorClass';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
import { executeSchedule } from '../util/executeSchedule';
|
||||
export var TimeoutError = createErrorClass(function (_super) {
|
||||
return function TimeoutErrorImpl(info) {
|
||||
if (info === void 0) { info = null; }
|
||||
_super(this);
|
||||
this.message = 'Timeout has occurred';
|
||||
this.name = 'TimeoutError';
|
||||
this.info = info;
|
||||
};
|
||||
});
|
||||
export function timeout(config, schedulerArg) {
|
||||
var _a = (isValidDate(config) ? { first: config } : typeof config === 'number' ? { each: config } : config), first = _a.first, each = _a.each, _b = _a.with, _with = _b === void 0 ? timeoutErrorFactory : _b, _c = _a.scheduler, scheduler = _c === void 0 ? schedulerArg !== null && schedulerArg !== void 0 ? schedulerArg : asyncScheduler : _c, _d = _a.meta, meta = _d === void 0 ? null : _d;
|
||||
if (first == null && each == null) {
|
||||
throw new TypeError('No timeout provided.');
|
||||
}
|
||||
return operate(function (source, subscriber) {
|
||||
var originalSourceSubscription;
|
||||
var timerSubscription;
|
||||
var lastValue = null;
|
||||
var seen = 0;
|
||||
var startTimer = function (delay) {
|
||||
timerSubscription = executeSchedule(subscriber, scheduler, function () {
|
||||
try {
|
||||
originalSourceSubscription.unsubscribe();
|
||||
innerFrom(_with({
|
||||
meta: meta,
|
||||
lastValue: lastValue,
|
||||
seen: seen,
|
||||
})).subscribe(subscriber);
|
||||
}
|
||||
catch (err) {
|
||||
subscriber.error(err);
|
||||
}
|
||||
}, delay);
|
||||
};
|
||||
originalSourceSubscription = source.subscribe(createOperatorSubscriber(subscriber, function (value) {
|
||||
timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();
|
||||
seen++;
|
||||
subscriber.next((lastValue = value));
|
||||
each > 0 && startTimer(each);
|
||||
}, undefined, undefined, function () {
|
||||
if (!(timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.closed)) {
|
||||
timerSubscription === null || timerSubscription === void 0 ? void 0 : timerSubscription.unsubscribe();
|
||||
}
|
||||
lastValue = null;
|
||||
}));
|
||||
!seen && startTimer(first != null ? (typeof first === 'number' ? first : +first - scheduler.now()) : each);
|
||||
});
|
||||
}
|
||||
function timeoutErrorFactory(info) {
|
||||
throw new TimeoutError(info);
|
||||
}
|
||||
//# sourceMappingURL=timeout.js.map
|
||||
@@ -0,0 +1,7 @@
|
||||
var DATA_URI_PATTERN = /^data:(\S*?)?(;charset=[^;]+)?(;[^,]+?)?,(.+)/;
|
||||
|
||||
function matchDataUri(uri) {
|
||||
return DATA_URI_PATTERN.exec(uri);
|
||||
}
|
||||
|
||||
module.exports = matchDataUri;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","2":"C K L G M"},C:{"1":"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 EB FB GB HB EC FC"},D:{"1":"JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"0 1 2 3 4 5 6 7 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"},E:{"1":"B C K L G 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E F A HC zB IC JC KC LC"},F:{"1":"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 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 F B C G M N O w g x y z PC QC RC SC qB AC TC rB"},G:{"1":"cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC ZC aC bC"},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":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:4,C:"Upgrade Insecure Requests"};
|
||||
@@ -0,0 +1,16 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) 2015, Contributors
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software
|
||||
for any purpose with or without fee is hereby granted, provided
|
||||
that the above copyright notice and this permission notice
|
||||
appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
|
||||
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
|
||||
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,244 @@
|
||||
import { isCommandBuilderCallback } from './command.js';
|
||||
import { assertNotStrictEqual } from './typings/common-types.js';
|
||||
import * as templates from './completion-templates.js';
|
||||
import { isPromise } from './utils/is-promise.js';
|
||||
import { parseCommand } from './parse-command.js';
|
||||
export class Completion {
|
||||
constructor(yargs, usage, command, shim) {
|
||||
var _a, _b, _c;
|
||||
this.yargs = yargs;
|
||||
this.usage = usage;
|
||||
this.command = command;
|
||||
this.shim = shim;
|
||||
this.completionKey = 'get-yargs-completions';
|
||||
this.aliases = null;
|
||||
this.customCompletionFunction = null;
|
||||
this.indexAfterLastReset = 0;
|
||||
this.zshShell =
|
||||
(_c = (((_a = this.shim.getEnv('SHELL')) === null || _a === void 0 ? void 0 : _a.includes('zsh')) ||
|
||||
((_b = this.shim.getEnv('ZSH_NAME')) === null || _b === void 0 ? void 0 : _b.includes('zsh')))) !== null && _c !== void 0 ? _c : false;
|
||||
}
|
||||
defaultCompletion(args, argv, current, done) {
|
||||
const handlers = this.command.getCommandHandlers();
|
||||
for (let i = 0, ii = args.length; i < ii; ++i) {
|
||||
if (handlers[args[i]] && handlers[args[i]].builder) {
|
||||
const builder = handlers[args[i]].builder;
|
||||
if (isCommandBuilderCallback(builder)) {
|
||||
this.indexAfterLastReset = i + 1;
|
||||
const y = this.yargs.getInternalMethods().reset();
|
||||
builder(y, true);
|
||||
return y.argv;
|
||||
}
|
||||
}
|
||||
}
|
||||
const completions = [];
|
||||
this.commandCompletions(completions, args, current);
|
||||
this.optionCompletions(completions, args, argv, current);
|
||||
this.choicesFromOptionsCompletions(completions, args, argv, current);
|
||||
this.choicesFromPositionalsCompletions(completions, args, argv, current);
|
||||
done(null, completions);
|
||||
}
|
||||
commandCompletions(completions, args, current) {
|
||||
const parentCommands = this.yargs
|
||||
.getInternalMethods()
|
||||
.getContext().commands;
|
||||
if (!current.match(/^-/) &&
|
||||
parentCommands[parentCommands.length - 1] !== current &&
|
||||
!this.previousArgHasChoices(args)) {
|
||||
this.usage.getCommands().forEach(usageCommand => {
|
||||
const commandName = parseCommand(usageCommand[0]).cmd;
|
||||
if (args.indexOf(commandName) === -1) {
|
||||
if (!this.zshShell) {
|
||||
completions.push(commandName);
|
||||
}
|
||||
else {
|
||||
const desc = usageCommand[1] || '';
|
||||
completions.push(commandName.replace(/:/g, '\\:') + ':' + desc);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
optionCompletions(completions, args, argv, current) {
|
||||
if ((current.match(/^-/) || (current === '' && completions.length === 0)) &&
|
||||
!this.previousArgHasChoices(args)) {
|
||||
const options = this.yargs.getOptions();
|
||||
const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
|
||||
Object.keys(options.key).forEach(key => {
|
||||
const negable = !!options.configuration['boolean-negation'] &&
|
||||
options.boolean.includes(key);
|
||||
const isPositionalKey = positionalKeys.includes(key);
|
||||
if (!isPositionalKey &&
|
||||
!options.hiddenOptions.includes(key) &&
|
||||
!this.argsContainKey(args, key, negable)) {
|
||||
this.completeOptionKey(key, completions, current);
|
||||
if (negable && !!options.default[key])
|
||||
this.completeOptionKey(`no-${key}`, completions, current);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
choicesFromOptionsCompletions(completions, args, argv, current) {
|
||||
if (this.previousArgHasChoices(args)) {
|
||||
const choices = this.getPreviousArgChoices(args);
|
||||
if (choices && choices.length > 0) {
|
||||
completions.push(...choices.map(c => c.replace(/:/g, '\\:')));
|
||||
}
|
||||
}
|
||||
}
|
||||
choicesFromPositionalsCompletions(completions, args, argv, current) {
|
||||
if (current === '' &&
|
||||
completions.length > 0 &&
|
||||
this.previousArgHasChoices(args)) {
|
||||
return;
|
||||
}
|
||||
const positionalKeys = this.yargs.getGroups()[this.usage.getPositionalGroupName()] || [];
|
||||
const offset = Math.max(this.indexAfterLastReset, this.yargs.getInternalMethods().getContext().commands.length +
|
||||
1);
|
||||
const positionalKey = positionalKeys[argv._.length - offset - 1];
|
||||
if (!positionalKey) {
|
||||
return;
|
||||
}
|
||||
const choices = this.yargs.getOptions().choices[positionalKey] || [];
|
||||
for (const choice of choices) {
|
||||
if (choice.startsWith(current)) {
|
||||
completions.push(choice.replace(/:/g, '\\:'));
|
||||
}
|
||||
}
|
||||
}
|
||||
getPreviousArgChoices(args) {
|
||||
if (args.length < 1)
|
||||
return;
|
||||
let previousArg = args[args.length - 1];
|
||||
let filter = '';
|
||||
if (!previousArg.startsWith('-') && args.length > 1) {
|
||||
filter = previousArg;
|
||||
previousArg = args[args.length - 2];
|
||||
}
|
||||
if (!previousArg.startsWith('-'))
|
||||
return;
|
||||
const previousArgKey = previousArg.replace(/^-+/, '');
|
||||
const options = this.yargs.getOptions();
|
||||
const possibleAliases = [
|
||||
previousArgKey,
|
||||
...(this.yargs.getAliases()[previousArgKey] || []),
|
||||
];
|
||||
let choices;
|
||||
for (const possibleAlias of possibleAliases) {
|
||||
if (Object.prototype.hasOwnProperty.call(options.key, possibleAlias) &&
|
||||
Array.isArray(options.choices[possibleAlias])) {
|
||||
choices = options.choices[possibleAlias];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (choices) {
|
||||
return choices.filter(choice => !filter || choice.startsWith(filter));
|
||||
}
|
||||
}
|
||||
previousArgHasChoices(args) {
|
||||
const choices = this.getPreviousArgChoices(args);
|
||||
return choices !== undefined && choices.length > 0;
|
||||
}
|
||||
argsContainKey(args, key, negable) {
|
||||
const argsContains = (s) => args.indexOf((/^[^0-9]$/.test(s) ? '-' : '--') + s) !== -1;
|
||||
if (argsContains(key))
|
||||
return true;
|
||||
if (negable && argsContains(`no-${key}`))
|
||||
return true;
|
||||
if (this.aliases) {
|
||||
for (const alias of this.aliases[key]) {
|
||||
if (argsContains(alias))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
completeOptionKey(key, completions, current) {
|
||||
var _a, _b, _c;
|
||||
const descs = this.usage.getDescriptions();
|
||||
const startsByTwoDashes = (s) => /^--/.test(s);
|
||||
const isShortOption = (s) => /^[^0-9]$/.test(s);
|
||||
const dashes = !startsByTwoDashes(current) && isShortOption(key) ? '-' : '--';
|
||||
if (!this.zshShell) {
|
||||
completions.push(dashes + key);
|
||||
}
|
||||
else {
|
||||
const aliasKey = (_a = this === null || this === void 0 ? void 0 : this.aliases) === null || _a === void 0 ? void 0 : _a[key].find(alias => {
|
||||
const desc = descs[alias];
|
||||
return typeof desc === 'string' && desc.length > 0;
|
||||
});
|
||||
const descFromAlias = aliasKey ? descs[aliasKey] : undefined;
|
||||
const desc = (_c = (_b = descs[key]) !== null && _b !== void 0 ? _b : descFromAlias) !== null && _c !== void 0 ? _c : '';
|
||||
completions.push(dashes +
|
||||
`${key.replace(/:/g, '\\:')}:${desc
|
||||
.replace('__yargsString__:', '')
|
||||
.replace(/(\r\n|\n|\r)/gm, ' ')}`);
|
||||
}
|
||||
}
|
||||
customCompletion(args, argv, current, done) {
|
||||
assertNotStrictEqual(this.customCompletionFunction, null, this.shim);
|
||||
if (isSyncCompletionFunction(this.customCompletionFunction)) {
|
||||
const result = this.customCompletionFunction(current, argv);
|
||||
if (isPromise(result)) {
|
||||
return result
|
||||
.then(list => {
|
||||
this.shim.process.nextTick(() => {
|
||||
done(null, list);
|
||||
});
|
||||
})
|
||||
.catch(err => {
|
||||
this.shim.process.nextTick(() => {
|
||||
done(err, undefined);
|
||||
});
|
||||
});
|
||||
}
|
||||
return done(null, result);
|
||||
}
|
||||
else if (isFallbackCompletionFunction(this.customCompletionFunction)) {
|
||||
return this.customCompletionFunction(current, argv, (onCompleted = done) => this.defaultCompletion(args, argv, current, onCompleted), completions => {
|
||||
done(null, completions);
|
||||
});
|
||||
}
|
||||
else {
|
||||
return this.customCompletionFunction(current, argv, completions => {
|
||||
done(null, completions);
|
||||
});
|
||||
}
|
||||
}
|
||||
getCompletion(args, done) {
|
||||
const current = args.length ? args[args.length - 1] : '';
|
||||
const argv = this.yargs.parse(args, true);
|
||||
const completionFunction = this.customCompletionFunction
|
||||
? (argv) => this.customCompletion(args, argv, current, done)
|
||||
: (argv) => this.defaultCompletion(args, argv, current, done);
|
||||
return isPromise(argv)
|
||||
? argv.then(completionFunction)
|
||||
: completionFunction(argv);
|
||||
}
|
||||
generateCompletionScript($0, cmd) {
|
||||
let script = this.zshShell
|
||||
? templates.completionZshTemplate
|
||||
: templates.completionShTemplate;
|
||||
const name = this.shim.path.basename($0);
|
||||
if ($0.match(/\.js$/))
|
||||
$0 = `./${$0}`;
|
||||
script = script.replace(/{{app_name}}/g, name);
|
||||
script = script.replace(/{{completion_command}}/g, cmd);
|
||||
return script.replace(/{{app_path}}/g, $0);
|
||||
}
|
||||
registerFunction(fn) {
|
||||
this.customCompletionFunction = fn;
|
||||
}
|
||||
setParsed(parsed) {
|
||||
this.aliases = parsed.aliases;
|
||||
}
|
||||
}
|
||||
export function completion(yargs, usage, command, shim) {
|
||||
return new Completion(yargs, usage, command, shim);
|
||||
}
|
||||
function isSyncCompletionFunction(completionFunction) {
|
||||
return completionFunction.length < 3;
|
||||
}
|
||||
function isFallbackCompletionFunction(completionFunction) {
|
||||
return completionFunction.length > 3;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import Wrapper from './shared/Wrapper';
|
||||
import Renderer from '../Renderer';
|
||||
import Block from '../Block';
|
||||
import Title from '../../nodes/Title';
|
||||
import { Identifier } from 'estree';
|
||||
export default class TitleWrapper extends Wrapper {
|
||||
node: Title;
|
||||
constructor(renderer: Renderer, block: Block, parent: Wrapper, node: Title, _strip_whitespace: boolean, _next_sibling: Wrapper);
|
||||
render(block: Block, _parent_node: Identifier, _parent_nodes: Identifier): void;
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"name": "memoizee",
|
||||
"version": "0.4.15",
|
||||
"description": "Memoize/cache function results",
|
||||
"author": "Mariusz Nowak <medikoo@medikoo.com> (http://www.medikoo.com/)",
|
||||
"keywords": [
|
||||
"memoize",
|
||||
"memoizer",
|
||||
"cache",
|
||||
"memoization",
|
||||
"memo",
|
||||
"memcached",
|
||||
"hashing.",
|
||||
"storage",
|
||||
"caching",
|
||||
"memory",
|
||||
"gc",
|
||||
"weak",
|
||||
"garbage",
|
||||
"collector",
|
||||
"async"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/medikoo/memoizee.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"d": "^1.0.1",
|
||||
"es5-ext": "^0.10.53",
|
||||
"es6-weak-map": "^2.0.3",
|
||||
"event-emitter": "^0.3.5",
|
||||
"is-promise": "^2.2.2",
|
||||
"lru-queue": "^0.1.0",
|
||||
"next-tick": "^1.1.0",
|
||||
"timers-ext": "^0.1.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bluebird": "^3.7.2",
|
||||
"eslint": "^5.16.0",
|
||||
"eslint-config-medikoo-es5": "^1.7.3",
|
||||
"plain-promise": "^0.1.1",
|
||||
"tad": "^2.0.1"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "medikoo-es5",
|
||||
"root": true,
|
||||
"globals": {
|
||||
"setTimeout": true,
|
||||
"clearTimeout": true
|
||||
},
|
||||
"rules": {
|
||||
"max-lines-per-function": "off"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint --ignore-path=.gitignore .",
|
||||
"test": "tad"
|
||||
},
|
||||
"license": "ISC"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F CC","8":"A B"},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","578":"C K L G M N O"},C:{"1":"0 O w g x y z SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"DC tB EC FC","4":"I v J D E F A B C K L G M N","194":"1 2 3 4 5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"I v J D E F A B C K L G M N O w g x"},E:{"2":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"F B C PC QC RC SC qB AC TC rB"},G:{"1":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"1":"tB I f pC qC rC sC BC tC uC"},J:{"1":"D A"},K:{"1":"B C h qB AC rB","2":"A"},L:{"1":"H"},M:{"1":"H"},N:{"8":"A","260":"B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"BD","2":"AD"}},B:2,C:"Touch events"};
|
||||
@@ -0,0 +1,42 @@
|
||||
module.exports = isexe
|
||||
isexe.sync = sync
|
||||
|
||||
var fs = require('fs')
|
||||
|
||||
function checkPathExt (path, options) {
|
||||
var pathext = options.pathExt !== undefined ?
|
||||
options.pathExt : process.env.PATHEXT
|
||||
|
||||
if (!pathext) {
|
||||
return true
|
||||
}
|
||||
|
||||
pathext = pathext.split(';')
|
||||
if (pathext.indexOf('') !== -1) {
|
||||
return true
|
||||
}
|
||||
for (var i = 0; i < pathext.length; i++) {
|
||||
var p = pathext[i].toLowerCase()
|
||||
if (p && path.substr(-p.length).toLowerCase() === p) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
function checkStat (stat, path, options) {
|
||||
if (!stat.isSymbolicLink() && !stat.isFile()) {
|
||||
return false
|
||||
}
|
||||
return checkPathExt(path, options)
|
||||
}
|
||||
|
||||
function isexe (path, options, cb) {
|
||||
fs.stat(path, function (er, stat) {
|
||||
cb(er, er ? false : checkStat(stat, path, options))
|
||||
})
|
||||
}
|
||||
|
||||
function sync (path, options) {
|
||||
return checkStat(fs.statSync(path), path, options)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('startCase', require('../startCase'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"git-url-parse","version":"13.1.0","files":{"LICENSE":{"checkedAt":1678883670748,"integrity":"sha512-yEG/RgRB4Oj58Hodk3CbrvBh7dgBj3mxnLY8c7eR2EkLfOdg1h9IWvXfyQoc8K+IUpu1F6tJP6hou/A+wZg4Nw==","mode":420,"size":1134},"lib/index.js":{"checkedAt":1678883670752,"integrity":"sha512-pLwWBXEWeACfWgXzRrpHsaoFYbPS80xFryRD12depQzWp4NMXJxX6cZ2kid042T8q/FRdcgSpq8M3HB4Zkq/Ig==","mode":420,"size":11920},"package.json":{"checkedAt":1678883670753,"integrity":"sha512-8R7X4N7myzNjUIcyMOVdDttVE5FN6L4HQHk+ueTvJaS5SmnP6BB3QgvfZ1HAH7mwys2abY8TXf5sGJJMtGoG2A==","mode":420,"size":1048},"README.md":{"checkedAt":1678883670753,"integrity":"sha512-bJ2/xGmkBvmyCBrJWgSg1o5kTc+higEPQ1Q1zU63Ofcohc70TNfWp/OnUGkMCWkwxvKLxZM0B1QWGOz3m7hwHg==","mode":420,"size":16943}}}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"node-releases","version":"2.0.10","files":{"LICENSE":{"checkedAt":1678883670266,"integrity":"sha512-Z7cB51PZdzP3HlW3aOh7wAMWWeD9DLWXOLaiyfNgQ8ofbBgVjjmKuqVubKkQWAr1KLYi7A+RK472Di8r+ZzBfg==","mode":420,"size":1107},"README.md":{"checkedAt":1678883670267,"integrity":"sha512-2AIHQR+yGmsF7NPo9T0hPQV6uLqsTGqk1uO/p/sKfPPVrekUOpVh5Jw8Lskei/lmHu54/82kxDkfkI2QmvBn/Q==","mode":420,"size":505},"package.json":{"checkedAt":1678883670267,"integrity":"sha512-O/tY5JfGbCa+J9wblbI8oFjm9pqaMix15IQamXCw3032zXu7JlIGoPDIhvRW7UGUAN3P9SH4+2PJE86jAdS62Q==","mode":420,"size":366},"data/release-schedule/release-schedule.json":{"checkedAt":1678883670267,"integrity":"sha512-szS75BOFeIdBsxk9XTMfkiFZ6hoU8BbDH+hZUjtg4EBwGsAW8/KhbNiPH+NMEG0An1eqDxVgrnA2QPr6uqqotA==","mode":420,"size":1767},"data/processed/envs.json":{"checkedAt":1678883670267,"integrity":"sha512-haohg/63Idsxm6Q4y2eyvbIAfPjvj5roKOlHuNPQyjheXnrhZW5nvhJbU7dlkq37FzNQ5usUJBKMcgyfkzGJSw==","mode":420,"size":22630}}}
|
||||
@@ -0,0 +1,31 @@
|
||||
/// <reference types="node" />
|
||||
import * as fsWalk from '@nodelib/fs.walk';
|
||||
export declare type ErrnoException = NodeJS.ErrnoException;
|
||||
export declare type Entry = fsWalk.Entry;
|
||||
export declare type EntryItem = string | Entry;
|
||||
export declare type Pattern = string;
|
||||
export declare type PatternRe = RegExp;
|
||||
export declare type PatternsGroup = Record<string, Pattern[]>;
|
||||
export declare type ReaderOptions = fsWalk.Options & {
|
||||
transform(entry: Entry): EntryItem;
|
||||
deepFilter: DeepFilterFunction;
|
||||
entryFilter: EntryFilterFunction;
|
||||
errorFilter: ErrorFilterFunction;
|
||||
fs: FileSystemAdapter;
|
||||
stats: boolean;
|
||||
};
|
||||
export declare type ErrorFilterFunction = fsWalk.ErrorFilterFunction;
|
||||
export declare type EntryFilterFunction = fsWalk.EntryFilterFunction;
|
||||
export declare type DeepFilterFunction = fsWalk.DeepFilterFunction;
|
||||
export declare type EntryTransformerFunction = (entry: Entry) => EntryItem;
|
||||
export declare type MicromatchOptions = {
|
||||
dot?: boolean;
|
||||
matchBase?: boolean;
|
||||
nobrace?: boolean;
|
||||
nocase?: boolean;
|
||||
noext?: boolean;
|
||||
noglobstar?: boolean;
|
||||
posix?: boolean;
|
||||
strictSlashes?: boolean;
|
||||
};
|
||||
export declare type FileSystemAdapter = fsWalk.FileSystemAdapter;
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"main": "wrong.js"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"isIterable.d.ts","sourceRoot":"","sources":["../../../../src/internal/util/isIterable.ts"],"names":[],"mappings":"AAGA,+CAA+C;AAC/C,wBAAgB,UAAU,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,QAAQ,CAAC,GAAG,CAAC,CAE7D"}
|
||||
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.elementAt = void 0;
|
||||
var ArgumentOutOfRangeError_1 = require("../util/ArgumentOutOfRangeError");
|
||||
var filter_1 = require("./filter");
|
||||
var throwIfEmpty_1 = require("./throwIfEmpty");
|
||||
var defaultIfEmpty_1 = require("./defaultIfEmpty");
|
||||
var take_1 = require("./take");
|
||||
function elementAt(index, defaultValue) {
|
||||
if (index < 0) {
|
||||
throw new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError();
|
||||
}
|
||||
var hasDefaultValue = arguments.length >= 2;
|
||||
return function (source) {
|
||||
return source.pipe(filter_1.filter(function (v, i) { return i === index; }), take_1.take(1), hasDefaultValue ? defaultIfEmpty_1.defaultIfEmpty(defaultValue) : throwIfEmpty_1.throwIfEmpty(function () { return new ArgumentOutOfRangeError_1.ArgumentOutOfRangeError(); }));
|
||||
};
|
||||
}
|
||||
exports.elementAt = elementAt;
|
||||
//# sourceMappingURL=elementAt.js.map
|
||||
@@ -0,0 +1,168 @@
|
||||
language: node_js
|
||||
os:
|
||||
- linux
|
||||
node_js:
|
||||
- "8.4"
|
||||
- "7.10"
|
||||
- "6.11"
|
||||
- "5.12"
|
||||
- "4.8"
|
||||
- "iojs-v3.3"
|
||||
- "iojs-v2.5"
|
||||
- "iojs-v1.8"
|
||||
- "0.12"
|
||||
- "0.10"
|
||||
- "0.8"
|
||||
before_install:
|
||||
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi'
|
||||
- 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then if [ "${TRAVIS_NODE_VERSION%${TRAVIS_NODE_VERSION#[0-9]}}" = "0" ] || [ "${TRAVIS_NODE_VERSION:0:4}" = "iojs" ]; then npm install -g npm@4.5 ; else npm install -g npm; fi; fi'
|
||||
install:
|
||||
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
|
||||
script:
|
||||
- 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
|
||||
- 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
|
||||
- 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi'
|
||||
- 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
|
||||
sudo: false
|
||||
env:
|
||||
- TEST=true
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- node_js: "node"
|
||||
env: PRETEST=true
|
||||
- node_js: "4"
|
||||
env: COVERAGE=true
|
||||
- node_js: "8.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "8.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "7.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.10"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "6.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.11"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.10"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.8"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "5.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "4.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v3.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v3.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v3.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v2.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.7"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.5"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.3"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.2"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.1"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "iojs-v1.0"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.11"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.9"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.6"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
- node_js: "0.4"
|
||||
env: TEST=true ALLOW_FAILURE=true
|
||||
allow_failures:
|
||||
- os: osx
|
||||
- env: TEST=true ALLOW_FAILURE=true
|
||||
@@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "degenerator",
|
||||
"version": "3.0.2",
|
||||
"description": "Compiles sync functions into async generator functions",
|
||||
"main": "dist/src/index",
|
||||
"typings": "dist/src/index",
|
||||
"files": [
|
||||
"dist/src"
|
||||
],
|
||||
"scripts": {
|
||||
"prebuild": "rimraf dist",
|
||||
"build": "tsc",
|
||||
"postbuild": "cpy --parents src test '!**/*.ts' dist",
|
||||
"test": "mocha --reporter spec dist/test/test.js",
|
||||
"test-lint": "eslint src --ext .js,.ts",
|
||||
"prepublishOnly": "npm run build"
|
||||
},
|
||||
"author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/TooTallNate/node-degenerator.git"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"ast-types": "^0.13.2",
|
||||
"escodegen": "^1.8.1",
|
||||
"esprima": "^4.0.0",
|
||||
"vm2": "^3.9.8"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/escodegen": "^0.0.6",
|
||||
"@types/esprima": "^4.0.2",
|
||||
"@types/mocha": "^5.2.7",
|
||||
"@types/node": "^12.12.17",
|
||||
"@typescript-eslint/eslint-plugin": "1.6.0",
|
||||
"@typescript-eslint/parser": "1.1.0",
|
||||
"cpy-cli": "^2.0.0",
|
||||
"eslint": "5.16.0",
|
||||
"eslint-config-airbnb": "17.1.0",
|
||||
"eslint-config-prettier": "4.1.0",
|
||||
"eslint-import-resolver-typescript": "1.1.1",
|
||||
"eslint-plugin-import": "2.16.0",
|
||||
"eslint-plugin-jsx-a11y": "6.2.1",
|
||||
"eslint-plugin-react": "7.12.4",
|
||||
"mocha": "^6.2.0",
|
||||
"rimraf": "^3.0.0",
|
||||
"typescript": "^3.7.3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
var SetCache = require('./_SetCache'),
|
||||
arrayIncludes = require('./_arrayIncludes'),
|
||||
arrayIncludesWith = require('./_arrayIncludesWith'),
|
||||
arrayMap = require('./_arrayMap'),
|
||||
baseUnary = require('./_baseUnary'),
|
||||
cacheHas = require('./_cacheHas');
|
||||
|
||||
/** Used as the size to enable large array optimizations. */
|
||||
var LARGE_ARRAY_SIZE = 200;
|
||||
|
||||
/**
|
||||
* The base implementation of methods like `_.difference` without support
|
||||
* for excluding multiple arrays or iteratee shorthands.
|
||||
*
|
||||
* @private
|
||||
* @param {Array} array The array to inspect.
|
||||
* @param {Array} values The values to exclude.
|
||||
* @param {Function} [iteratee] The iteratee invoked per element.
|
||||
* @param {Function} [comparator] The comparator invoked per element.
|
||||
* @returns {Array} Returns the new array of filtered values.
|
||||
*/
|
||||
function baseDifference(array, values, iteratee, comparator) {
|
||||
var index = -1,
|
||||
includes = arrayIncludes,
|
||||
isCommon = true,
|
||||
length = array.length,
|
||||
result = [],
|
||||
valuesLength = values.length;
|
||||
|
||||
if (!length) {
|
||||
return result;
|
||||
}
|
||||
if (iteratee) {
|
||||
values = arrayMap(values, baseUnary(iteratee));
|
||||
}
|
||||
if (comparator) {
|
||||
includes = arrayIncludesWith;
|
||||
isCommon = false;
|
||||
}
|
||||
else if (values.length >= LARGE_ARRAY_SIZE) {
|
||||
includes = cacheHas;
|
||||
isCommon = false;
|
||||
values = new SetCache(values);
|
||||
}
|
||||
outer:
|
||||
while (++index < length) {
|
||||
var value = array[index],
|
||||
computed = iteratee == null ? value : iteratee(value);
|
||||
|
||||
value = (comparator || value !== 0) ? value : 0;
|
||||
if (isCommon && computed === computed) {
|
||||
var valuesIndex = valuesLength;
|
||||
while (valuesIndex--) {
|
||||
if (values[valuesIndex] === computed) {
|
||||
continue outer;
|
||||
}
|
||||
}
|
||||
result.push(value);
|
||||
}
|
||||
else if (!includes(values, computed, comparator)) {
|
||||
result.push(value);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = baseDifference;
|
||||
@@ -0,0 +1,98 @@
|
||||
import { Subject } from '../Subject';
|
||||
import { Observable } from '../Observable';
|
||||
import { ConnectableObservable } from '../observable/ConnectableObservable';
|
||||
import { OperatorFunction, UnaryFunction, ObservedValueOf, ObservableInput } from '../types';
|
||||
import { isFunction } from '../util/isFunction';
|
||||
import { connect } from './connect';
|
||||
|
||||
/**
|
||||
* An operator that creates a {@link ConnectableObservable}, that when connected,
|
||||
* with the `connect` method, will use the provided subject to multicast the values
|
||||
* from the source to all consumers.
|
||||
*
|
||||
* @param subject The subject to multicast through.
|
||||
* @return A function that returns a {@link ConnectableObservable}
|
||||
* @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
|
||||
* If you're using {@link refCount} after `multicast`, use the {@link share} operator instead.
|
||||
* `multicast(subject), refCount()` is equivalent to
|
||||
* `share({ connector: () => subject, resetOnError: false, resetOnComplete: false, resetOnRefCountZero: false })`.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export function multicast<T>(subject: Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
|
||||
|
||||
/**
|
||||
* Because this is deprecated in favor of the {@link connect} operator, and was otherwise poorly documented,
|
||||
* rather than duplicate the effort of documenting the same behavior, please see documentation for the
|
||||
* {@link connect} operator.
|
||||
*
|
||||
* @param subject The subject used to multicast.
|
||||
* @param selector A setup function to setup the multicast
|
||||
* @return A function that returns an observable that mirrors the observable returned by the selector.
|
||||
* @deprecated Will be removed in v8. Use the {@link connect} operator instead.
|
||||
* `multicast(subject, selector)` is equivalent to
|
||||
* `connect(selector, { connector: () => subject })`.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export function multicast<T, O extends ObservableInput<any>>(
|
||||
subject: Subject<T>,
|
||||
selector: (shared: Observable<T>) => O
|
||||
): OperatorFunction<T, ObservedValueOf<O>>;
|
||||
|
||||
/**
|
||||
* An operator that creates a {@link ConnectableObservable}, that when connected,
|
||||
* with the `connect` method, will use the provided subject to multicast the values
|
||||
* from the source to all consumers.
|
||||
*
|
||||
* @param subjectFactory A factory that will be called to create the subject. Passing a function here
|
||||
* will cause the underlying subject to be "reset" on error, completion, or refCounted unsubscription of
|
||||
* the source.
|
||||
* @return A function that returns a {@link ConnectableObservable}
|
||||
* @deprecated Will be removed in v8. To create a connectable observable, use {@link connectable}.
|
||||
* If you're using {@link refCount} after `multicast`, use the {@link share} operator instead.
|
||||
* `multicast(() => new BehaviorSubject('test')), refCount()` is equivalent to
|
||||
* `share({ connector: () => new BehaviorSubject('test') })`.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export function multicast<T>(subjectFactory: () => Subject<T>): UnaryFunction<Observable<T>, ConnectableObservable<T>>;
|
||||
|
||||
/**
|
||||
* Because this is deprecated in favor of the {@link connect} operator, and was otherwise poorly documented,
|
||||
* rather than duplicate the effort of documenting the same behavior, please see documentation for the
|
||||
* {@link connect} operator.
|
||||
*
|
||||
* @param subjectFactory A factory that creates the subject used to multicast.
|
||||
* @param selector A function to setup the multicast and select the output.
|
||||
* @return A function that returns an observable that mirrors the observable returned by the selector.
|
||||
* @deprecated Will be removed in v8. Use the {@link connect} operator instead.
|
||||
* `multicast(subjectFactory, selector)` is equivalent to
|
||||
* `connect(selector, { connector: subjectFactory })`.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export function multicast<T, O extends ObservableInput<any>>(
|
||||
subjectFactory: () => Subject<T>,
|
||||
selector: (shared: Observable<T>) => O
|
||||
): OperatorFunction<T, ObservedValueOf<O>>;
|
||||
|
||||
/**
|
||||
* @deprecated Will be removed in v8. Use the {@link connectable} observable, the {@link connect} operator or the
|
||||
* {@link share} operator instead. See the overloads below for equivalent replacement examples of this operator's
|
||||
* behaviors.
|
||||
* Details: https://rxjs.dev/deprecations/multicasting
|
||||
*/
|
||||
export function multicast<T, R>(
|
||||
subjectOrSubjectFactory: Subject<T> | (() => Subject<T>),
|
||||
selector?: (source: Observable<T>) => Observable<R>
|
||||
): OperatorFunction<T, R> {
|
||||
const subjectFactory = isFunction(subjectOrSubjectFactory) ? subjectOrSubjectFactory : () => subjectOrSubjectFactory;
|
||||
|
||||
if (isFunction(selector)) {
|
||||
// If a selector function is provided, then we're a "normal" operator that isn't
|
||||
// going to return a ConnectableObservable. We can use `connect` to do what we
|
||||
// need to do.
|
||||
return connect(selector, {
|
||||
connector: subjectFactory,
|
||||
});
|
||||
}
|
||||
|
||||
return (source: Observable<T>) => new ConnectableObservable<any>(source, subjectFactory);
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export default function(instance) {
|
||||
instance.registerHelper('lookup', function(obj, field, options) {
|
||||
if (!obj) {
|
||||
// Note for 5.0: Change to "obj == null" in 5.0
|
||||
return obj;
|
||||
}
|
||||
return options.lookupProperty(obj, field);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
declare namespace callsites {
|
||||
interface CallSite {
|
||||
/**
|
||||
Returns the value of `this`.
|
||||
*/
|
||||
getThis(): unknown | undefined;
|
||||
|
||||
/**
|
||||
Returns the type of `this` as a string. This is the name of the function stored in the constructor field of `this`, if available, otherwise the object's `[[Class]]` internal property.
|
||||
*/
|
||||
getTypeName(): string | null;
|
||||
|
||||
/**
|
||||
Returns the current function.
|
||||
*/
|
||||
getFunction(): Function | undefined;
|
||||
|
||||
/**
|
||||
Returns the name of the current function, typically its `name` property. If a name property is not available an attempt will be made to try to infer a name from the function's context.
|
||||
*/
|
||||
getFunctionName(): string | null;
|
||||
|
||||
/**
|
||||
Returns the name of the property of `this` or one of its prototypes that holds the current function.
|
||||
*/
|
||||
getMethodName(): string | undefined;
|
||||
|
||||
/**
|
||||
Returns the name of the script if this function was defined in a script.
|
||||
*/
|
||||
getFileName(): string | null;
|
||||
|
||||
/**
|
||||
Returns the current line number if this function was defined in a script.
|
||||
*/
|
||||
getLineNumber(): number | null;
|
||||
|
||||
/**
|
||||
Returns the current column number if this function was defined in a script.
|
||||
*/
|
||||
getColumnNumber(): number | null;
|
||||
|
||||
/**
|
||||
Returns a string representing the location where `eval` was called if this function was created using a call to `eval`.
|
||||
*/
|
||||
getEvalOrigin(): string | undefined;
|
||||
|
||||
/**
|
||||
Returns `true` if this is a top-level invocation, that is, if it's a global object.
|
||||
*/
|
||||
isToplevel(): boolean;
|
||||
|
||||
/**
|
||||
Returns `true` if this call takes place in code defined by a call to `eval`.
|
||||
*/
|
||||
isEval(): boolean;
|
||||
|
||||
/**
|
||||
Returns `true` if this call is in native V8 code.
|
||||
*/
|
||||
isNative(): boolean;
|
||||
|
||||
/**
|
||||
Returns `true` if this is a constructor call.
|
||||
*/
|
||||
isConstructor(): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare const callsites: {
|
||||
/**
|
||||
Get callsites from the V8 stack trace API.
|
||||
|
||||
@returns An array of `CallSite` objects.
|
||||
|
||||
@example
|
||||
```
|
||||
import callsites = require('callsites');
|
||||
|
||||
function unicorn() {
|
||||
console.log(callsites()[0].getFileName());
|
||||
//=> '/Users/sindresorhus/dev/callsites/test.js'
|
||||
}
|
||||
|
||||
unicorn();
|
||||
```
|
||||
*/
|
||||
(): callsites.CallSite[];
|
||||
|
||||
// TODO: Remove this for the next major release, refactor the whole definition to:
|
||||
// declare function callsites(): callsites.CallSite[];
|
||||
// export = callsites;
|
||||
default: typeof callsites;
|
||||
};
|
||||
|
||||
export = callsites;
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"Commands:": "Команди:",
|
||||
"Options:": "Опції:",
|
||||
"Examples:": "Приклади:",
|
||||
"boolean": "boolean",
|
||||
"count": "кількість",
|
||||
"string": "строка",
|
||||
"number": "число",
|
||||
"array": "масива",
|
||||
"required": "обов'язково",
|
||||
"default": "за замовчуванням",
|
||||
"default:": "за замовчуванням:",
|
||||
"choices:": "доступні варіанти:",
|
||||
"aliases:": "псевдоніми:",
|
||||
"generated-value": "згенероване значення",
|
||||
"Not enough non-option arguments: got %s, need at least %s": {
|
||||
"one": "Недостатньо аргументів: наразі %s, потрібно %s або більше",
|
||||
"other": "Недостатньо аргументів: наразі %s, потрібно %s або більше"
|
||||
},
|
||||
"Too many non-option arguments: got %s, maximum of %s": {
|
||||
"one": "Забагато аргументів: наразі %s, максимум %s",
|
||||
"other": "Too many non-option arguments: наразі %s, максимум of %s"
|
||||
},
|
||||
"Missing argument value: %s": {
|
||||
"one": "Відсутнє значення для аргументу: %s",
|
||||
"other": "Відсутні значення для аргументу: %s"
|
||||
},
|
||||
"Missing required argument: %s": {
|
||||
"one": "Відсутній обов'язковий аргумент: %s",
|
||||
"other": "Відсутні обов'язкові аргументи: %s"
|
||||
},
|
||||
"Unknown argument: %s": {
|
||||
"one": "Аргумент %s не підтримується",
|
||||
"other": "Аргументи %s не підтримуються"
|
||||
},
|
||||
"Invalid values:": "Некоректні значення:",
|
||||
"Argument: %s, Given: %s, Choices: %s": "Аргумент: %s, Введено: %s, Доступні варіанти: %s",
|
||||
"Argument check failed: %s": "Аргумент не пройшов перевірку: %s",
|
||||
"Implications failed:": "Відсутні залежні аргументи:",
|
||||
"Not enough arguments following: %s": "Не достатньо аргументів після: %s",
|
||||
"Invalid JSON config file: %s": "Некоректний JSON-файл конфігурації: %s",
|
||||
"Path to JSON config file": "Шлях до JSON-файлу конфігурації",
|
||||
"Show help": "Показати довідку",
|
||||
"Show version number": "Показати версію",
|
||||
"Did you mean %s?": "Можливо, ви мали на увазі %s?",
|
||||
"Arguments %s and %s are mutually exclusive" : "Аргументи %s та %s взаємовиключні",
|
||||
"Positionals:": "Позиційні:",
|
||||
"command": "команда",
|
||||
"deprecated": "застарілий",
|
||||
"deprecated: %s": "застарілий: %s"
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.pbkdf2Async = exports.pbkdf2 = void 0;
|
||||
const _assert_js_1 = require("./_assert.js");
|
||||
const hmac_js_1 = require("./hmac.js");
|
||||
const utils_js_1 = require("./utils.js");
|
||||
// Common prologue and epilogue for sync/async functions
|
||||
function pbkdf2Init(hash, _password, _salt, _opts) {
|
||||
_assert_js_1.default.hash(hash);
|
||||
const opts = (0, utils_js_1.checkOpts)({ dkLen: 32, asyncTick: 10 }, _opts);
|
||||
const { c, dkLen, asyncTick } = opts;
|
||||
_assert_js_1.default.number(c);
|
||||
_assert_js_1.default.number(dkLen);
|
||||
_assert_js_1.default.number(asyncTick);
|
||||
if (c < 1)
|
||||
throw new Error('PBKDF2: iterations (c) should be >= 1');
|
||||
const password = (0, utils_js_1.toBytes)(_password);
|
||||
const salt = (0, utils_js_1.toBytes)(_salt);
|
||||
// DK = PBKDF2(PRF, Password, Salt, c, dkLen);
|
||||
const DK = new Uint8Array(dkLen);
|
||||
// U1 = PRF(Password, Salt + INT_32_BE(i))
|
||||
const PRF = hmac_js_1.hmac.create(hash, password);
|
||||
const PRFSalt = PRF._cloneInto().update(salt);
|
||||
return { c, dkLen, asyncTick, DK, PRF, PRFSalt };
|
||||
}
|
||||
function pbkdf2Output(PRF, PRFSalt, DK, prfW, u) {
|
||||
PRF.destroy();
|
||||
PRFSalt.destroy();
|
||||
if (prfW)
|
||||
prfW.destroy();
|
||||
u.fill(0);
|
||||
return DK;
|
||||
}
|
||||
/**
|
||||
* PBKDF2-HMAC: RFC 2898 key derivation function
|
||||
* @param hash - hash function that would be used e.g. sha256
|
||||
* @param password - password from which a derived key is generated
|
||||
* @param salt - cryptographic salt
|
||||
* @param opts - {c, dkLen} where c is work factor and dkLen is output message size
|
||||
*/
|
||||
function pbkdf2(hash, password, salt, opts) {
|
||||
const { c, dkLen, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);
|
||||
let prfW; // Working copy
|
||||
const arr = new Uint8Array(4);
|
||||
const view = (0, utils_js_1.createView)(arr);
|
||||
const u = new Uint8Array(PRF.outputLen);
|
||||
// DK = T1 + T2 + ⋯ + Tdklen/hlen
|
||||
for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {
|
||||
// Ti = F(Password, Salt, c, i)
|
||||
const Ti = DK.subarray(pos, pos + PRF.outputLen);
|
||||
view.setInt32(0, ti, false);
|
||||
// F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc
|
||||
// U1 = PRF(Password, Salt + INT_32_BE(i))
|
||||
(prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);
|
||||
Ti.set(u.subarray(0, Ti.length));
|
||||
for (let ui = 1; ui < c; ui++) {
|
||||
// Uc = PRF(Password, Uc−1)
|
||||
PRF._cloneInto(prfW).update(u).digestInto(u);
|
||||
for (let i = 0; i < Ti.length; i++)
|
||||
Ti[i] ^= u[i];
|
||||
}
|
||||
}
|
||||
return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);
|
||||
}
|
||||
exports.pbkdf2 = pbkdf2;
|
||||
async function pbkdf2Async(hash, password, salt, opts) {
|
||||
const { c, dkLen, asyncTick, DK, PRF, PRFSalt } = pbkdf2Init(hash, password, salt, opts);
|
||||
let prfW; // Working copy
|
||||
const arr = new Uint8Array(4);
|
||||
const view = (0, utils_js_1.createView)(arr);
|
||||
const u = new Uint8Array(PRF.outputLen);
|
||||
// DK = T1 + T2 + ⋯ + Tdklen/hlen
|
||||
for (let ti = 1, pos = 0; pos < dkLen; ti++, pos += PRF.outputLen) {
|
||||
// Ti = F(Password, Salt, c, i)
|
||||
const Ti = DK.subarray(pos, pos + PRF.outputLen);
|
||||
view.setInt32(0, ti, false);
|
||||
// F(Password, Salt, c, i) = U1 ^ U2 ^ ⋯ ^ Uc
|
||||
// U1 = PRF(Password, Salt + INT_32_BE(i))
|
||||
(prfW = PRFSalt._cloneInto(prfW)).update(arr).digestInto(u);
|
||||
Ti.set(u.subarray(0, Ti.length));
|
||||
await (0, utils_js_1.asyncLoop)(c - 1, asyncTick, (i) => {
|
||||
// Uc = PRF(Password, Uc−1)
|
||||
PRF._cloneInto(prfW).update(u).digestInto(u);
|
||||
for (let i = 0; i < Ti.length; i++)
|
||||
Ti[i] ^= u[i];
|
||||
});
|
||||
}
|
||||
return pbkdf2Output(PRF, PRFSalt, DK, prfW, u);
|
||||
}
|
||||
exports.pbkdf2Async = pbkdf2Async;
|
||||
//# sourceMappingURL=pbkdf2.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"mergeAll.js","sourceRoot":"","sources":["../../../../src/internal/operators/mergeAll.ts"],"names":[],"mappings":";;;AAAA,uCAAsC;AACtC,6CAA4C;AA8D5C,SAAgB,QAAQ,CAAiC,UAA6B;IAA7B,2BAAA,EAAA,qBAA6B;IACpF,OAAO,mBAAQ,CAAC,mBAAQ,EAAE,UAAU,CAAC,CAAC;AACxC,CAAC;AAFD,4BAEC"}
|
||||
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
|
||||
var toInteger = require("./to-integer")
|
||||
, max = Math.max;
|
||||
|
||||
module.exports = function (value) { return max(0, toInteger(value)); };
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('nth', require('../nth'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,20 @@
|
||||
# vite ⚡
|
||||
|
||||
> Next Generation Frontend Tooling
|
||||
|
||||
- 💡 Instant Server Start
|
||||
- ⚡️ Lightning Fast HMR
|
||||
- 🛠️ Rich Features
|
||||
- 📦 Optimized Build
|
||||
- 🔩 Universal Plugin Interface
|
||||
- 🔑 Fully Typed APIs
|
||||
|
||||
Vite (French word for "fast", pronounced `/vit/`) is a new breed of frontend build tool that significantly improves the frontend development experience. It consists of two major parts:
|
||||
|
||||
- A dev server that serves your source files over [native ES modules](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules), with [rich built-in features](https://vitejs.dev/guide/features.html) and astonishingly fast [Hot Module Replacement (HMR)](https://vitejs.dev/guide/features.html#hot-module-replacement).
|
||||
|
||||
- A [build command](https://vitejs.dev/guide/build.html) that bundles your code with [Rollup](https://rollupjs.org), pre-configured to output highly optimized static assets for production.
|
||||
|
||||
In addition, Vite is highly extensible via its [Plugin API](https://vitejs.dev/guide/api-plugin.html) and [JavaScript API](https://vitejs.dev/guide/api-javascript.html) with full typing support.
|
||||
|
||||
[Read the Docs to Learn More](https://vitejs.dev).
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('toNumber', require('../toNumber'), require('./_falseOptions'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"keyv","version":"4.5.2","files":{"README.md":{"checkedAt":1678883670957,"integrity":"sha512-lrQHtJwuX7DtqCV6g6U9cBwm6ae5l1GlDI8wf4bg6ItL98q9WabTw/yzAvS5CLVnFBEHhxQZTAwRBNMrzLvEOg==","mode":420,"size":15433},"package.json":{"checkedAt":1678883670957,"integrity":"sha512-1C1QVEgWAKXzbbHXXi4/VXV+w3QMaaJmBhZ5a+0aU7Bnllj+FBfuFKRbmAlDmSAdYdXg1y78qky75zVbjVwprA==","mode":420,"size":1310},"src/index.js":{"checkedAt":1678883670957,"integrity":"sha512-oOhirNDvVrk56ppb68QqsLlup65+BLMnY1W0On46NiI2sMbo+oZ5XJnlhjnby3kY8CkA37EyQOBe28jJRWqpzQ==","mode":420,"size":6674},"src/index.d.ts":{"checkedAt":1678883670957,"integrity":"sha512-0MXfOXwBPB90+9GeMGaxjYZN2hmIsjKb47aAqaQ04Mj9VjH+d0a1Kg12IK55dlN7IGQFBpr6VfWSiqXp12FRpg==","mode":420,"size":4051}}}
|
||||
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.noop = void 0;
|
||||
function noop() { }
|
||||
exports.noop = noop;
|
||||
//# sourceMappingURL=noop.js.map
|
||||
@@ -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.00327,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0.00327,"48":0,"49":0.00327,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0.00327,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0.02613,"67":0,"68":0.00327,"69":0,"70":0,"71":0,"72":0.00653,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.00327,"79":0,"80":0,"81":0,"82":0,"83":0.00327,"84":0,"85":0,"86":0,"87":0,"88":0.00327,"89":0,"90":0,"91":0,"92":0.00327,"93":0.00327,"94":0.00327,"95":0.00327,"96":0,"97":0.00327,"98":0,"99":0.00327,"100":0.00327,"101":0.00327,"102":0.02613,"103":0.00653,"104":0.0098,"105":0.0098,"106":0.02286,"107":0.0196,"108":0.03593,"109":0.62381,"110":0.48663,"111":0.0196,"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.00327,"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.00327,"32":0.00327,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0.00327,"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.00327,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0.00327,"62":0.00653,"63":0.00327,"64":0,"65":0,"66":0,"67":0.0098,"68":0.00327,"69":0.00327,"70":0.00327,"71":0.0098,"72":0.00327,"73":0,"74":0.02286,"75":0,"76":0.00653,"77":0,"78":0.00653,"79":0.0098,"80":0.0098,"81":0.01633,"83":0.00653,"84":0.00327,"85":0.00327,"86":0.00327,"87":0.00653,"88":0.0098,"89":0.0098,"90":0.00327,"91":0.00327,"92":0.03919,"93":0.00327,"94":0.00327,"95":0.00327,"96":0.00653,"97":0.00653,"98":0.00327,"99":0.00653,"100":0.01633,"101":0.0098,"102":0.01306,"103":0.02613,"104":0.0098,"105":0.0196,"106":0.01633,"107":0.03266,"108":0.11431,"109":3.23661,"110":2.31233,"111":0.0098,"112":0.0098,"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.00653,"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.00327,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0,"63":0,"64":0.00327,"65":0,"66":0.00327,"67":0.02286,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0.00327,"74":0.00327,"75":0,"76":0,"77":0,"78":0,"79":0.00327,"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.00653,"94":0.08818,"95":0.07512,"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.00653,"13":0,"14":0.00327,"15":0,"16":0.00327,"17":0.00327,"18":0.01633,"79":0,"80":0,"81":0,"83":0,"84":0.00327,"85":0,"86":0,"87":0.00327,"88":0,"89":0.00327,"90":0.00327,"91":0,"92":0.01306,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0.0098,"101":0,"102":0,"103":0,"104":0,"105":0.00653,"106":0,"107":0.0098,"108":0.02286,"109":0.36906,"110":0.53889},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00653,"12":0,"13":0.00327,"14":0.01633,"15":0.00653,_:"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.00653,"13.1":0.03266,"14.1":0.03919,"15.1":0.03266,"15.2-15.3":0.00653,"15.4":0.01633,"15.5":0.04246,"15.6":0.16983,"16.0":0.02613,"16.1":0.08818,"16.2":0.17636,"16.3":0.11431,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00686,"6.0-6.1":0.00229,"7.0-7.1":0.01373,"8.1-8.4":0.01716,"9.0-9.2":0.00572,"9.3":0.10179,"10.0-10.2":0.00915,"10.3":0.11094,"11.0-11.2":0.00915,"11.3-11.4":0.00572,"12.0-12.1":0.00343,"12.2-12.5":0.51469,"13.0-13.1":0.00801,"13.2":0.00458,"13.3":0.0183,"13.4-13.7":0.11438,"14.0-14.4":0.20473,"14.5-14.8":0.34884,"15.0-15.1":0.14526,"15.2-15.3":0.13039,"15.4":0.14869,"15.5":0.43691,"15.6":0.74229,"16.0":1.22381,"16.1":1.9398,"16.2":2.0599,"16.3":1.83686,"16.4":0.00915},P:{"4":0.16678,"20":0.39611,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0.03127,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.03127,"12.0":0,"13.0":0.02085,"14.0":0.03127,"15.0":0.01042,"16.0":0.02085,"17.0":0.0417,"18.0":0.07297,"19.0":0.6984},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0.00369,"4.2-4.3":0.02217,"4.4":0,"4.4.3-4.4.4":0.50434},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0.0042,"9":0,"10":0,"11":0.02519,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":2.45118},H:{"0":0.5164},L:{"0":71.89648},R:{_:"0"},M:{"0":0.20875},Q:{"13.1":0.0404}};
|
||||
@@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com)
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any
|
||||
purpose with or without fee is hereby granted, provided that the above
|
||||
copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
@@ -0,0 +1,28 @@
|
||||
import { IsSanctionedSimpleUnitIdentifier } from './IsSanctionedSimpleUnitIdentifier';
|
||||
/**
|
||||
* This follows https://tc39.es/ecma402/#sec-case-sensitivity-and-case-mapping
|
||||
* @param str string to convert
|
||||
*/
|
||||
function toLowerCase(str) {
|
||||
return str.replace(/([A-Z])/g, function (_, c) { return c.toLowerCase(); });
|
||||
}
|
||||
/**
|
||||
* https://tc39.es/ecma402/#sec-iswellformedunitidentifier
|
||||
* @param unit
|
||||
*/
|
||||
export function IsWellFormedUnitIdentifier(unit) {
|
||||
unit = toLowerCase(unit);
|
||||
if (IsSanctionedSimpleUnitIdentifier(unit)) {
|
||||
return true;
|
||||
}
|
||||
var units = unit.split('-per-');
|
||||
if (units.length !== 2) {
|
||||
return false;
|
||||
}
|
||||
var numerator = units[0], denominator = units[1];
|
||||
if (!IsSanctionedSimpleUnitIdentifier(numerator) ||
|
||||
!IsSanctionedSimpleUnitIdentifier(denominator)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"A B","2":"J D E F CC"},B:{"1":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB","2":"0 1 2 3 4 5 6 DC tB I v J D E F A B C K L G M N O w g x y z EC FC","194":"7 8 9 AB"},D:{"1":"1 2 3 4 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","2":"0 I v J D E F A B C K L G M N O w g x y z"},E:{"1":"C K L G qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E F A HC zB IC JC KC LC 0B","260":"B"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"F B C PC QC RC SC qB AC TC rB"},G:{"1":"dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC ZC aC bC cC"},H:{"2":"oC"},I:{"1":"f tC uC","2":"tB I pC qC rC sC BC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"1":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:4,C:"Resource Timing"};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F CC","8":"A B"},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","8":"C K L G M N O"},C:{"1":"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 DC tB I v J D E F A B C K L G M N O w g x y z EC FC","8":"6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","456":"QB RB SB TB UB VB WB XB YB","712":"uB ZB vB aB"},D:{"1":"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","8":"SB TB","132":"UB VB WB XB YB uB ZB vB aB bB cB dB eB"},E:{"2":"I v J D HC zB IC JC KC","8":"E F A LC","132":"B C K L G 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"1":"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","132":"HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB"},G:{"2":"E zB UC BC VC WC XC YC ZC aC bC","132":"cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"g xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I","132":"wC"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"BD","8":"AD"}},B:1,C:"Custom Elements (V1)"};
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A CC","388":"B"},B:{"257":"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","260":"C K L","769":"G M N O"},C:{"2":"DC tB I v EC FC","4":"0 1 2 3 4 5 6 7 8 9 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","257":"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"},D:{"2":"I v J D E F A B C K L G M N O w g","4":"0 1 2 3 4 5 6 7 8 9 x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB","257":"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":"A B C K L G 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D HC zB IC JC","4":"E F KC LC"},F:{"2":"F B C PC QC RC SC qB AC TC rB","4":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB","257":"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":"bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"zB UC BC VC WC","4":"E XC YC ZC aC"},H:{"2":"oC"},I:{"2":"tB I pC qC rC sC BC","4":"tC uC","257":"f"},J:{"2":"D","4":"A"},K:{"2":"A B C qB AC rB","257":"h"},L:{"257":"H"},M:{"257":"H"},N:{"2":"A","388":"B"},O:{"257":"vC"},P:{"4":"I","257":"g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"257":"1B"},R:{"257":"9C"},S:{"4":"AD","257":"BD"}},B:6,C:"ECMAScript 2015 (ES6)"};
|
||||
@@ -0,0 +1,22 @@
|
||||
var createMathOperation = require('./_createMathOperation');
|
||||
|
||||
/**
|
||||
* Divide two numbers.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 4.7.0
|
||||
* @category Math
|
||||
* @param {number} dividend The first number in a division.
|
||||
* @param {number} divisor The second number in a division.
|
||||
* @returns {number} Returns the quotient.
|
||||
* @example
|
||||
*
|
||||
* _.divide(6, 4);
|
||||
* // => 1.5
|
||||
*/
|
||||
var divide = createMathOperation(function(dividend, divisor) {
|
||||
return dividend / divisor;
|
||||
}, 1);
|
||||
|
||||
module.exports = divide;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,104 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';
|
||||
import { scheduled } from '../scheduled/scheduled';
|
||||
import { innerFrom } from './innerFrom';
|
||||
|
||||
export function from<O extends ObservableInput<any>>(input: O): Observable<ObservedValueOf<O>>;
|
||||
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
||||
export function from<O extends ObservableInput<any>>(input: O, scheduler: SchedulerLike | undefined): Observable<ObservedValueOf<O>>;
|
||||
|
||||
/**
|
||||
* Creates an Observable from an Array, an array-like object, a Promise, an iterable object, or an Observable-like object.
|
||||
*
|
||||
* <span class="informal">Converts almost anything to an Observable.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `from` converts various other objects and data types into Observables. It also converts a Promise, an array-like, or an
|
||||
* <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#iterable" target="_blank">iterable</a>
|
||||
* object into an Observable that emits the items in that promise, array, or iterable. A String, in this context, is treated
|
||||
* as an array of characters. Observable-like objects (contains a function named with the ES2015 Symbol for Observable) can also be
|
||||
* converted through this operator.
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* Converts an array to an Observable
|
||||
*
|
||||
* ```ts
|
||||
* import { from } from 'rxjs';
|
||||
*
|
||||
* const array = [10, 20, 30];
|
||||
* const result = from(array);
|
||||
*
|
||||
* result.subscribe(x => console.log(x));
|
||||
*
|
||||
* // Logs:
|
||||
* // 10
|
||||
* // 20
|
||||
* // 30
|
||||
* ```
|
||||
*
|
||||
* Convert an infinite iterable (from a generator) to an Observable
|
||||
*
|
||||
* ```ts
|
||||
* import { from, take } from 'rxjs';
|
||||
*
|
||||
* function* generateDoubles(seed) {
|
||||
* let i = seed;
|
||||
* while (true) {
|
||||
* yield i;
|
||||
* i = 2 * i; // double it
|
||||
* }
|
||||
* }
|
||||
*
|
||||
* const iterator = generateDoubles(3);
|
||||
* const result = from(iterator).pipe(take(10));
|
||||
*
|
||||
* result.subscribe(x => console.log(x));
|
||||
*
|
||||
* // Logs:
|
||||
* // 3
|
||||
* // 6
|
||||
* // 12
|
||||
* // 24
|
||||
* // 48
|
||||
* // 96
|
||||
* // 192
|
||||
* // 384
|
||||
* // 768
|
||||
* // 1536
|
||||
* ```
|
||||
*
|
||||
* With `asyncScheduler`
|
||||
*
|
||||
* ```ts
|
||||
* import { from, asyncScheduler } from 'rxjs';
|
||||
*
|
||||
* console.log('start');
|
||||
*
|
||||
* const array = [10, 20, 30];
|
||||
* const result = from(array, asyncScheduler);
|
||||
*
|
||||
* result.subscribe(x => console.log(x));
|
||||
*
|
||||
* console.log('end');
|
||||
*
|
||||
* // Logs:
|
||||
* // 'start'
|
||||
* // 'end'
|
||||
* // 10
|
||||
* // 20
|
||||
* // 30
|
||||
* ```
|
||||
*
|
||||
* @see {@link fromEvent}
|
||||
* @see {@link fromEventPattern}
|
||||
*
|
||||
* @param {ObservableInput<T>} A subscription object, a Promise, an Observable-like,
|
||||
* an Array, an iterable, or an array-like object to be converted.
|
||||
* @param {SchedulerLike} An optional {@link SchedulerLike} on which to schedule the emission of values.
|
||||
* @return {Observable<T>}
|
||||
*/
|
||||
export function from<T>(input: ObservableInput<T>, scheduler?: SchedulerLike): Observable<T> {
|
||||
return scheduler ? scheduled(input, scheduler) : innerFrom(input);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
import { TemplateLiteral } from 'estree';
|
||||
/**
|
||||
* Collapse string literals together
|
||||
*/
|
||||
export declare function collapse_template_literal(literal: TemplateLiteral): void;
|
||||
@@ -0,0 +1,32 @@
|
||||
var toString = require('./toString');
|
||||
|
||||
/**
|
||||
* Used to match `RegExp`
|
||||
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
||||
*/
|
||||
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g,
|
||||
reHasRegExpChar = RegExp(reRegExpChar.source);
|
||||
|
||||
/**
|
||||
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
|
||||
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.0.0
|
||||
* @category String
|
||||
* @param {string} [string=''] The string to escape.
|
||||
* @returns {string} Returns the escaped string.
|
||||
* @example
|
||||
*
|
||||
* _.escapeRegExp('[lodash](https://lodash.com/)');
|
||||
* // => '\[lodash\]\(https://lodash\.com/\)'
|
||||
*/
|
||||
function escapeRegExp(string) {
|
||||
string = toString(string);
|
||||
return (string && reHasRegExpChar.test(string))
|
||||
? string.replace(reRegExpChar, '\\$&')
|
||||
: string;
|
||||
}
|
||||
|
||||
module.exports = escapeRegExp;
|
||||
Reference in New Issue
Block a user