yeet
This commit is contained in:
21
node_modules/metro-core/node_modules/@jest/console/LICENSE
generated
vendored
Normal file
21
node_modules/metro-core/node_modules/@jest/console/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
36
node_modules/metro-core/node_modules/@jest/console/build/BufferedConsole.d.ts
generated
vendored
Normal file
36
node_modules/metro-core/node_modules/@jest/console/build/BufferedConsole.d.ts
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { Console } from 'console';
|
||||
import { SourceMapRegistry } from '@jest/source-map';
|
||||
import { ConsoleBuffer, LogMessage, LogType } from './types';
|
||||
export default class BufferedConsole extends Console {
|
||||
private _buffer;
|
||||
private _counters;
|
||||
private _timers;
|
||||
private _groupDepth;
|
||||
private _getSourceMaps;
|
||||
constructor(getSourceMaps: () => SourceMapRegistry | null | undefined);
|
||||
static write(buffer: ConsoleBuffer, type: LogType, message: LogMessage, level?: number | null, sourceMaps?: SourceMapRegistry | null): import("./types").LogEntry[];
|
||||
private _log;
|
||||
assert(value: any, message?: string | Error): void;
|
||||
count(label?: string): void;
|
||||
countReset(label?: string): void;
|
||||
debug(firstArg: any, ...rest: Array<any>): void;
|
||||
dir(firstArg: any, ...rest: Array<any>): void;
|
||||
dirxml(firstArg: any, ...rest: Array<any>): void;
|
||||
error(firstArg: any, ...rest: Array<any>): void;
|
||||
group(title?: string, ...rest: Array<any>): void;
|
||||
groupCollapsed(title?: string, ...rest: Array<any>): void;
|
||||
groupEnd(): void;
|
||||
info(firstArg: any, ...rest: Array<any>): void;
|
||||
log(firstArg: any, ...rest: Array<any>): void;
|
||||
time(label?: string): void;
|
||||
timeEnd(label?: string): void;
|
||||
warn(firstArg: any, ...rest: Array<any>): void;
|
||||
getBuffer(): import("./types").LogEntry[] | undefined;
|
||||
}
|
||||
//# sourceMappingURL=BufferedConsole.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/console/build/BufferedConsole.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/console/build/BufferedConsole.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"BufferedConsole.d.ts","sourceRoot":"","sources":["../src/BufferedConsole.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAGhC,OAAO,EAAc,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AAChE,OAAO,EACL,aAAa,EAEb,UAAU,EAEV,OAAO,EACR,MAAM,SAAS,CAAC;AAEjB,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,OAAO;IAClD,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,OAAO,CAAY;IAC3B,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,cAAc,CAA6C;gBAEvD,aAAa,EAAE,MAAM,iBAAiB,GAAG,IAAI,GAAG,SAAS;IAgBrE,MAAM,CAAC,KAAK,CACV,MAAM,EAAE,aAAa,EACrB,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,UAAU,EACnB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,UAAU,CAAC,EAAE,iBAAiB,GAAG,IAAI;IAcvC,OAAO,CAAC,IAAI;IAUZ,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK;IAQ3C,KAAK,CAAC,KAAK,GAAE,MAAkB;IAQ/B,UAAU,CAAC,KAAK,GAAE,MAAkB;IAIpC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIxC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAItC,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIzC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIxC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAQzC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAQlD,QAAQ;IAMR,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIvC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAItC,IAAI,CAAC,KAAK,GAAE,MAAkB;IAQ9B,OAAO,CAAC,KAAK,GAAE,MAAkB;IAWjC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIvC,SAAS;CAGV"}
|
232
node_modules/metro-core/node_modules/@jest/console/build/BufferedConsole.js
generated
vendored
Normal file
232
node_modules/metro-core/node_modules/@jest/console/build/BufferedConsole.js
generated
vendored
Normal file
@ -0,0 +1,232 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _assert() {
|
||||
const data = _interopRequireDefault(require('assert'));
|
||||
|
||||
_assert = function _assert() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _console() {
|
||||
const data = require('console');
|
||||
|
||||
_console = function _console() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _util() {
|
||||
const data = require('util');
|
||||
|
||||
_util = function _util() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _sourceMap() {
|
||||
const data = require('@jest/source-map');
|
||||
|
||||
_sourceMap = function _sourceMap() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
class BufferedConsole extends _console().Console {
|
||||
constructor(getSourceMaps) {
|
||||
const buffer = [];
|
||||
super({
|
||||
write: message => {
|
||||
BufferedConsole.write(buffer, 'log', message, null, getSourceMaps());
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
_defineProperty(this, '_buffer', void 0);
|
||||
|
||||
_defineProperty(this, '_counters', void 0);
|
||||
|
||||
_defineProperty(this, '_timers', void 0);
|
||||
|
||||
_defineProperty(this, '_groupDepth', void 0);
|
||||
|
||||
_defineProperty(this, '_getSourceMaps', void 0);
|
||||
|
||||
this._getSourceMaps = getSourceMaps;
|
||||
this._buffer = buffer;
|
||||
this._counters = {};
|
||||
this._timers = {};
|
||||
this._groupDepth = 0;
|
||||
}
|
||||
|
||||
static write(buffer, type, message, level, sourceMaps) {
|
||||
const callsite = (0, _sourceMap().getCallsite)(
|
||||
level != null ? level : 2,
|
||||
sourceMaps
|
||||
);
|
||||
const origin = callsite.getFileName() + ':' + callsite.getLineNumber();
|
||||
buffer.push({
|
||||
message,
|
||||
origin,
|
||||
type
|
||||
});
|
||||
return buffer;
|
||||
}
|
||||
|
||||
_log(type, message) {
|
||||
BufferedConsole.write(
|
||||
this._buffer,
|
||||
type,
|
||||
' '.repeat(this._groupDepth) + message,
|
||||
3,
|
||||
this._getSourceMaps()
|
||||
);
|
||||
}
|
||||
|
||||
assert(value, message) {
|
||||
try {
|
||||
(0, _assert().default)(value, message);
|
||||
} catch (error) {
|
||||
this._log('assert', error.toString());
|
||||
}
|
||||
}
|
||||
|
||||
count(label = 'default') {
|
||||
if (!this._counters[label]) {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
|
||||
this._log(
|
||||
'count',
|
||||
(0, _util().format)(`${label}: ${++this._counters[label]}`)
|
||||
);
|
||||
}
|
||||
|
||||
countReset(label = 'default') {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
|
||||
debug(firstArg, ...rest) {
|
||||
this._log('debug', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
dir(firstArg, ...rest) {
|
||||
this._log('dir', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
dirxml(firstArg, ...rest) {
|
||||
this._log('dirxml', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
error(firstArg, ...rest) {
|
||||
this._log('error', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
group(title, ...rest) {
|
||||
this._groupDepth++;
|
||||
|
||||
if (title || rest.length > 0) {
|
||||
this._log(
|
||||
'group',
|
||||
_chalk().default.bold((0, _util().format)(title, ...rest))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
groupCollapsed(title, ...rest) {
|
||||
this._groupDepth++;
|
||||
|
||||
if (title || rest.length > 0) {
|
||||
this._log(
|
||||
'groupCollapsed',
|
||||
_chalk().default.bold((0, _util().format)(title, ...rest))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
groupEnd() {
|
||||
if (this._groupDepth > 0) {
|
||||
this._groupDepth--;
|
||||
}
|
||||
}
|
||||
|
||||
info(firstArg, ...rest) {
|
||||
this._log('info', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
log(firstArg, ...rest) {
|
||||
this._log('log', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
time(label = 'default') {
|
||||
if (this._timers[label]) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._timers[label] = new Date();
|
||||
}
|
||||
|
||||
timeEnd(label = 'default') {
|
||||
const startTime = this._timers[label];
|
||||
|
||||
if (startTime) {
|
||||
const endTime = new Date();
|
||||
const time = endTime.getTime() - startTime.getTime();
|
||||
|
||||
this._log('time', (0, _util().format)(`${label}: ${time}ms`));
|
||||
|
||||
delete this._timers[label];
|
||||
}
|
||||
}
|
||||
|
||||
warn(firstArg, ...rest) {
|
||||
this._log('warn', (0, _util().format)(firstArg, ...rest));
|
||||
}
|
||||
|
||||
getBuffer() {
|
||||
return this._buffer.length ? this._buffer : undefined;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = BufferedConsole;
|
39
node_modules/metro-core/node_modules/@jest/console/build/CustomConsole.d.ts
generated
vendored
Normal file
39
node_modules/metro-core/node_modules/@jest/console/build/CustomConsole.d.ts
generated
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { Console } from 'console';
|
||||
import { LogMessage, LogType } from './types';
|
||||
declare type Formatter = (type: LogType, message: LogMessage) => string;
|
||||
export default class CustomConsole extends Console {
|
||||
private _stdout;
|
||||
private _stderr;
|
||||
private _formatBuffer;
|
||||
private _counters;
|
||||
private _timers;
|
||||
private _groupDepth;
|
||||
constructor(stdout: NodeJS.WritableStream, stderr: NodeJS.WritableStream, formatBuffer?: Formatter);
|
||||
private _log;
|
||||
private _logError;
|
||||
assert(value: any, message?: string | Error): void;
|
||||
count(label?: string): void;
|
||||
countReset(label?: string): void;
|
||||
debug(firstArg: any, ...args: Array<any>): void;
|
||||
dir(firstArg: any, ...args: Array<any>): void;
|
||||
dirxml(firstArg: any, ...args: Array<any>): void;
|
||||
error(firstArg: any, ...args: Array<any>): void;
|
||||
group(title?: string, ...args: Array<any>): void;
|
||||
groupCollapsed(title?: string, ...args: Array<any>): void;
|
||||
groupEnd(): void;
|
||||
info(firstArg: any, ...args: Array<any>): void;
|
||||
log(firstArg: any, ...args: Array<any>): void;
|
||||
time(label?: string): void;
|
||||
timeEnd(label?: string): void;
|
||||
warn(firstArg: any, ...args: Array<any>): void;
|
||||
getBuffer(): undefined;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=CustomConsole.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/console/build/CustomConsole.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/console/build/CustomConsole.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"CustomConsole.d.ts","sourceRoot":"","sources":["../src/CustomConsole.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAIH,OAAO,EAAC,OAAO,EAAC,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAc,UAAU,EAAa,OAAO,EAAC,MAAM,SAAS,CAAC;AASpE,aAAK,SAAS,GAAG,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,KAAK,MAAM,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,OAAO;IAChD,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,OAAO,CAAwB;IACvC,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,OAAO,CAAY;IAC3B,OAAO,CAAC,WAAW,CAAS;gBAG1B,MAAM,EAAE,MAAM,CAAC,cAAc,EAC7B,MAAM,EAAE,MAAM,CAAC,cAAc,EAC7B,YAAY,GAAE,SAAuC;IAWvD,OAAO,CAAC,IAAI;IAOZ,OAAO,CAAC,SAAS;IAOjB,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK;IAQ3C,KAAK,CAAC,KAAK,GAAE,MAAkB;IAQ/B,UAAU,CAAC,KAAK,GAAE,MAAkB;IAIpC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIxC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAItC,MAAM,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIzC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIxC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAQzC,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAQlD,QAAQ;IAMR,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIvC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAItC,IAAI,CAAC,KAAK,GAAE,MAAkB;IAQ9B,OAAO,CAAC,KAAK,GAAE,MAAkB;IAWjC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC;IAIvC,SAAS;CAGV"}
|
216
node_modules/metro-core/node_modules/@jest/console/build/CustomConsole.js
generated
vendored
Normal file
216
node_modules/metro-core/node_modules/@jest/console/build/CustomConsole.js
generated
vendored
Normal file
@ -0,0 +1,216 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _assert() {
|
||||
const data = _interopRequireDefault(require('assert'));
|
||||
|
||||
_assert = function _assert() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _util() {
|
||||
const data = require('util');
|
||||
|
||||
_util = function _util() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _console() {
|
||||
const data = require('console');
|
||||
|
||||
_console = function _console() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
// TODO: Copied from `jest-util`. Import from it in Jest 25
|
||||
function clearLine(stream) {
|
||||
if (stream.isTTY) {
|
||||
stream.write('\x1b[999D\x1b[K');
|
||||
}
|
||||
}
|
||||
|
||||
class CustomConsole extends _console().Console {
|
||||
constructor(stdout, stderr, formatBuffer = (_type, message) => message) {
|
||||
super(stdout, stderr);
|
||||
|
||||
_defineProperty(this, '_stdout', void 0);
|
||||
|
||||
_defineProperty(this, '_stderr', void 0);
|
||||
|
||||
_defineProperty(this, '_formatBuffer', void 0);
|
||||
|
||||
_defineProperty(this, '_counters', void 0);
|
||||
|
||||
_defineProperty(this, '_timers', void 0);
|
||||
|
||||
_defineProperty(this, '_groupDepth', void 0);
|
||||
|
||||
this._stdout = stdout;
|
||||
this._stderr = stderr;
|
||||
this._formatBuffer = formatBuffer;
|
||||
this._counters = {};
|
||||
this._timers = {};
|
||||
this._groupDepth = 0;
|
||||
}
|
||||
|
||||
_log(type, message) {
|
||||
clearLine(this._stdout);
|
||||
super.log(
|
||||
this._formatBuffer(type, ' '.repeat(this._groupDepth) + message)
|
||||
);
|
||||
}
|
||||
|
||||
_logError(type, message) {
|
||||
clearLine(this._stderr);
|
||||
super.error(
|
||||
this._formatBuffer(type, ' '.repeat(this._groupDepth) + message)
|
||||
);
|
||||
}
|
||||
|
||||
assert(value, message) {
|
||||
try {
|
||||
(0, _assert().default)(value, message);
|
||||
} catch (error) {
|
||||
this._logError('assert', error.toString());
|
||||
}
|
||||
}
|
||||
|
||||
count(label = 'default') {
|
||||
if (!this._counters[label]) {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
|
||||
this._log(
|
||||
'count',
|
||||
(0, _util().format)(`${label}: ${++this._counters[label]}`)
|
||||
);
|
||||
}
|
||||
|
||||
countReset(label = 'default') {
|
||||
this._counters[label] = 0;
|
||||
}
|
||||
|
||||
debug(firstArg, ...args) {
|
||||
this._log('debug', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
dir(firstArg, ...args) {
|
||||
this._log('dir', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
dirxml(firstArg, ...args) {
|
||||
this._log('dirxml', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
error(firstArg, ...args) {
|
||||
this._logError('error', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
group(title, ...args) {
|
||||
this._groupDepth++;
|
||||
|
||||
if (title || args.length > 0) {
|
||||
this._log(
|
||||
'group',
|
||||
_chalk().default.bold((0, _util().format)(title, ...args))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
groupCollapsed(title, ...args) {
|
||||
this._groupDepth++;
|
||||
|
||||
if (title || args.length > 0) {
|
||||
this._log(
|
||||
'groupCollapsed',
|
||||
_chalk().default.bold((0, _util().format)(title, ...args))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
groupEnd() {
|
||||
if (this._groupDepth > 0) {
|
||||
this._groupDepth--;
|
||||
}
|
||||
}
|
||||
|
||||
info(firstArg, ...args) {
|
||||
this._log('info', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
log(firstArg, ...args) {
|
||||
this._log('log', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
time(label = 'default') {
|
||||
if (this._timers[label]) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._timers[label] = new Date();
|
||||
}
|
||||
|
||||
timeEnd(label = 'default') {
|
||||
const startTime = this._timers[label];
|
||||
|
||||
if (startTime) {
|
||||
const endTime = new Date().getTime();
|
||||
const time = endTime - startTime.getTime();
|
||||
|
||||
this._log('time', (0, _util().format)(`${label}: ${time}ms`));
|
||||
|
||||
delete this._timers[label];
|
||||
}
|
||||
}
|
||||
|
||||
warn(firstArg, ...args) {
|
||||
this._logError('warn', (0, _util().format)(firstArg, ...args));
|
||||
}
|
||||
|
||||
getBuffer() {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = CustomConsole;
|
20
node_modules/metro-core/node_modules/@jest/console/build/NullConsole.d.ts
generated
vendored
Normal file
20
node_modules/metro-core/node_modules/@jest/console/build/NullConsole.d.ts
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import CustomConsole from './CustomConsole';
|
||||
export default class NullConsole extends CustomConsole {
|
||||
assert(): void;
|
||||
debug(): void;
|
||||
dir(): void;
|
||||
error(): void;
|
||||
info(): void;
|
||||
log(): void;
|
||||
time(): void;
|
||||
timeEnd(): void;
|
||||
trace(): void;
|
||||
warn(): void;
|
||||
}
|
||||
//# sourceMappingURL=NullConsole.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/console/build/NullConsole.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/console/build/NullConsole.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"NullConsole.d.ts","sourceRoot":"","sources":["../src/NullConsole.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,aAAa;IACpD,MAAM;IACN,KAAK;IACL,GAAG;IACH,KAAK;IACL,IAAI;IACJ,GAAG;IACH,IAAI;IACJ,OAAO;IACP,KAAK;IACL,IAAI;CACL"}
|
42
node_modules/metro-core/node_modules/@jest/console/build/NullConsole.js
generated
vendored
Normal file
42
node_modules/metro-core/node_modules/@jest/console/build/NullConsole.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _CustomConsole = _interopRequireDefault(require('./CustomConsole'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
class NullConsole extends _CustomConsole.default {
|
||||
assert() {}
|
||||
|
||||
debug() {}
|
||||
|
||||
dir() {}
|
||||
|
||||
error() {}
|
||||
|
||||
info() {}
|
||||
|
||||
log() {}
|
||||
|
||||
time() {}
|
||||
|
||||
timeEnd() {}
|
||||
|
||||
trace() {}
|
||||
|
||||
warn() {}
|
||||
}
|
||||
|
||||
exports.default = NullConsole;
|
9
node_modules/metro-core/node_modules/@jest/console/build/getConsoleOutput.d.ts
generated
vendored
Normal file
9
node_modules/metro-core/node_modules/@jest/console/build/getConsoleOutput.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
declare const _default: (root: string, verbose: boolean, buffer: import("./types").LogEntry[]) => string;
|
||||
export default _default;
|
||||
//# sourceMappingURL=getConsoleOutput.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/console/build/getConsoleOutput.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/console/build/getConsoleOutput.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"getConsoleOutput.d.ts","sourceRoot":"","sources":["../src/getConsoleOutput.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAOH,wBA+BE"}
|
80
node_modules/metro-core/node_modules/@jest/console/build/getConsoleOutput.js
generated
vendored
Normal file
80
node_modules/metro-core/node_modules/@jest/console/build/getConsoleOutput.js
generated
vendored
Normal file
@ -0,0 +1,80 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function _chalk() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _slash() {
|
||||
const data = _interopRequireDefault(require('slash'));
|
||||
|
||||
_slash = function _slash() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
var _default = (root, verbose, buffer) => {
|
||||
const TITLE_INDENT = verbose ? ' ' : ' ';
|
||||
const CONSOLE_INDENT = TITLE_INDENT + ' ';
|
||||
return buffer.reduce((output, {type, message, origin}) => {
|
||||
origin = (0, _slash().default)(_path().default.relative(root, origin));
|
||||
message = message
|
||||
.split(/\n/)
|
||||
.map(line => CONSOLE_INDENT + line)
|
||||
.join('\n');
|
||||
let typeMessage = 'console.' + type;
|
||||
|
||||
if (type === 'warn') {
|
||||
message = _chalk().default.yellow(message);
|
||||
typeMessage = _chalk().default.yellow(typeMessage);
|
||||
} else if (type === 'error') {
|
||||
message = _chalk().default.red(message);
|
||||
typeMessage = _chalk().default.red(typeMessage);
|
||||
}
|
||||
|
||||
return (
|
||||
output +
|
||||
TITLE_INDENT +
|
||||
_chalk().default.dim(typeMessage) +
|
||||
' ' +
|
||||
_chalk().default.dim(origin) +
|
||||
'\n' +
|
||||
message +
|
||||
'\n'
|
||||
);
|
||||
}, '');
|
||||
};
|
||||
|
||||
exports.default = _default;
|
12
node_modules/metro-core/node_modules/@jest/console/build/index.d.ts
generated
vendored
Normal file
12
node_modules/metro-core/node_modules/@jest/console/build/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
export { default as BufferedConsole } from './BufferedConsole';
|
||||
export { default as CustomConsole } from './CustomConsole';
|
||||
export { default as NullConsole } from './NullConsole';
|
||||
export { default as getConsoleOutput } from './getConsoleOutput';
|
||||
export { ConsoleBuffer, LogMessage, LogType } from './types';
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/console/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/console/build/index.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAC,OAAO,IAAI,gBAAgB,EAAC,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,SAAS,CAAC"}
|
61
node_modules/metro-core/node_modules/@jest/console/build/index.js
generated
vendored
Normal file
61
node_modules/metro-core/node_modules/@jest/console/build/index.js
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'BufferedConsole', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _BufferedConsole.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'CustomConsole', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _CustomConsole.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'NullConsole', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _NullConsole.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'getConsoleOutput', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _getConsoleOutput.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'ConsoleBuffer', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.ConsoleBuffer;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'LogMessage', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.LogMessage;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'LogType', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.LogType;
|
||||
}
|
||||
});
|
||||
|
||||
var _BufferedConsole = _interopRequireDefault(require('./BufferedConsole'));
|
||||
|
||||
var _CustomConsole = _interopRequireDefault(require('./CustomConsole'));
|
||||
|
||||
var _NullConsole = _interopRequireDefault(require('./NullConsole'));
|
||||
|
||||
var _getConsoleOutput = _interopRequireDefault(require('./getConsoleOutput'));
|
||||
|
||||
var _types = require('./types');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
21
node_modules/metro-core/node_modules/@jest/console/build/types.d.ts
generated
vendored
Normal file
21
node_modules/metro-core/node_modules/@jest/console/build/types.d.ts
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
export declare type LogMessage = string;
|
||||
export declare type LogEntry = {
|
||||
message: LogMessage;
|
||||
origin: string;
|
||||
type: LogType;
|
||||
};
|
||||
export declare type LogCounters = {
|
||||
[label: string]: number;
|
||||
};
|
||||
export declare type LogTimers = {
|
||||
[label: string]: Date;
|
||||
};
|
||||
export declare type LogType = 'assert' | 'count' | 'debug' | 'dir' | 'dirxml' | 'error' | 'group' | 'groupCollapsed' | 'info' | 'log' | 'time' | 'warn';
|
||||
export declare type ConsoleBuffer = Array<LogEntry>;
|
||||
//# sourceMappingURL=types.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/console/build/types.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/console/build/types.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,oBAAY,UAAU,GAAG,MAAM,CAAC;AAEhC,oBAAY,QAAQ,GAAG;IACrB,OAAO,EAAE,UAAU,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;CACzB,CAAC;AAEF,oBAAY,SAAS,GAAG;IACtB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,oBAAY,OAAO,GACf,QAAQ,GACR,OAAO,GACP,OAAO,GACP,KAAK,GACL,QAAQ,GACR,OAAO,GACP,OAAO,GACP,gBAAgB,GAChB,MAAM,GACN,KAAK,GACL,MAAM,GACN,MAAM,CAAC;AAEX,oBAAY,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC"}
|
1
node_modules/metro-core/node_modules/@jest/console/build/types.js
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/console/build/types.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
'use strict';
|
27
node_modules/metro-core/node_modules/@jest/console/package.json
generated
vendored
Normal file
27
node_modules/metro-core/node_modules/@jest/console/package.json
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@jest/console",
|
||||
"version": "24.9.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-console"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"dependencies": {
|
||||
"@jest/source-map": "^24.9.0",
|
||||
"chalk": "^2.0.1",
|
||||
"slash": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/slash": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "9ad0f4bc6b8bdd94989804226c28c9960d9da7d1"
|
||||
}
|
21
node_modules/metro-core/node_modules/@jest/fake-timers/LICENSE
generated
vendored
Normal file
21
node_modules/metro-core/node_modules/@jest/fake-timers/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
8
node_modules/metro-core/node_modules/@jest/fake-timers/build/index.d.ts
generated
vendored
Normal file
8
node_modules/metro-core/node_modules/@jest/fake-timers/build/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
export { default as JestFakeTimers } from './jestFakeTimers';
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/fake-timers/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/fake-timers/build/index.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,OAAO,IAAI,cAAc,EAAC,MAAM,kBAAkB,CAAC"}
|
17
node_modules/metro-core/node_modules/@jest/fake-timers/build/index.js
generated
vendored
Normal file
17
node_modules/metro-core/node_modules/@jest/fake-timers/build/index.js
generated
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'JestFakeTimers', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _jestFakeTimers.default;
|
||||
}
|
||||
});
|
||||
|
||||
var _jestFakeTimers = _interopRequireDefault(require('./jestFakeTimers'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
64
node_modules/metro-core/node_modules/@jest/fake-timers/build/jestFakeTimers.d.ts
generated
vendored
Normal file
64
node_modules/metro-core/node_modules/@jest/fake-timers/build/jestFakeTimers.d.ts
generated
vendored
Normal file
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { ModuleMocker } from 'jest-mock';
|
||||
import { StackTraceConfig } from 'jest-message-util';
|
||||
declare type Callback = (...args: Array<unknown>) => void;
|
||||
declare type TimerConfig<Ref> = {
|
||||
idToRef: (id: number) => Ref;
|
||||
refToId: (ref: Ref) => number | void;
|
||||
};
|
||||
export default class FakeTimers<TimerRef> {
|
||||
private _cancelledImmediates;
|
||||
private _cancelledTicks;
|
||||
private _config;
|
||||
private _disposed?;
|
||||
private _fakeTimerAPIs;
|
||||
private _global;
|
||||
private _immediates;
|
||||
private _maxLoops;
|
||||
private _moduleMocker;
|
||||
private _now;
|
||||
private _ticks;
|
||||
private _timerAPIs;
|
||||
private _timers;
|
||||
private _uuidCounter;
|
||||
private _timerConfig;
|
||||
constructor({ global, moduleMocker, timerConfig, config, maxLoops, }: {
|
||||
global: NodeJS.Global;
|
||||
moduleMocker: ModuleMocker;
|
||||
timerConfig: TimerConfig<TimerRef>;
|
||||
config: StackTraceConfig;
|
||||
maxLoops?: number;
|
||||
});
|
||||
clearAllTimers(): void;
|
||||
dispose(): void;
|
||||
reset(): void;
|
||||
runAllTicks(): void;
|
||||
runAllImmediates(): void;
|
||||
private _runImmediate;
|
||||
runAllTimers(): void;
|
||||
runOnlyPendingTimers(): void;
|
||||
advanceTimersToNextTimer(steps?: number): void;
|
||||
advanceTimersByTime(msToRun: number): void;
|
||||
runWithRealTimers(cb: Callback): void;
|
||||
useRealTimers(): void;
|
||||
useFakeTimers(): void;
|
||||
getTimerCount(): number;
|
||||
private _checkFakeTimers;
|
||||
private _createMocks;
|
||||
private _fakeClearTimer;
|
||||
private _fakeClearImmediate;
|
||||
private _fakeNextTick;
|
||||
private _fakeSetImmediate;
|
||||
private _fakeSetInterval;
|
||||
private _fakeSetTimeout;
|
||||
private _getNextTimerHandle;
|
||||
private _runTimerHandle;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=jestFakeTimers.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/fake-timers/build/jestFakeTimers.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/fake-timers/build/jestFakeTimers.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"jestFakeTimers.d.ts","sourceRoot":"","sources":["../src/jestFakeTimers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,WAAW,CAAC;AACvC,OAAO,EAAmB,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AAErE,aAAK,QAAQ,GAAG,CAAC,GAAG,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC;AA2BlD,aAAK,WAAW,CAAC,GAAG,IAAI;IACtB,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,GAAG,CAAC;IAC7B,OAAO,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,MAAM,GAAG,IAAI,CAAC;CACtC,CAAC;AAcF,MAAM,CAAC,OAAO,OAAO,UAAU,CAAC,QAAQ;IACtC,OAAO,CAAC,oBAAoB,CAA2B;IACvD,OAAO,CAAC,eAAe,CAA2B;IAClD,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,SAAS,CAAC,CAAU;IAC5B,OAAO,CAAC,cAAc,CAAY;IAClC,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,WAAW,CAAe;IAClC,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,aAAa,CAAe;IACpC,OAAO,CAAC,IAAI,CAAU;IACtB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,UAAU,CAAW;IAC7B,OAAO,CAAC,OAAO,CAAsB;IACrC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,YAAY,CAAwB;gBAEhC,EACV,MAAM,EACN,YAAY,EACZ,WAAW,EACX,MAAM,EACN,QAAQ,GACT,EAAE;QACD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC;QACtB,YAAY,EAAE,YAAY,CAAC;QAC3B,WAAW,EAAE,WAAW,CAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,EAAE,gBAAgB,CAAC;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IAuBD,cAAc;IAOd,OAAO;IAKP,KAAK;IASL,WAAW;IA6BX,gBAAgB;IAsBhB,OAAO,CAAC,aAAa;IAQrB,YAAY;IAwCZ,oBAAoB;IAapB,wBAAwB,CAAC,KAAK,SAAI;IAiBlC,mBAAmB,CAAC,OAAO,EAAE,MAAM;IAuCnC,iBAAiB,CAAC,EAAE,EAAE,QAAQ;IAiC9B,aAAa;IAYb,aAAa;IAcb,aAAa;IAMb,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,YAAY;IAiBpB,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,mBAAmB;IAI3B,OAAO,CAAC,aAAa;IAsBrB,OAAO,CAAC,iBAAiB;IAwBzB,OAAO,CAAC,gBAAgB;IAyBxB,OAAO,CAAC,eAAe;IAwBvB,OAAO,CAAC,mBAAmB;IAc3B,OAAO,CAAC,eAAe;CAuBxB"}
|
574
node_modules/metro-core/node_modules/@jest/fake-timers/build/jestFakeTimers.js
generated
vendored
Normal file
574
node_modules/metro-core/node_modules/@jest/fake-timers/build/jestFakeTimers.js
generated
vendored
Normal file
@ -0,0 +1,574 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _jestMessageUtil() {
|
||||
const data = require('jest-message-util');
|
||||
|
||||
_jestMessageUtil = function _jestMessageUtil() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
const MS_IN_A_YEAR = 31536000000; // TODO: Copied from `jest-util` to avoid cyclic dependency. Import from `jest-util` in the next major
|
||||
|
||||
const setGlobal = (globalToMutate, key, value) => {
|
||||
// @ts-ignore: no index
|
||||
globalToMutate[key] = value;
|
||||
};
|
||||
|
||||
class FakeTimers {
|
||||
constructor({global, moduleMocker, timerConfig, config, maxLoops}) {
|
||||
_defineProperty(this, '_cancelledImmediates', void 0);
|
||||
|
||||
_defineProperty(this, '_cancelledTicks', void 0);
|
||||
|
||||
_defineProperty(this, '_config', void 0);
|
||||
|
||||
_defineProperty(this, '_disposed', void 0);
|
||||
|
||||
_defineProperty(this, '_fakeTimerAPIs', void 0);
|
||||
|
||||
_defineProperty(this, '_global', void 0);
|
||||
|
||||
_defineProperty(this, '_immediates', void 0);
|
||||
|
||||
_defineProperty(this, '_maxLoops', void 0);
|
||||
|
||||
_defineProperty(this, '_moduleMocker', void 0);
|
||||
|
||||
_defineProperty(this, '_now', void 0);
|
||||
|
||||
_defineProperty(this, '_ticks', void 0);
|
||||
|
||||
_defineProperty(this, '_timerAPIs', void 0);
|
||||
|
||||
_defineProperty(this, '_timers', void 0);
|
||||
|
||||
_defineProperty(this, '_uuidCounter', void 0);
|
||||
|
||||
_defineProperty(this, '_timerConfig', void 0);
|
||||
|
||||
this._global = global;
|
||||
this._timerConfig = timerConfig;
|
||||
this._config = config;
|
||||
this._maxLoops = maxLoops || 100000;
|
||||
this._uuidCounter = 1;
|
||||
this._moduleMocker = moduleMocker; // Store original timer APIs for future reference
|
||||
|
||||
this._timerAPIs = {
|
||||
clearImmediate: global.clearImmediate,
|
||||
clearInterval: global.clearInterval,
|
||||
clearTimeout: global.clearTimeout,
|
||||
nextTick: global.process && global.process.nextTick,
|
||||
setImmediate: global.setImmediate,
|
||||
setInterval: global.setInterval,
|
||||
setTimeout: global.setTimeout
|
||||
};
|
||||
this.reset();
|
||||
|
||||
this._createMocks();
|
||||
}
|
||||
|
||||
clearAllTimers() {
|
||||
this._immediates.forEach(immediate =>
|
||||
this._fakeClearImmediate(immediate.uuid)
|
||||
);
|
||||
|
||||
this._timers.clear();
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this._disposed = true;
|
||||
this.clearAllTimers();
|
||||
}
|
||||
|
||||
reset() {
|
||||
this._cancelledTicks = {};
|
||||
this._cancelledImmediates = {};
|
||||
this._now = 0;
|
||||
this._ticks = [];
|
||||
this._immediates = [];
|
||||
this._timers = new Map();
|
||||
}
|
||||
|
||||
runAllTicks() {
|
||||
this._checkFakeTimers(); // Only run a generous number of ticks and then bail.
|
||||
// This is just to help avoid recursive loops
|
||||
|
||||
let i;
|
||||
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const tick = this._ticks.shift();
|
||||
|
||||
if (tick === undefined) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (!this._cancelledTicks.hasOwnProperty(tick.uuid)) {
|
||||
// Callback may throw, so update the map prior calling.
|
||||
this._cancelledTicks[tick.uuid] = true;
|
||||
tick.callback();
|
||||
}
|
||||
}
|
||||
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(
|
||||
'Ran ' +
|
||||
this._maxLoops +
|
||||
' ticks, and there are still more! ' +
|
||||
"Assuming we've hit an infinite recursion and bailing out..."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
runAllImmediates() {
|
||||
this._checkFakeTimers(); // Only run a generous number of immediates and then bail.
|
||||
|
||||
let i;
|
||||
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const immediate = this._immediates.shift();
|
||||
|
||||
if (immediate === undefined) {
|
||||
break;
|
||||
}
|
||||
|
||||
this._runImmediate(immediate);
|
||||
}
|
||||
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(
|
||||
'Ran ' +
|
||||
this._maxLoops +
|
||||
' immediates, and there are still more! Assuming ' +
|
||||
"we've hit an infinite recursion and bailing out..."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_runImmediate(immediate) {
|
||||
if (!this._cancelledImmediates.hasOwnProperty(immediate.uuid)) {
|
||||
// Callback may throw, so update the map prior calling.
|
||||
this._cancelledImmediates[immediate.uuid] = true;
|
||||
immediate.callback();
|
||||
}
|
||||
}
|
||||
|
||||
runAllTimers() {
|
||||
this._checkFakeTimers();
|
||||
|
||||
this.runAllTicks();
|
||||
this.runAllImmediates(); // Only run a generous number of timers and then bail.
|
||||
// This is just to help avoid recursive loops
|
||||
|
||||
let i;
|
||||
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const nextTimerHandle = this._getNextTimerHandle(); // If there are no more timer handles, stop!
|
||||
|
||||
if (nextTimerHandle === null) {
|
||||
break;
|
||||
}
|
||||
|
||||
this._runTimerHandle(nextTimerHandle); // Some of the immediate calls could be enqueued
|
||||
// during the previous handling of the timers, we should
|
||||
// run them as well.
|
||||
|
||||
if (this._immediates.length) {
|
||||
this.runAllImmediates();
|
||||
}
|
||||
|
||||
if (this._ticks.length) {
|
||||
this.runAllTicks();
|
||||
}
|
||||
}
|
||||
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(
|
||||
'Ran ' +
|
||||
this._maxLoops +
|
||||
' timers, and there are still more! ' +
|
||||
"Assuming we've hit an infinite recursion and bailing out..."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
runOnlyPendingTimers() {
|
||||
// We need to hold the current shape of `this._timers` because existing
|
||||
// timers can add new ones to the map and hence would run more than necessary.
|
||||
// See https://github.com/facebook/jest/pull/4608 for details
|
||||
const timerEntries = Array.from(this._timers.entries());
|
||||
|
||||
this._checkFakeTimers();
|
||||
|
||||
this._immediates.forEach(this._runImmediate, this);
|
||||
|
||||
timerEntries
|
||||
.sort(([, left], [, right]) => left.expiry - right.expiry)
|
||||
.forEach(([timerHandle]) => this._runTimerHandle(timerHandle));
|
||||
}
|
||||
|
||||
advanceTimersToNextTimer(steps = 1) {
|
||||
if (steps < 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
const nextExpiry = Array.from(this._timers.values()).reduce(
|
||||
(minExpiry, timer) => {
|
||||
if (minExpiry === null || timer.expiry < minExpiry) return timer.expiry;
|
||||
return minExpiry;
|
||||
},
|
||||
null
|
||||
);
|
||||
|
||||
if (nextExpiry !== null) {
|
||||
this.advanceTimersByTime(nextExpiry - this._now);
|
||||
this.advanceTimersToNextTimer(steps - 1);
|
||||
}
|
||||
}
|
||||
|
||||
advanceTimersByTime(msToRun) {
|
||||
this._checkFakeTimers(); // Only run a generous number of timers and then bail.
|
||||
// This is just to help avoid recursive loops
|
||||
|
||||
let i;
|
||||
|
||||
for (i = 0; i < this._maxLoops; i++) {
|
||||
const timerHandle = this._getNextTimerHandle(); // If there are no more timer handles, stop!
|
||||
|
||||
if (timerHandle === null) {
|
||||
break;
|
||||
}
|
||||
|
||||
const timerValue = this._timers.get(timerHandle);
|
||||
|
||||
if (timerValue === undefined) {
|
||||
break;
|
||||
}
|
||||
|
||||
const nextTimerExpiry = timerValue.expiry;
|
||||
|
||||
if (this._now + msToRun < nextTimerExpiry) {
|
||||
// There are no timers between now and the target we're running to, so
|
||||
// adjust our time cursor and quit
|
||||
this._now += msToRun;
|
||||
break;
|
||||
} else {
|
||||
msToRun -= nextTimerExpiry - this._now;
|
||||
this._now = nextTimerExpiry;
|
||||
|
||||
this._runTimerHandle(timerHandle);
|
||||
}
|
||||
}
|
||||
|
||||
if (i === this._maxLoops) {
|
||||
throw new Error(
|
||||
'Ran ' +
|
||||
this._maxLoops +
|
||||
' timers, and there are still more! ' +
|
||||
"Assuming we've hit an infinite recursion and bailing out..."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
runWithRealTimers(cb) {
|
||||
const prevClearImmediate = this._global.clearImmediate;
|
||||
const prevClearInterval = this._global.clearInterval;
|
||||
const prevClearTimeout = this._global.clearTimeout;
|
||||
const prevNextTick = this._global.process.nextTick;
|
||||
const prevSetImmediate = this._global.setImmediate;
|
||||
const prevSetInterval = this._global.setInterval;
|
||||
const prevSetTimeout = this._global.setTimeout;
|
||||
this.useRealTimers();
|
||||
let cbErr = null;
|
||||
let errThrown = false;
|
||||
|
||||
try {
|
||||
cb();
|
||||
} catch (e) {
|
||||
errThrown = true;
|
||||
cbErr = e;
|
||||
}
|
||||
|
||||
this._global.clearImmediate = prevClearImmediate;
|
||||
this._global.clearInterval = prevClearInterval;
|
||||
this._global.clearTimeout = prevClearTimeout;
|
||||
this._global.process.nextTick = prevNextTick;
|
||||
this._global.setImmediate = prevSetImmediate;
|
||||
this._global.setInterval = prevSetInterval;
|
||||
this._global.setTimeout = prevSetTimeout;
|
||||
|
||||
if (errThrown) {
|
||||
throw cbErr;
|
||||
}
|
||||
}
|
||||
|
||||
useRealTimers() {
|
||||
const global = this._global;
|
||||
setGlobal(global, 'clearImmediate', this._timerAPIs.clearImmediate);
|
||||
setGlobal(global, 'clearInterval', this._timerAPIs.clearInterval);
|
||||
setGlobal(global, 'clearTimeout', this._timerAPIs.clearTimeout);
|
||||
setGlobal(global, 'setImmediate', this._timerAPIs.setImmediate);
|
||||
setGlobal(global, 'setInterval', this._timerAPIs.setInterval);
|
||||
setGlobal(global, 'setTimeout', this._timerAPIs.setTimeout);
|
||||
global.process.nextTick = this._timerAPIs.nextTick;
|
||||
}
|
||||
|
||||
useFakeTimers() {
|
||||
this._createMocks();
|
||||
|
||||
const global = this._global;
|
||||
setGlobal(global, 'clearImmediate', this._fakeTimerAPIs.clearImmediate);
|
||||
setGlobal(global, 'clearInterval', this._fakeTimerAPIs.clearInterval);
|
||||
setGlobal(global, 'clearTimeout', this._fakeTimerAPIs.clearTimeout);
|
||||
setGlobal(global, 'setImmediate', this._fakeTimerAPIs.setImmediate);
|
||||
setGlobal(global, 'setInterval', this._fakeTimerAPIs.setInterval);
|
||||
setGlobal(global, 'setTimeout', this._fakeTimerAPIs.setTimeout);
|
||||
global.process.nextTick = this._fakeTimerAPIs.nextTick;
|
||||
}
|
||||
|
||||
getTimerCount() {
|
||||
this._checkFakeTimers();
|
||||
|
||||
return this._timers.size + this._immediates.length + this._ticks.length;
|
||||
}
|
||||
|
||||
_checkFakeTimers() {
|
||||
if (this._global.setTimeout !== this._fakeTimerAPIs.setTimeout) {
|
||||
this._global.console.warn(
|
||||
`A function to advance timers was called but the timers API is not ` +
|
||||
`mocked with fake timers. Call \`jest.useFakeTimers()\` in this ` +
|
||||
`test or enable fake timers globally by setting ` +
|
||||
`\`"timers": "fake"\` in ` +
|
||||
`the configuration file. This warning is likely a result of a ` +
|
||||
`default configuration change in Jest 15.\n\n` +
|
||||
`Release Blog Post: https://jestjs.io/blog/2016/09/01/jest-15.html\n` +
|
||||
`Stack Trace:\n` +
|
||||
(0, _jestMessageUtil().formatStackTrace)(
|
||||
new Error().stack,
|
||||
this._config,
|
||||
{
|
||||
noStackTrace: false
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
_createMocks() {
|
||||
const fn = (
|
||||
impl // @ts-ignore TODO: figure out better typings here
|
||||
) => this._moduleMocker.fn().mockImplementation(impl); // TODO: add better typings; these are mocks, but typed as regular timers
|
||||
|
||||
this._fakeTimerAPIs = {
|
||||
clearImmediate: fn(this._fakeClearImmediate.bind(this)),
|
||||
clearInterval: fn(this._fakeClearTimer.bind(this)),
|
||||
clearTimeout: fn(this._fakeClearTimer.bind(this)),
|
||||
nextTick: fn(this._fakeNextTick.bind(this)),
|
||||
setImmediate: fn(this._fakeSetImmediate.bind(this)),
|
||||
setInterval: fn(this._fakeSetInterval.bind(this)),
|
||||
setTimeout: fn(this._fakeSetTimeout.bind(this))
|
||||
};
|
||||
}
|
||||
|
||||
_fakeClearTimer(timerRef) {
|
||||
const uuid = this._timerConfig.refToId(timerRef);
|
||||
|
||||
if (uuid) {
|
||||
this._timers.delete(String(uuid));
|
||||
}
|
||||
}
|
||||
|
||||
_fakeClearImmediate(uuid) {
|
||||
this._cancelledImmediates[uuid] = true;
|
||||
}
|
||||
|
||||
_fakeNextTick(callback, ...args) {
|
||||
if (this._disposed) {
|
||||
return;
|
||||
}
|
||||
|
||||
const uuid = String(this._uuidCounter++);
|
||||
|
||||
this._ticks.push({
|
||||
callback: (function(_callback) {
|
||||
function callback() {
|
||||
return _callback.apply(this, arguments);
|
||||
}
|
||||
|
||||
callback.toString = function() {
|
||||
return _callback.toString();
|
||||
};
|
||||
|
||||
return callback;
|
||||
})(() => callback.apply(null, args)),
|
||||
uuid
|
||||
});
|
||||
|
||||
const cancelledTicks = this._cancelledTicks;
|
||||
|
||||
this._timerAPIs.nextTick(() => {
|
||||
if (!cancelledTicks.hasOwnProperty(uuid)) {
|
||||
// Callback may throw, so update the map prior calling.
|
||||
cancelledTicks[uuid] = true;
|
||||
callback.apply(null, args);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
_fakeSetImmediate(callback, ...args) {
|
||||
if (this._disposed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const uuid = this._uuidCounter++;
|
||||
|
||||
this._immediates.push({
|
||||
callback: (function(_callback2) {
|
||||
function callback() {
|
||||
return _callback2.apply(this, arguments);
|
||||
}
|
||||
|
||||
callback.toString = function() {
|
||||
return _callback2.toString();
|
||||
};
|
||||
|
||||
return callback;
|
||||
})(() => callback.apply(null, args)),
|
||||
uuid: String(uuid)
|
||||
});
|
||||
|
||||
const cancelledImmediates = this._cancelledImmediates;
|
||||
|
||||
this._timerAPIs.setImmediate(() => {
|
||||
if (!cancelledImmediates.hasOwnProperty(uuid)) {
|
||||
// Callback may throw, so update the map prior calling.
|
||||
cancelledImmediates[String(uuid)] = true;
|
||||
callback.apply(null, args);
|
||||
}
|
||||
});
|
||||
|
||||
return uuid;
|
||||
}
|
||||
|
||||
_fakeSetInterval(callback, intervalDelay, ...args) {
|
||||
if (this._disposed) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (intervalDelay == null) {
|
||||
intervalDelay = 0;
|
||||
}
|
||||
|
||||
const uuid = this._uuidCounter++;
|
||||
|
||||
this._timers.set(String(uuid), {
|
||||
callback: (function(_callback3) {
|
||||
function callback() {
|
||||
return _callback3.apply(this, arguments);
|
||||
}
|
||||
|
||||
callback.toString = function() {
|
||||
return _callback3.toString();
|
||||
};
|
||||
|
||||
return callback;
|
||||
})(() => callback.apply(null, args)),
|
||||
expiry: this._now + intervalDelay,
|
||||
interval: intervalDelay,
|
||||
type: 'interval'
|
||||
});
|
||||
|
||||
return this._timerConfig.idToRef(uuid);
|
||||
}
|
||||
|
||||
_fakeSetTimeout(callback, delay, ...args) {
|
||||
if (this._disposed) {
|
||||
return null;
|
||||
} // eslint-disable-next-line no-bitwise
|
||||
|
||||
delay = Number(delay) | 0;
|
||||
const uuid = this._uuidCounter++;
|
||||
|
||||
this._timers.set(String(uuid), {
|
||||
callback: (function(_callback4) {
|
||||
function callback() {
|
||||
return _callback4.apply(this, arguments);
|
||||
}
|
||||
|
||||
callback.toString = function() {
|
||||
return _callback4.toString();
|
||||
};
|
||||
|
||||
return callback;
|
||||
})(() => callback.apply(null, args)),
|
||||
expiry: this._now + delay,
|
||||
interval: undefined,
|
||||
type: 'timeout'
|
||||
});
|
||||
|
||||
return this._timerConfig.idToRef(uuid);
|
||||
}
|
||||
|
||||
_getNextTimerHandle() {
|
||||
let nextTimerHandle = null;
|
||||
let soonestTime = MS_IN_A_YEAR;
|
||||
|
||||
this._timers.forEach((timer, uuid) => {
|
||||
if (timer.expiry < soonestTime) {
|
||||
soonestTime = timer.expiry;
|
||||
nextTimerHandle = uuid;
|
||||
}
|
||||
});
|
||||
|
||||
return nextTimerHandle;
|
||||
}
|
||||
|
||||
_runTimerHandle(timerHandle) {
|
||||
const timer = this._timers.get(timerHandle);
|
||||
|
||||
if (!timer) {
|
||||
return;
|
||||
}
|
||||
|
||||
switch (timer.type) {
|
||||
case 'timeout':
|
||||
const callback = timer.callback;
|
||||
|
||||
this._timers.delete(timerHandle);
|
||||
|
||||
callback();
|
||||
break;
|
||||
|
||||
case 'interval':
|
||||
timer.expiry = this._now + (timer.interval || 0);
|
||||
timer.callback();
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new Error('Unexpected timer type: ' + timer.type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = FakeTimers;
|
24
node_modules/metro-core/node_modules/@jest/fake-timers/package.json
generated
vendored
Normal file
24
node_modules/metro-core/node_modules/@jest/fake-timers/package.json
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@jest/fake-timers",
|
||||
"version": "24.9.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-fake-timers"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"dependencies": {
|
||||
"@jest/types": "^24.9.0",
|
||||
"jest-message-util": "^24.9.0",
|
||||
"jest-mock": "^24.9.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "9ad0f4bc6b8bdd94989804226c28c9960d9da7d1"
|
||||
}
|
21
node_modules/metro-core/node_modules/@jest/source-map/LICENSE
generated
vendored
Normal file
21
node_modules/metro-core/node_modules/@jest/source-map/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
10
node_modules/metro-core/node_modules/@jest/source-map/build/getCallsite.d.ts
generated
vendored
Normal file
10
node_modules/metro-core/node_modules/@jest/source-map/build/getCallsite.d.ts
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import callsites from 'callsites';
|
||||
declare const _default: (level: number, sourceMaps?: Record<string, string> | null | undefined) => callsites.CallSite;
|
||||
export default _default;
|
||||
//# sourceMappingURL=getCallsite.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/source-map/build/getCallsite.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/source-map/build/getCallsite.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"getCallsite.d.ts","sourceRoot":"","sources":["../src/getCallsite.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,SAAqB,MAAM,WAAW,CAAC;;AAwC9C,wBAgBE"}
|
107
node_modules/metro-core/node_modules/@jest/source-map/build/getCallsite.js
generated
vendored
Normal file
107
node_modules/metro-core/node_modules/@jest/source-map/build/getCallsite.js
generated
vendored
Normal file
@ -0,0 +1,107 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _gracefulFs() {
|
||||
const data = _interopRequireDefault(require('graceful-fs'));
|
||||
|
||||
_gracefulFs = function _gracefulFs() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _callsites() {
|
||||
const data = _interopRequireDefault(require('callsites'));
|
||||
|
||||
_callsites = function _callsites() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _sourceMap() {
|
||||
const data = require('source-map');
|
||||
|
||||
_sourceMap = function _sourceMap() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
// Copied from https://github.com/rexxars/sourcemap-decorate-callsites/blob/5b9735a156964973a75dc62fd2c7f0c1975458e8/lib/index.js#L113-L158
|
||||
const addSourceMapConsumer = (callsite, consumer) => {
|
||||
const getLineNumber = callsite.getLineNumber;
|
||||
const getColumnNumber = callsite.getColumnNumber;
|
||||
let position = null;
|
||||
|
||||
function getPosition() {
|
||||
if (!position) {
|
||||
position = consumer.originalPositionFor({
|
||||
column: getColumnNumber.call(callsite) || -1,
|
||||
line: getLineNumber.call(callsite) || -1
|
||||
});
|
||||
}
|
||||
|
||||
return position;
|
||||
}
|
||||
|
||||
Object.defineProperties(callsite, {
|
||||
getColumnNumber: {
|
||||
value() {
|
||||
return getPosition().column || getColumnNumber.call(callsite);
|
||||
},
|
||||
|
||||
writable: false
|
||||
},
|
||||
getLineNumber: {
|
||||
value() {
|
||||
return getPosition().line || getLineNumber.call(callsite);
|
||||
},
|
||||
|
||||
writable: false
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var _default = (level, sourceMaps) => {
|
||||
const levelAfterThisCall = level + 1;
|
||||
const stack = (0, _callsites().default)()[levelAfterThisCall];
|
||||
const sourceMapFileName = sourceMaps && sourceMaps[stack.getFileName() || ''];
|
||||
|
||||
if (sourceMapFileName) {
|
||||
try {
|
||||
const sourceMap = _gracefulFs().default.readFileSync(
|
||||
sourceMapFileName,
|
||||
'utf8'
|
||||
); // @ts-ignore: Not allowed to pass string
|
||||
|
||||
addSourceMapConsumer(
|
||||
stack,
|
||||
new (_sourceMap()).SourceMapConsumer(sourceMap)
|
||||
);
|
||||
} catch (e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
return stack;
|
||||
};
|
||||
|
||||
exports.default = _default;
|
9
node_modules/metro-core/node_modules/@jest/source-map/build/index.d.ts
generated
vendored
Normal file
9
node_modules/metro-core/node_modules/@jest/source-map/build/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
export { default as getCallsite } from './getCallsite';
|
||||
export { SourceMapRegistry } from './types';
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/source-map/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/source-map/build/index.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC"}
|
25
node_modules/metro-core/node_modules/@jest/source-map/build/index.js
generated
vendored
Normal file
25
node_modules/metro-core/node_modules/@jest/source-map/build/index.js
generated
vendored
Normal file
@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'getCallsite', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _getCallsite.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'SourceMapRegistry', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.SourceMapRegistry;
|
||||
}
|
||||
});
|
||||
|
||||
var _getCallsite = _interopRequireDefault(require('./getCallsite'));
|
||||
|
||||
var _types = require('./types');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
8
node_modules/metro-core/node_modules/@jest/source-map/build/types.d.ts
generated
vendored
Normal file
8
node_modules/metro-core/node_modules/@jest/source-map/build/types.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
export declare type SourceMapRegistry = Record<string, string>;
|
||||
//# sourceMappingURL=types.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/source-map/build/types.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/source-map/build/types.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,oBAAY,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|
1
node_modules/metro-core/node_modules/@jest/source-map/build/types.js
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/source-map/build/types.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
'use strict';
|
27
node_modules/metro-core/node_modules/@jest/source-map/package.json
generated
vendored
Normal file
27
node_modules/metro-core/node_modules/@jest/source-map/package.json
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@jest/source-map",
|
||||
"version": "24.9.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-source-map"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"dependencies": {
|
||||
"callsites": "^3.0.0",
|
||||
"graceful-fs": "^4.1.15",
|
||||
"source-map": "^0.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/graceful-fs": "^4.1.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "9ad0f4bc6b8bdd94989804226c28c9960d9da7d1"
|
||||
}
|
21
node_modules/metro-core/node_modules/@jest/test-result/LICENSE
generated
vendored
Normal file
21
node_modules/metro-core/node_modules/@jest/test-result/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
9
node_modules/metro-core/node_modules/@jest/test-result/build/formatTestResults.d.ts
generated
vendored
Normal file
9
node_modules/metro-core/node_modules/@jest/test-result/build/formatTestResults.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { AggregatedResult, CodeCoverageFormatter, CodeCoverageReporter, FormattedTestResults } from './types';
|
||||
export default function formatTestResults(results: AggregatedResult, codeCoverageFormatter?: CodeCoverageFormatter, reporter?: CodeCoverageReporter): FormattedTestResults;
|
||||
//# sourceMappingURL=formatTestResults.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/test-result/build/formatTestResults.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/test-result/build/formatTestResults.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"formatTestResults.d.ts","sourceRoot":"","sources":["../src/formatTestResults.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,gBAAgB,EAEhB,qBAAqB,EACrB,oBAAoB,EAGpB,oBAAoB,EAErB,MAAM,SAAS,CAAC;AAwDjB,MAAM,CAAC,OAAO,UAAU,iBAAiB,CACvC,OAAO,EAAE,gBAAgB,EACzB,qBAAqB,CAAC,EAAE,qBAAqB,EAC7C,QAAQ,CAAC,EAAE,oBAAoB,GAC9B,oBAAoB,CAMtB"}
|
104
node_modules/metro-core/node_modules/@jest/test-result/build/formatTestResults.js
generated
vendored
Normal file
104
node_modules/metro-core/node_modules/@jest/test-result/build/formatTestResults.js
generated
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = formatTestResults;
|
||||
|
||||
function _objectSpread(target) {
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var source = arguments[i] != null ? arguments[i] : {};
|
||||
var ownKeys = Object.keys(source);
|
||||
if (typeof Object.getOwnPropertySymbols === 'function') {
|
||||
ownKeys = ownKeys.concat(
|
||||
Object.getOwnPropertySymbols(source).filter(function(sym) {
|
||||
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
||||
})
|
||||
);
|
||||
}
|
||||
ownKeys.forEach(function(key) {
|
||||
_defineProperty(target, key, source[key]);
|
||||
});
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
function _defineProperty(obj, key, value) {
|
||||
if (key in obj) {
|
||||
Object.defineProperty(obj, key, {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
} else {
|
||||
obj[key] = value;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
const formatTestResult = (testResult, codeCoverageFormatter, reporter) => {
|
||||
const assertionResults = testResult.testResults.map(formatTestAssertion);
|
||||
|
||||
if (testResult.testExecError) {
|
||||
const now = Date.now();
|
||||
return {
|
||||
assertionResults,
|
||||
coverage: {},
|
||||
endTime: now,
|
||||
message: testResult.failureMessage
|
||||
? testResult.failureMessage
|
||||
: testResult.testExecError.message,
|
||||
name: testResult.testFilePath,
|
||||
startTime: now,
|
||||
status: 'failed',
|
||||
summary: ''
|
||||
};
|
||||
} else {
|
||||
const allTestsPassed = testResult.numFailingTests === 0;
|
||||
return {
|
||||
assertionResults,
|
||||
coverage: codeCoverageFormatter
|
||||
? codeCoverageFormatter(testResult.coverage, reporter)
|
||||
: testResult.coverage,
|
||||
endTime: testResult.perfStats.end,
|
||||
message: testResult.failureMessage || '',
|
||||
name: testResult.testFilePath,
|
||||
startTime: testResult.perfStats.start,
|
||||
status: allTestsPassed ? 'passed' : 'failed',
|
||||
summary: ''
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
function formatTestAssertion(assertion) {
|
||||
const result = {
|
||||
ancestorTitles: assertion.ancestorTitles,
|
||||
failureMessages: null,
|
||||
fullName: assertion.fullName,
|
||||
location: assertion.location,
|
||||
status: assertion.status,
|
||||
title: assertion.title
|
||||
};
|
||||
|
||||
if (assertion.failureMessages) {
|
||||
result.failureMessages = assertion.failureMessages;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function formatTestResults(results, codeCoverageFormatter, reporter) {
|
||||
const testResults = results.testResults.map(testResult =>
|
||||
formatTestResult(testResult, codeCoverageFormatter, reporter)
|
||||
);
|
||||
return _objectSpread({}, results, {
|
||||
testResults
|
||||
});
|
||||
}
|
11
node_modules/metro-core/node_modules/@jest/test-result/build/helpers.d.ts
generated
vendored
Normal file
11
node_modules/metro-core/node_modules/@jest/test-result/build/helpers.d.ts
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { AggregatedResult, SerializableError, TestResult } from './types';
|
||||
export declare const makeEmptyAggregatedTestResult: () => AggregatedResult;
|
||||
export declare const buildFailureTestResult: (testPath: string, err: SerializableError) => TestResult;
|
||||
export declare const addResult: (aggregatedResults: AggregatedResult, testResult: TestResult) => void;
|
||||
//# sourceMappingURL=helpers.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/test-result/build/helpers.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/test-result/build/helpers.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../src/helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,gBAAgB,EAAE,iBAAiB,EAAE,UAAU,EAAC,MAAM,SAAS,CAAC;AAExE,eAAO,MAAM,6BAA6B,wBAiCxC,CAAC;AAEH,eAAO,MAAM,sBAAsB,0DA+BjC,CAAC;AAGH,eAAO,MAAM,SAAS,uEAmErB,CAAC"}
|
153
node_modules/metro-core/node_modules/@jest/test-result/build/helpers.js
generated
vendored
Normal file
153
node_modules/metro-core/node_modules/@jest/test-result/build/helpers.js
generated
vendored
Normal file
@ -0,0 +1,153 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.addResult = exports.buildFailureTestResult = exports.makeEmptyAggregatedTestResult = void 0;
|
||||
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
const makeEmptyAggregatedTestResult = () => ({
|
||||
numFailedTestSuites: 0,
|
||||
numFailedTests: 0,
|
||||
numPassedTestSuites: 0,
|
||||
numPassedTests: 0,
|
||||
numPendingTestSuites: 0,
|
||||
numPendingTests: 0,
|
||||
numRuntimeErrorTestSuites: 0,
|
||||
numTodoTests: 0,
|
||||
numTotalTestSuites: 0,
|
||||
numTotalTests: 0,
|
||||
openHandles: [],
|
||||
snapshot: {
|
||||
added: 0,
|
||||
didUpdate: false,
|
||||
// is set only after the full run
|
||||
failure: false,
|
||||
filesAdded: 0,
|
||||
// combines individual test results + removed files after the full run
|
||||
filesRemoved: 0,
|
||||
filesRemovedList: [],
|
||||
filesUnmatched: 0,
|
||||
filesUpdated: 0,
|
||||
matched: 0,
|
||||
total: 0,
|
||||
unchecked: 0,
|
||||
uncheckedKeysByFile: [],
|
||||
unmatched: 0,
|
||||
updated: 0
|
||||
},
|
||||
startTime: 0,
|
||||
success: true,
|
||||
testResults: [],
|
||||
wasInterrupted: false
|
||||
});
|
||||
|
||||
exports.makeEmptyAggregatedTestResult = makeEmptyAggregatedTestResult;
|
||||
|
||||
const buildFailureTestResult = (testPath, err) => ({
|
||||
console: undefined,
|
||||
displayName: '',
|
||||
failureMessage: null,
|
||||
leaks: false,
|
||||
numFailingTests: 0,
|
||||
numPassingTests: 0,
|
||||
numPendingTests: 0,
|
||||
numTodoTests: 0,
|
||||
openHandles: [],
|
||||
perfStats: {
|
||||
end: 0,
|
||||
start: 0
|
||||
},
|
||||
skipped: false,
|
||||
snapshot: {
|
||||
added: 0,
|
||||
fileDeleted: false,
|
||||
matched: 0,
|
||||
unchecked: 0,
|
||||
uncheckedKeys: [],
|
||||
unmatched: 0,
|
||||
updated: 0
|
||||
},
|
||||
sourceMaps: {},
|
||||
testExecError: err,
|
||||
testFilePath: testPath,
|
||||
testResults: []
|
||||
}); // Add individual test result to an aggregated test result
|
||||
|
||||
exports.buildFailureTestResult = buildFailureTestResult;
|
||||
|
||||
const addResult = (aggregatedResults, testResult) => {
|
||||
// `todos` are new as of Jest 24, and not all runners return it.
|
||||
// Set it to `0` to avoid `NaN`
|
||||
if (!testResult.numTodoTests) {
|
||||
testResult.numTodoTests = 0;
|
||||
}
|
||||
|
||||
aggregatedResults.testResults.push(testResult);
|
||||
aggregatedResults.numTotalTests +=
|
||||
testResult.numPassingTests +
|
||||
testResult.numFailingTests +
|
||||
testResult.numPendingTests +
|
||||
testResult.numTodoTests;
|
||||
aggregatedResults.numFailedTests += testResult.numFailingTests;
|
||||
aggregatedResults.numPassedTests += testResult.numPassingTests;
|
||||
aggregatedResults.numPendingTests += testResult.numPendingTests;
|
||||
aggregatedResults.numTodoTests += testResult.numTodoTests;
|
||||
|
||||
if (testResult.testExecError) {
|
||||
aggregatedResults.numRuntimeErrorTestSuites++;
|
||||
}
|
||||
|
||||
if (testResult.skipped) {
|
||||
aggregatedResults.numPendingTestSuites++;
|
||||
} else if (testResult.numFailingTests > 0 || testResult.testExecError) {
|
||||
aggregatedResults.numFailedTestSuites++;
|
||||
} else {
|
||||
aggregatedResults.numPassedTestSuites++;
|
||||
} // Snapshot data
|
||||
|
||||
if (testResult.snapshot.added) {
|
||||
aggregatedResults.snapshot.filesAdded++;
|
||||
}
|
||||
|
||||
if (testResult.snapshot.fileDeleted) {
|
||||
aggregatedResults.snapshot.filesRemoved++;
|
||||
}
|
||||
|
||||
if (testResult.snapshot.unmatched) {
|
||||
aggregatedResults.snapshot.filesUnmatched++;
|
||||
}
|
||||
|
||||
if (testResult.snapshot.updated) {
|
||||
aggregatedResults.snapshot.filesUpdated++;
|
||||
}
|
||||
|
||||
aggregatedResults.snapshot.added += testResult.snapshot.added;
|
||||
aggregatedResults.snapshot.matched += testResult.snapshot.matched;
|
||||
aggregatedResults.snapshot.unchecked += testResult.snapshot.unchecked;
|
||||
|
||||
if (
|
||||
testResult.snapshot.uncheckedKeys &&
|
||||
testResult.snapshot.uncheckedKeys.length > 0
|
||||
) {
|
||||
aggregatedResults.snapshot.uncheckedKeysByFile.push({
|
||||
filePath: testResult.testFilePath,
|
||||
keys: testResult.snapshot.uncheckedKeys
|
||||
});
|
||||
}
|
||||
|
||||
aggregatedResults.snapshot.unmatched += testResult.snapshot.unmatched;
|
||||
aggregatedResults.snapshot.updated += testResult.snapshot.updated;
|
||||
aggregatedResults.snapshot.total +=
|
||||
testResult.snapshot.added +
|
||||
testResult.snapshot.matched +
|
||||
testResult.snapshot.unmatched +
|
||||
testResult.snapshot.updated;
|
||||
};
|
||||
|
||||
exports.addResult = addResult;
|
10
node_modules/metro-core/node_modules/@jest/test-result/build/index.d.ts
generated
vendored
Normal file
10
node_modules/metro-core/node_modules/@jest/test-result/build/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
export { default as formatTestResults } from './formatTestResults';
|
||||
export { addResult, buildFailureTestResult, makeEmptyAggregatedTestResult, } from './helpers';
|
||||
export { AggregatedResult, AssertionLocation, AssertionResult, FailedAssertion, Milliseconds, SerializableError, SnapshotSummary, Status, Suite, TestResult, } from './types';
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/test-result/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/test-result/build/index.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,OAAO,IAAI,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AACjE,OAAO,EACL,SAAS,EACT,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,WAAW,CAAC;AACnB,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,eAAe,EACf,MAAM,EACN,KAAK,EACL,UAAU,GACX,MAAM,SAAS,CAAC"}
|
99
node_modules/metro-core/node_modules/@jest/test-result/build/index.js
generated
vendored
Normal file
99
node_modules/metro-core/node_modules/@jest/test-result/build/index.js
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, 'formatTestResults', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _formatTestResults.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'addResult', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _helpers.addResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'buildFailureTestResult', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _helpers.buildFailureTestResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'makeEmptyAggregatedTestResult', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _helpers.makeEmptyAggregatedTestResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'AggregatedResult', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.AggregatedResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'AssertionLocation', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.AssertionLocation;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'AssertionResult', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.AssertionResult;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'FailedAssertion', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.FailedAssertion;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'Milliseconds', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.Milliseconds;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'SerializableError', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.SerializableError;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'SnapshotSummary', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.SnapshotSummary;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'Status', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.Status;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'Suite', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.Suite;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'TestResult', {
|
||||
enumerable: true,
|
||||
get: function get() {
|
||||
return _types.TestResult;
|
||||
}
|
||||
});
|
||||
|
||||
var _formatTestResults = _interopRequireDefault(require('./formatTestResults'));
|
||||
|
||||
var _helpers = require('./helpers');
|
||||
|
||||
var _types = require('./types');
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
166
node_modules/metro-core/node_modules/@jest/test-result/build/types.d.ts
generated
vendored
Normal file
166
node_modules/metro-core/node_modules/@jest/test-result/build/types.d.ts
generated
vendored
Normal file
@ -0,0 +1,166 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import { CoverageMap, CoverageMapData } from 'istanbul-lib-coverage';
|
||||
import { ConsoleBuffer } from '@jest/console';
|
||||
import { Config } from '@jest/types';
|
||||
export declare type SerializableError = {
|
||||
code?: unknown;
|
||||
message: string;
|
||||
stack: string | null | undefined;
|
||||
type?: string;
|
||||
};
|
||||
export declare type FailedAssertion = {
|
||||
matcherName?: string;
|
||||
message?: string;
|
||||
actual?: any;
|
||||
pass?: boolean;
|
||||
passed?: boolean;
|
||||
expected?: any;
|
||||
isNot?: boolean;
|
||||
stack?: string;
|
||||
error?: any;
|
||||
};
|
||||
export declare type AssertionLocation = {
|
||||
fullName: string;
|
||||
path: string;
|
||||
};
|
||||
export declare type Status = 'passed' | 'failed' | 'skipped' | 'pending' | 'todo' | 'disabled';
|
||||
export declare type Bytes = number;
|
||||
export declare type Milliseconds = number;
|
||||
declare type Callsite = {
|
||||
column: number;
|
||||
line: number;
|
||||
};
|
||||
export declare type AssertionResult = {
|
||||
ancestorTitles: Array<string>;
|
||||
duration?: Milliseconds | null | undefined;
|
||||
failureMessages: Array<string>;
|
||||
fullName: string;
|
||||
invocations?: number;
|
||||
location: Callsite | null | undefined;
|
||||
numPassingAsserts: number;
|
||||
status: Status;
|
||||
title: string;
|
||||
};
|
||||
export declare type FormattedAssertionResult = {
|
||||
ancestorTitles: Array<string>;
|
||||
failureMessages: Array<string> | null;
|
||||
fullName: string;
|
||||
location: Callsite | null | undefined;
|
||||
status: Status;
|
||||
title: string;
|
||||
};
|
||||
export declare type AggregatedResultWithoutCoverage = {
|
||||
numFailedTests: number;
|
||||
numFailedTestSuites: number;
|
||||
numPassedTests: number;
|
||||
numPassedTestSuites: number;
|
||||
numPendingTests: number;
|
||||
numTodoTests: number;
|
||||
numPendingTestSuites: number;
|
||||
numRuntimeErrorTestSuites: number;
|
||||
numTotalTests: number;
|
||||
numTotalTestSuites: number;
|
||||
openHandles: Array<Error>;
|
||||
snapshot: SnapshotSummary;
|
||||
startTime: number;
|
||||
success: boolean;
|
||||
testResults: Array<TestResult>;
|
||||
wasInterrupted: boolean;
|
||||
};
|
||||
export declare type AggregatedResult = AggregatedResultWithoutCoverage & {
|
||||
coverageMap?: CoverageMap | null;
|
||||
};
|
||||
export declare type Suite = {
|
||||
title: string;
|
||||
suites: Array<Suite>;
|
||||
tests: Array<AssertionResult>;
|
||||
};
|
||||
export declare type TestResult = {
|
||||
console?: ConsoleBuffer;
|
||||
coverage?: CoverageMapData;
|
||||
displayName?: Config.DisplayName;
|
||||
failureMessage?: string | null;
|
||||
leaks: boolean;
|
||||
memoryUsage?: Bytes;
|
||||
numFailingTests: number;
|
||||
numPassingTests: number;
|
||||
numPendingTests: number;
|
||||
numTodoTests: number;
|
||||
openHandles: Array<Error>;
|
||||
perfStats: {
|
||||
end: Milliseconds;
|
||||
start: Milliseconds;
|
||||
};
|
||||
skipped: boolean;
|
||||
snapshot: {
|
||||
added: number;
|
||||
fileDeleted: boolean;
|
||||
matched: number;
|
||||
unchecked: number;
|
||||
uncheckedKeys: Array<string>;
|
||||
unmatched: number;
|
||||
updated: number;
|
||||
};
|
||||
sourceMaps?: {
|
||||
[sourcePath: string]: string;
|
||||
};
|
||||
testExecError?: SerializableError;
|
||||
testFilePath: string;
|
||||
testResults: Array<AssertionResult>;
|
||||
};
|
||||
export declare type FormattedTestResult = {
|
||||
message: string;
|
||||
name: string;
|
||||
summary: string;
|
||||
status: 'failed' | 'passed';
|
||||
startTime: number;
|
||||
endTime: number;
|
||||
coverage: any;
|
||||
assertionResults: Array<FormattedAssertionResult>;
|
||||
};
|
||||
export declare type FormattedTestResults = {
|
||||
coverageMap?: CoverageMap | null | undefined;
|
||||
numFailedTests: number;
|
||||
numFailedTestSuites: number;
|
||||
numPassedTests: number;
|
||||
numPassedTestSuites: number;
|
||||
numPendingTests: number;
|
||||
numPendingTestSuites: number;
|
||||
numRuntimeErrorTestSuites: number;
|
||||
numTotalTests: number;
|
||||
numTotalTestSuites: number;
|
||||
snapshot: SnapshotSummary;
|
||||
startTime: number;
|
||||
success: boolean;
|
||||
testResults: Array<FormattedTestResult>;
|
||||
wasInterrupted: boolean;
|
||||
};
|
||||
export declare type CodeCoverageReporter = any;
|
||||
export declare type CodeCoverageFormatter = (coverage: CoverageMapData | null | undefined, reporter: CodeCoverageReporter) => Record<string, any> | null | undefined;
|
||||
export declare type UncheckedSnapshot = {
|
||||
filePath: string;
|
||||
keys: Array<string>;
|
||||
};
|
||||
export declare type SnapshotSummary = {
|
||||
added: number;
|
||||
didUpdate: boolean;
|
||||
failure: boolean;
|
||||
filesAdded: number;
|
||||
filesRemoved: number;
|
||||
filesRemovedList: Array<string>;
|
||||
filesUnmatched: number;
|
||||
filesUpdated: number;
|
||||
matched: number;
|
||||
total: number;
|
||||
unchecked: number;
|
||||
uncheckedKeysByFile: Array<UncheckedSnapshot>;
|
||||
unmatched: number;
|
||||
updated: number;
|
||||
};
|
||||
export {};
|
||||
//# sourceMappingURL=types.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/test-result/build/types.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/test-result/build/types.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,WAAW,EAAE,eAAe,EAAC,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAC,aAAa,EAAC,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAEnC,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACjC,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,GAAG,CAAC;IACb,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,MAAM,GACd,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,SAAS,GACT,MAAM,GACN,UAAU,CAAC;AAEf,oBAAY,KAAK,GAAG,MAAM,CAAC;AAE3B,oBAAY,YAAY,GAAG,MAAM,CAAC;AAClC,aAAK,QAAQ,GAAG;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,QAAQ,GAAG,IAAI,GAAG,SAAS,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,+BAA+B,GAAG;IAC5C,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yBAAyB,EAAE,MAAM,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC/B,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,oBAAY,gBAAgB,GAAG,+BAA+B,GAAG;IAC/D,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,oBAAY,KAAK,GAAG;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACrB,KAAK,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;CAC/B,CAAC;AAEF,oBAAY,UAAU,GAAG;IACvB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,QAAQ,CAAC,EAAE,eAAe,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC,WAAW,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,SAAS,EAAE;QACT,GAAG,EAAE,YAAY,CAAC;QAClB,KAAK,EAAE,YAAY,CAAC;KACrB,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,OAAO,CAAC;QACrB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,UAAU,CAAC,EAAE;QACX,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC;KAC9B,CAAC;IACF,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;CACrC,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,GAAG,CAAC;IACd,gBAAgB,EAAE,KAAK,CAAC,wBAAwB,CAAC,CAAC;CACnD,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,WAAW,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7C,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,eAAe,EAAE,MAAM,CAAC;IACxB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,yBAAyB,EAAE,MAAM,CAAC;IAClC,aAAa,EAAE,MAAM,CAAC;IACtB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,eAAe,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,WAAW,EAAE,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACxC,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,oBAAY,oBAAoB,GAAG,GAAG,CAAC;AAEvC,oBAAY,qBAAqB,GAAG,CAClC,QAAQ,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,EAC5C,QAAQ,EAAE,oBAAoB,KAC3B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAE5C,oBAAY,iBAAiB,GAAG;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACrB,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,mBAAmB,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
1
node_modules/metro-core/node_modules/@jest/test-result/build/types.js
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/test-result/build/types.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
'use strict';
|
24
node_modules/metro-core/node_modules/@jest/test-result/package.json
generated
vendored
Normal file
24
node_modules/metro-core/node_modules/@jest/test-result/package.json
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@jest/test-result",
|
||||
"version": "24.9.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-test-result"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"dependencies": {
|
||||
"@jest/console": "^24.9.0",
|
||||
"@jest/types": "^24.9.0",
|
||||
"@types/istanbul-lib-coverage": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "9ad0f4bc6b8bdd94989804226c28c9960d9da7d1"
|
||||
}
|
21
node_modules/metro-core/node_modules/@jest/types/LICENSE
generated
vendored
Normal file
21
node_modules/metro-core/node_modules/@jest/types/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Facebook, Inc. and its affiliates.
|
||||
|
||||
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.
|
172
node_modules/metro-core/node_modules/@jest/types/build/Circus.d.ts
generated
vendored
Normal file
172
node_modules/metro-core/node_modules/@jest/types/build/Circus.d.ts
generated
vendored
Normal file
@ -0,0 +1,172 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import * as Global from './Global';
|
||||
declare type Process = NodeJS.Process;
|
||||
export declare type DoneFn = Global.DoneFn;
|
||||
export declare type BlockFn = Global.BlockFn;
|
||||
export declare type BlockName = Global.BlockName;
|
||||
export declare type BlockMode = void | 'skip' | 'only' | 'todo';
|
||||
export declare type TestMode = BlockMode;
|
||||
export declare type TestName = Global.TestName;
|
||||
export declare type TestFn = Global.TestFn;
|
||||
export declare type HookFn = (done?: DoneFn) => Promise<any> | null | undefined;
|
||||
export declare type AsyncFn = TestFn | HookFn;
|
||||
export declare type SharedHookType = 'afterAll' | 'beforeAll';
|
||||
export declare type HookType = SharedHookType | 'afterEach' | 'beforeEach';
|
||||
export declare type TestContext = Record<string, any>;
|
||||
export declare type Exception = any;
|
||||
export declare type FormattedError = string;
|
||||
export declare type Hook = {
|
||||
asyncError: Error;
|
||||
fn: HookFn;
|
||||
type: HookType;
|
||||
parent: DescribeBlock;
|
||||
timeout: number | undefined | null;
|
||||
};
|
||||
export declare type EventHandler = (event: Event, state: State) => void;
|
||||
export declare type Event = {
|
||||
name: 'include_test_location_in_result';
|
||||
} | {
|
||||
asyncError: Error;
|
||||
mode: BlockMode;
|
||||
name: 'start_describe_definition';
|
||||
blockName: BlockName;
|
||||
} | {
|
||||
mode: BlockMode;
|
||||
name: 'finish_describe_definition';
|
||||
blockName: BlockName;
|
||||
} | {
|
||||
asyncError: Error;
|
||||
name: 'add_hook';
|
||||
hookType: HookType;
|
||||
fn: HookFn;
|
||||
timeout: number | undefined;
|
||||
} | {
|
||||
asyncError: Error;
|
||||
name: 'add_test';
|
||||
testName: TestName;
|
||||
fn?: TestFn;
|
||||
mode?: TestMode;
|
||||
timeout: number | undefined;
|
||||
} | {
|
||||
name: 'hook_start';
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'hook_success';
|
||||
describeBlock?: DescribeBlock;
|
||||
test?: TestEntry;
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'hook_failure';
|
||||
error: string | Exception;
|
||||
describeBlock?: DescribeBlock;
|
||||
test?: TestEntry;
|
||||
hook: Hook;
|
||||
} | {
|
||||
name: 'test_fn_start';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_fn_success';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_fn_failure';
|
||||
error: Exception;
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_retry';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_start';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_skip';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_todo';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'test_done';
|
||||
test: TestEntry;
|
||||
} | {
|
||||
name: 'run_describe_start';
|
||||
describeBlock: DescribeBlock;
|
||||
} | {
|
||||
name: 'run_describe_finish';
|
||||
describeBlock: DescribeBlock;
|
||||
} | {
|
||||
name: 'run_start';
|
||||
} | {
|
||||
name: 'run_finish';
|
||||
} | {
|
||||
name: 'error';
|
||||
error: Exception;
|
||||
} | {
|
||||
name: 'setup';
|
||||
testNamePattern?: string;
|
||||
parentProcess: Process;
|
||||
} | {
|
||||
name: 'teardown';
|
||||
};
|
||||
export declare type TestStatus = 'skip' | 'done' | 'todo';
|
||||
export declare type TestResult = {
|
||||
duration?: number | null;
|
||||
errors: Array<FormattedError>;
|
||||
invocations: number;
|
||||
status: TestStatus;
|
||||
location?: {
|
||||
column: number;
|
||||
line: number;
|
||||
} | null;
|
||||
testPath: Array<TestName | BlockName>;
|
||||
};
|
||||
export declare type RunResult = {
|
||||
unhandledErrors: Array<FormattedError>;
|
||||
testResults: TestResults;
|
||||
};
|
||||
export declare type TestResults = Array<TestResult>;
|
||||
export declare type GlobalErrorHandlers = {
|
||||
uncaughtException: Array<(exception: Exception) => void>;
|
||||
unhandledRejection: Array<(exception: Exception, promise: Promise<any>) => void>;
|
||||
};
|
||||
export declare type State = {
|
||||
currentDescribeBlock: DescribeBlock;
|
||||
currentlyRunningTest?: TestEntry | null;
|
||||
expand?: boolean;
|
||||
hasFocusedTests: boolean;
|
||||
originalGlobalErrorHandlers?: GlobalErrorHandlers;
|
||||
parentProcess: Process | null;
|
||||
rootDescribeBlock: DescribeBlock;
|
||||
testNamePattern?: RegExp | null;
|
||||
testTimeout: number;
|
||||
unhandledErrors: Array<Exception>;
|
||||
includeTestLocationInResult: boolean;
|
||||
};
|
||||
export declare type DescribeBlock = {
|
||||
children: Array<DescribeBlock>;
|
||||
hooks: Array<Hook>;
|
||||
mode: BlockMode;
|
||||
name: BlockName;
|
||||
parent?: DescribeBlock;
|
||||
tests: Array<TestEntry>;
|
||||
};
|
||||
export declare type TestError = Exception | Array<[Exception | undefined, Exception]>;
|
||||
export declare type TestEntry = {
|
||||
asyncError: Exception;
|
||||
errors: TestError;
|
||||
fn?: TestFn;
|
||||
invocations: number;
|
||||
mode: TestMode;
|
||||
name: TestName;
|
||||
parent: DescribeBlock;
|
||||
startedAt?: number | null;
|
||||
duration?: number | null;
|
||||
status?: TestStatus | null;
|
||||
timeout?: number;
|
||||
};
|
||||
export {};
|
||||
//# sourceMappingURL=Circus.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/types/build/Circus.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/types/build/Circus.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"Circus.d.ts","sourceRoot":"","sources":["../src/Circus.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,aAAK,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AAE9B,oBAAY,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACnC,oBAAY,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;AACrC,oBAAY,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC;AACzC,oBAAY,SAAS,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AACxD,oBAAY,QAAQ,GAAG,SAAS,CAAC;AACjC,oBAAY,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;AACvC,oBAAY,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACnC,oBAAY,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AACxE,oBAAY,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AACtC,oBAAY,cAAc,GAAG,UAAU,GAAG,WAAW,CAAC;AACtD,oBAAY,QAAQ,GAAG,cAAc,GAAG,WAAW,GAAG,YAAY,CAAC;AACnE,oBAAY,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAC9C,oBAAY,SAAS,GAAG,GAAG,CAAC;AAC5B,oBAAY,cAAc,GAAG,MAAM,CAAC;AACpC,oBAAY,IAAI,GAAG;IACjB,UAAU,EAAE,KAAK,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,aAAa,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;CACpC,CAAC;AAEF,oBAAY,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;AAEhE,oBAAY,KAAK,GACb;IACE,IAAI,EAAE,iCAAiC,CAAC;CACzC,GACD;IACE,UAAU,EAAE,KAAK,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,2BAA2B,CAAC;IAClC,SAAS,EAAE,SAAS,CAAC;CACtB,GACD;IACE,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,4BAA4B,CAAC;IACnC,SAAS,EAAE,SAAS,CAAC;CACtB,GACD;IACE,UAAU,EAAE,KAAK,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,GACD;IACE,UAAU,EAAE,KAAK,CAAC;IAClB,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,IAAI,CAAC;CACZ,GACD;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;CACZ,GACD;IACE,IAAI,EAAE,cAAc,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;CACZ,GACD;IACE,IAAI,EAAE,eAAe,CAAC;IACtB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,IAAI,EAAE,iBAAiB,CAAC;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IAGE,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IAKE,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,SAAS,CAAC;CACjB,GACD;IACE,IAAI,EAAE,oBAAoB,CAAC;IAC3B,aAAa,EAAE,aAAa,CAAC;CAC9B,GACD;IACE,IAAI,EAAE,qBAAqB,CAAC;IAC5B,aAAa,EAAE,aAAa,CAAC;CAC9B,GACD;IACE,IAAI,EAAE,WAAW,CAAC;CACnB,GACD;IACE,IAAI,EAAE,YAAY,CAAC;CACpB,GACD;IAGE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,SAAS,CAAC;CAClB,GACD;IAEE,IAAI,EAAE,OAAO,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,OAAO,CAAC;CACxB,GACD;IAGE,IAAI,EAAE,UAAU,CAAC;CAClB,CAAC;AAEN,oBAAY,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAClD,oBAAY,UAAU,GAAG;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,GAAG,IAAI,CAAC;IACjD,QAAQ,EAAE,KAAK,CAAC,QAAQ,GAAG,SAAS,CAAC,CAAC;CACvC,CAAC;AAEF,oBAAY,SAAS,GAAG;IACtB,eAAe,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC;IACvC,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF,oBAAY,WAAW,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC;AAE5C,oBAAY,mBAAmB,GAAG;IAChC,iBAAiB,EAAE,KAAK,CAAC,CAAC,SAAS,EAAE,SAAS,KAAK,IAAI,CAAC,CAAC;IACzD,kBAAkB,EAAE,KAAK,CACvB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CACtD,CAAC;CACH,CAAC;AAEF,oBAAY,KAAK,GAAG;IAClB,oBAAoB,EAAE,aAAa,CAAC;IACpC,oBAAoB,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;IAIzB,2BAA2B,CAAC,EAAE,mBAAmB,CAAC;IAClD,aAAa,EAAE,OAAO,GAAG,IAAI,CAAC;IAC9B,iBAAiB,EAAE,aAAa,CAAC;IACjC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAClC,2BAA2B,EAAE,OAAO,CAAC;CACtC,CAAC;AAEF,oBAAY,aAAa,GAAG;IAC1B,QAAQ,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC/B,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC;IAChB,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CACzB,CAAC;AAEF,oBAAY,SAAS,GAAG,SAAS,GAAG,KAAK,CAAC,CAAC,SAAS,GAAG,SAAS,EAAE,SAAS,CAAC,CAAC,CAAC;AAE9E,oBAAY,SAAS,GAAG;IACtB,UAAU,EAAE,SAAS,CAAC;IACtB,MAAM,EAAE,SAAS,CAAC;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,QAAQ,CAAC;IACf,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,MAAM,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC"}
|
1
node_modules/metro-core/node_modules/@jest/types/build/Circus.js
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/types/build/Circus.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
'use strict';
|
439
node_modules/metro-core/node_modules/@jest/types/build/Config.d.ts
generated
vendored
Normal file
439
node_modules/metro-core/node_modules/@jest/types/build/Config.d.ts
generated
vendored
Normal file
@ -0,0 +1,439 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { Arguments } from 'yargs';
|
||||
import { ReportOptions } from 'istanbul-reports';
|
||||
export declare type Path = string;
|
||||
export declare type Glob = string;
|
||||
export declare type HasteConfig = {
|
||||
computeSha1?: boolean;
|
||||
defaultPlatform?: string | null | undefined;
|
||||
hasteImplModulePath?: string;
|
||||
platforms?: Array<string>;
|
||||
providesModuleNodeModules: Array<string>;
|
||||
throwOnModuleCollision?: boolean;
|
||||
};
|
||||
export declare type ReporterConfig = [string, Record<string, unknown>];
|
||||
export declare type TransformerConfig = [string, Record<string, unknown>];
|
||||
export declare type ConfigGlobals = Record<string, any>;
|
||||
export declare type DefaultOptions = {
|
||||
automock: boolean;
|
||||
bail: number;
|
||||
browser: boolean;
|
||||
cache: boolean;
|
||||
cacheDirectory: Path;
|
||||
changedFilesWithAncestor: boolean;
|
||||
clearMocks: boolean;
|
||||
collectCoverage: boolean;
|
||||
collectCoverageFrom: Array<string> | null | undefined;
|
||||
coverageDirectory: string | null | undefined;
|
||||
coveragePathIgnorePatterns: Array<string>;
|
||||
coverageReporters: Array<string>;
|
||||
coverageThreshold: {
|
||||
global: {
|
||||
[key: string]: number;
|
||||
};
|
||||
} | null | undefined;
|
||||
dependencyExtractor: string | null | undefined;
|
||||
errorOnDeprecated: boolean;
|
||||
expand: boolean;
|
||||
filter: Path | null | undefined;
|
||||
forceCoverageMatch: Array<Glob>;
|
||||
globals: ConfigGlobals;
|
||||
globalSetup: string | null | undefined;
|
||||
globalTeardown: string | null | undefined;
|
||||
haste: HasteConfig;
|
||||
maxWorkers: number | string;
|
||||
maxConcurrency: number;
|
||||
moduleDirectories: Array<string>;
|
||||
moduleFileExtensions: Array<string>;
|
||||
moduleNameMapper: {
|
||||
[key: string]: string;
|
||||
};
|
||||
modulePathIgnorePatterns: Array<string>;
|
||||
noStackTrace: boolean;
|
||||
notify: boolean;
|
||||
notifyMode: string;
|
||||
preset: string | null | undefined;
|
||||
prettierPath: string | null | undefined;
|
||||
projects: Array<string | ProjectConfig> | null | undefined;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
resolver: Path | null | undefined;
|
||||
restoreMocks: boolean;
|
||||
rootDir: Path | null | undefined;
|
||||
roots: Array<Path> | null | undefined;
|
||||
runner: string;
|
||||
runTestsByPath: boolean;
|
||||
setupFiles: Array<Path>;
|
||||
setupFilesAfterEnv: Array<Path>;
|
||||
skipFilter: boolean;
|
||||
snapshotSerializers: Array<Path>;
|
||||
testEnvironment: string;
|
||||
testEnvironmentOptions: Record<string, any>;
|
||||
testFailureExitCode: string | number;
|
||||
testLocationInResults: boolean;
|
||||
testMatch: Array<Glob>;
|
||||
testPathIgnorePatterns: Array<string>;
|
||||
testRegex: Array<string>;
|
||||
testResultsProcessor: string | null | undefined;
|
||||
testRunner: string | null | undefined;
|
||||
testSequencer: string;
|
||||
testURL: string;
|
||||
timers: 'real' | 'fake';
|
||||
transform: {
|
||||
[regex: string]: Path | TransformerConfig;
|
||||
} | null | undefined;
|
||||
transformIgnorePatterns: Array<Glob>;
|
||||
watchPathIgnorePatterns: Array<string>;
|
||||
useStderr: boolean;
|
||||
verbose: boolean | null | undefined;
|
||||
watch: boolean;
|
||||
watchman: boolean;
|
||||
};
|
||||
export declare type DisplayName = string | {
|
||||
name: string;
|
||||
color: DisplayNameColor;
|
||||
};
|
||||
export declare type InitialOptions = {
|
||||
automock?: boolean;
|
||||
bail?: boolean | number;
|
||||
browser?: boolean;
|
||||
cache?: boolean;
|
||||
cacheDirectory?: Path;
|
||||
clearMocks?: boolean;
|
||||
changedFilesWithAncestor?: boolean;
|
||||
changedSince?: string;
|
||||
collectCoverage?: boolean;
|
||||
collectCoverageFrom?: Array<Glob>;
|
||||
collectCoverageOnlyFrom?: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
coverageDirectory?: string;
|
||||
coveragePathIgnorePatterns?: Array<string>;
|
||||
coverageReporters?: Array<string>;
|
||||
coverageThreshold?: {
|
||||
global: {
|
||||
[key: string]: number;
|
||||
};
|
||||
};
|
||||
dependencyExtractor?: string;
|
||||
detectLeaks?: boolean;
|
||||
detectOpenHandles?: boolean;
|
||||
displayName?: DisplayName;
|
||||
expand?: boolean;
|
||||
extraGlobals?: Array<string>;
|
||||
filter?: Path;
|
||||
findRelatedTests?: boolean;
|
||||
forceCoverageMatch?: Array<Glob>;
|
||||
forceExit?: boolean;
|
||||
json?: boolean;
|
||||
globals?: ConfigGlobals;
|
||||
globalSetup?: string | null | undefined;
|
||||
globalTeardown?: string | null | undefined;
|
||||
haste?: HasteConfig;
|
||||
reporters?: Array<string | ReporterConfig>;
|
||||
logHeapUsage?: boolean;
|
||||
lastCommit?: boolean;
|
||||
listTests?: boolean;
|
||||
mapCoverage?: boolean;
|
||||
maxConcurrency?: number;
|
||||
maxWorkers: number | string;
|
||||
moduleDirectories?: Array<string>;
|
||||
moduleFileExtensions?: Array<string>;
|
||||
moduleLoader?: Path;
|
||||
moduleNameMapper?: {
|
||||
[key: string]: string;
|
||||
};
|
||||
modulePathIgnorePatterns?: Array<string>;
|
||||
modulePaths?: Array<string>;
|
||||
name?: string;
|
||||
noStackTrace?: boolean;
|
||||
notify?: boolean;
|
||||
notifyMode?: string;
|
||||
onlyChanged?: boolean;
|
||||
outputFile?: Path;
|
||||
passWithNoTests?: boolean;
|
||||
preprocessorIgnorePatterns?: Array<Glob>;
|
||||
preset?: string | null | undefined;
|
||||
prettierPath?: string | null | undefined;
|
||||
projects?: Array<Glob>;
|
||||
replname?: string | null | undefined;
|
||||
resetMocks?: boolean;
|
||||
resetModules?: boolean;
|
||||
resolver?: Path | null | undefined;
|
||||
restoreMocks?: boolean;
|
||||
rootDir: Path;
|
||||
roots?: Array<Path>;
|
||||
runner?: string;
|
||||
runTestsByPath?: boolean;
|
||||
scriptPreprocessor?: string;
|
||||
setupFiles?: Array<Path>;
|
||||
setupTestFrameworkScriptFile?: Path;
|
||||
setupFilesAfterEnv?: Array<Path>;
|
||||
silent?: boolean;
|
||||
skipFilter?: boolean;
|
||||
skipNodeResolution?: boolean;
|
||||
snapshotResolver?: Path;
|
||||
snapshotSerializers?: Array<Path>;
|
||||
errorOnDeprecated?: boolean;
|
||||
testEnvironment?: string;
|
||||
testEnvironmentOptions?: Record<string, any>;
|
||||
testFailureExitCode?: string | number;
|
||||
testLocationInResults?: boolean;
|
||||
testMatch?: Array<Glob>;
|
||||
testNamePattern?: string;
|
||||
testPathDirs?: Array<Path>;
|
||||
testPathIgnorePatterns?: Array<string>;
|
||||
testRegex?: string | Array<string>;
|
||||
testResultsProcessor?: string | null | undefined;
|
||||
testRunner?: string;
|
||||
testSequencer?: string;
|
||||
testURL?: string;
|
||||
testTimeout?: number;
|
||||
timers?: 'real' | 'fake';
|
||||
transform?: {
|
||||
[regex: string]: Path | TransformerConfig;
|
||||
};
|
||||
transformIgnorePatterns?: Array<Glob>;
|
||||
watchPathIgnorePatterns?: Array<string>;
|
||||
unmockedModulePathPatterns?: Array<string>;
|
||||
updateSnapshot?: boolean;
|
||||
useStderr?: boolean;
|
||||
verbose?: boolean | null | undefined;
|
||||
watch?: boolean;
|
||||
watchAll?: boolean;
|
||||
watchman?: boolean;
|
||||
watchPlugins?: Array<string | [string, Record<string, any>]>;
|
||||
};
|
||||
export declare type SnapshotUpdateState = 'all' | 'new' | 'none';
|
||||
declare type NotifyMode = 'always' | 'failure' | 'success' | 'change' | 'success-change' | 'failure-change';
|
||||
/**
|
||||
* Hard coding this until
|
||||
* https://github.com/chalk/chalk/pull/336
|
||||
* gets merged
|
||||
*/
|
||||
declare type DisplayNameColor = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray' | 'grey' | 'blackBright' | 'redBright' | 'greenBright' | 'yellowBright' | 'blueBright' | 'magentaBright' | 'cyanBright' | 'whiteBright' | 'bgBlack' | 'bgRed' | 'bgGreen' | 'bgYellow' | 'bgBlue' | 'bgMagenta' | 'bgCyan' | 'bgWhite' | 'bgBlackBright' | 'bgRedBright' | 'bgGreenBright' | 'bgYellowBright' | 'bgBlueBright' | 'bgMagentaBright' | 'bgCyanBright' | 'bgWhiteBright';
|
||||
declare type CoverageThreshold = {
|
||||
[path: string]: {
|
||||
[key: string]: number;
|
||||
};
|
||||
global: {
|
||||
[key: string]: number;
|
||||
};
|
||||
};
|
||||
export declare type GlobalConfig = {
|
||||
bail: number;
|
||||
changedSince: string;
|
||||
changedFilesWithAncestor: boolean;
|
||||
collectCoverage: boolean;
|
||||
collectCoverageFrom: Array<Glob>;
|
||||
collectCoverageOnlyFrom: {
|
||||
[key: string]: boolean;
|
||||
} | null | undefined;
|
||||
coverageDirectory: string;
|
||||
coveragePathIgnorePatterns?: Array<string>;
|
||||
coverageReporters: Array<keyof ReportOptions>;
|
||||
coverageThreshold: CoverageThreshold;
|
||||
detectLeaks: boolean;
|
||||
detectOpenHandles: boolean;
|
||||
enabledTestsMap: {
|
||||
[key: string]: {
|
||||
[key: string]: boolean;
|
||||
};
|
||||
} | null | undefined;
|
||||
expand: boolean;
|
||||
extraGlobals: Array<string>;
|
||||
filter: Path | null | undefined;
|
||||
findRelatedTests: boolean;
|
||||
forceExit: boolean;
|
||||
json: boolean;
|
||||
globalSetup: string | null | undefined;
|
||||
globalTeardown: string | null | undefined;
|
||||
lastCommit: boolean;
|
||||
logHeapUsage: boolean;
|
||||
listTests: boolean;
|
||||
maxConcurrency: number;
|
||||
maxWorkers: number;
|
||||
noStackTrace: boolean;
|
||||
nonFlagArgs: Array<string>;
|
||||
noSCM: boolean | null | undefined;
|
||||
notify: boolean;
|
||||
notifyMode: NotifyMode;
|
||||
outputFile: Path | null | undefined;
|
||||
onlyChanged: boolean;
|
||||
onlyFailures: boolean;
|
||||
passWithNoTests: boolean;
|
||||
projects: Array<Glob>;
|
||||
replname: string | null | undefined;
|
||||
reporters: Array<string | ReporterConfig>;
|
||||
runTestsByPath: boolean;
|
||||
rootDir: Path;
|
||||
silent: boolean;
|
||||
skipFilter: boolean;
|
||||
errorOnDeprecated: boolean;
|
||||
testFailureExitCode: number;
|
||||
testNamePattern: string;
|
||||
testPathPattern: string;
|
||||
testResultsProcessor: string | null | undefined;
|
||||
testSequencer: string;
|
||||
testTimeout: number;
|
||||
updateSnapshot: SnapshotUpdateState;
|
||||
useStderr: boolean;
|
||||
verbose: boolean | null | undefined;
|
||||
watch: boolean;
|
||||
watchAll: boolean;
|
||||
watchman: boolean;
|
||||
watchPlugins: Array<{
|
||||
path: string;
|
||||
config: Record<string, any>;
|
||||
}> | null | undefined;
|
||||
};
|
||||
export declare type ProjectConfig = {
|
||||
automock: boolean;
|
||||
browser: boolean;
|
||||
cache: boolean;
|
||||
cacheDirectory: Path;
|
||||
clearMocks: boolean;
|
||||
coveragePathIgnorePatterns: Array<string>;
|
||||
cwd: Path;
|
||||
dependencyExtractor?: string;
|
||||
detectLeaks: boolean;
|
||||
detectOpenHandles: boolean;
|
||||
displayName?: DisplayName;
|
||||
errorOnDeprecated: boolean;
|
||||
extraGlobals: Array<keyof NodeJS.Global>;
|
||||
filter: Path | null | undefined;
|
||||
forceCoverageMatch: Array<Glob>;
|
||||
globalSetup: string | null | undefined;
|
||||
globalTeardown: string | null | undefined;
|
||||
globals: ConfigGlobals;
|
||||
haste: HasteConfig;
|
||||
moduleDirectories: Array<string>;
|
||||
moduleFileExtensions: Array<string>;
|
||||
moduleLoader: Path;
|
||||
moduleNameMapper: Array<[string, string]>;
|
||||
modulePathIgnorePatterns: Array<string>;
|
||||
modulePaths: Array<string>;
|
||||
name: string;
|
||||
prettierPath: string;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
resolver: Path | null | undefined;
|
||||
restoreMocks: boolean;
|
||||
rootDir: Path;
|
||||
roots: Array<Path>;
|
||||
runner: string;
|
||||
setupFiles: Array<Path>;
|
||||
setupFilesAfterEnv: Array<Path>;
|
||||
skipFilter: boolean;
|
||||
skipNodeResolution: boolean;
|
||||
snapshotResolver: Path | null | undefined;
|
||||
snapshotSerializers: Array<Path>;
|
||||
testEnvironment: string;
|
||||
testEnvironmentOptions: Record<string, any>;
|
||||
testMatch: Array<Glob>;
|
||||
testLocationInResults: boolean;
|
||||
testPathIgnorePatterns: Array<string>;
|
||||
testRegex: Array<string>;
|
||||
testRunner: string;
|
||||
testURL: string;
|
||||
timers: 'real' | 'fake';
|
||||
transform: Array<[string, Path, Record<string, unknown>]>;
|
||||
transformIgnorePatterns: Array<Glob>;
|
||||
watchPathIgnorePatterns: Array<string>;
|
||||
unmockedModulePathPatterns: Array<string> | null | undefined;
|
||||
};
|
||||
export declare type Argv = Arguments<Partial<{
|
||||
all: boolean;
|
||||
automock: boolean;
|
||||
bail: boolean | number;
|
||||
browser: boolean;
|
||||
cache: boolean;
|
||||
cacheDirectory: string;
|
||||
changedFilesWithAncestor: boolean;
|
||||
changedSince: string;
|
||||
ci: boolean;
|
||||
clearCache: boolean;
|
||||
clearMocks: boolean;
|
||||
collectCoverage: boolean;
|
||||
collectCoverageFrom: string;
|
||||
collectCoverageOnlyFrom: Array<string>;
|
||||
color: boolean;
|
||||
colors: boolean;
|
||||
config: string;
|
||||
coverage: boolean;
|
||||
coverageDirectory: string;
|
||||
coveragePathIgnorePatterns: Array<string>;
|
||||
coverageReporters: Array<string>;
|
||||
coverageThreshold: string;
|
||||
debug: boolean;
|
||||
env: string;
|
||||
expand: boolean;
|
||||
findRelatedTests: boolean;
|
||||
forceExit: boolean;
|
||||
globals: string;
|
||||
globalSetup: string | null | undefined;
|
||||
globalTeardown: string | null | undefined;
|
||||
haste: string;
|
||||
init: boolean;
|
||||
json: boolean;
|
||||
lastCommit: boolean;
|
||||
logHeapUsage: boolean;
|
||||
maxWorkers: number | string;
|
||||
moduleDirectories: Array<string>;
|
||||
moduleFileExtensions: Array<string>;
|
||||
moduleNameMapper: string;
|
||||
modulePathIgnorePatterns: Array<string>;
|
||||
modulePaths: Array<string>;
|
||||
noStackTrace: boolean;
|
||||
notify: boolean;
|
||||
notifyMode: string;
|
||||
onlyChanged: boolean;
|
||||
outputFile: string;
|
||||
preset: string | null | undefined;
|
||||
projects: Array<string>;
|
||||
prettierPath: string | null | undefined;
|
||||
resetMocks: boolean;
|
||||
resetModules: boolean;
|
||||
resolver: string | null | undefined;
|
||||
restoreMocks: boolean;
|
||||
rootDir: string;
|
||||
roots: Array<string>;
|
||||
runInBand: boolean;
|
||||
setupFiles: Array<string>;
|
||||
setupFilesAfterEnv: Array<string>;
|
||||
showConfig: boolean;
|
||||
silent: boolean;
|
||||
snapshotSerializers: Array<string>;
|
||||
testEnvironment: string;
|
||||
testFailureExitCode: string | null | undefined;
|
||||
testMatch: Array<string>;
|
||||
testNamePattern: string;
|
||||
testPathIgnorePatterns: Array<string>;
|
||||
testPathPattern: Array<string>;
|
||||
testRegex: string | Array<string>;
|
||||
testResultsProcessor: string | null | undefined;
|
||||
testRunner: string;
|
||||
testSequencer: string;
|
||||
testURL: string;
|
||||
testTimeout: number | null | undefined;
|
||||
timers: string;
|
||||
transform: string;
|
||||
transformIgnorePatterns: Array<string>;
|
||||
unmockedModulePathPatterns: Array<string> | null | undefined;
|
||||
updateSnapshot: boolean;
|
||||
useStderr: boolean;
|
||||
verbose: boolean | null | undefined;
|
||||
version: boolean;
|
||||
watch: boolean;
|
||||
watchAll: boolean;
|
||||
watchman: boolean;
|
||||
watchPathIgnorePatterns: Array<string>;
|
||||
}>>;
|
||||
export {};
|
||||
//# sourceMappingURL=Config.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/types/build/Config.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/types/build/Config.d.ts.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/metro-core/node_modules/@jest/types/build/Config.js
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/types/build/Config.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
'use strict';
|
74
node_modules/metro-core/node_modules/@jest/types/build/Global.d.ts
generated
vendored
Normal file
74
node_modules/metro-core/node_modules/@jest/types/build/Global.d.ts
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { CoverageMapData } from 'istanbul-lib-coverage';
|
||||
export declare type DoneFn = (reason?: string | Error) => void;
|
||||
export declare type TestName = string;
|
||||
export declare type TestFn = (done?: DoneFn) => Promise<any> | void | undefined;
|
||||
export declare type BlockFn = () => void;
|
||||
export declare type BlockName = string;
|
||||
export declare type Col = unknown;
|
||||
export declare type Row = Array<Col>;
|
||||
export declare type Table = Array<Row>;
|
||||
export declare type ArrayTable = Table | Row;
|
||||
export declare type TemplateTable = TemplateStringsArray;
|
||||
export declare type TemplateData = Array<unknown>;
|
||||
export declare type EachTable = ArrayTable | TemplateTable;
|
||||
export declare type EachTestFn = (...args: Array<any>) => Promise<any> | void | undefined;
|
||||
declare type Jasmine = {
|
||||
_DEFAULT_TIMEOUT_INTERVAL?: number;
|
||||
addMatchers: Function;
|
||||
};
|
||||
declare type Each = (table: EachTable, ...taggedTemplateData: Array<unknown>) => (title: string, test: EachTestFn, timeout?: number) => void;
|
||||
export interface ItBase {
|
||||
(testName: TestName, fn: TestFn, timeout?: number): void;
|
||||
each: Each;
|
||||
}
|
||||
export interface It extends ItBase {
|
||||
only: ItBase;
|
||||
skip: ItBase;
|
||||
todo: (testName: TestName, ...rest: Array<any>) => void;
|
||||
}
|
||||
export interface ItConcurrentBase {
|
||||
(testName: string, testFn: () => Promise<any>, timeout?: number): void;
|
||||
}
|
||||
export interface ItConcurrentExtended extends ItConcurrentBase {
|
||||
only: ItConcurrentBase;
|
||||
skip: ItConcurrentBase;
|
||||
}
|
||||
export interface ItConcurrent extends It {
|
||||
concurrent: ItConcurrentExtended;
|
||||
}
|
||||
export interface DescribeBase {
|
||||
(blockName: BlockName, blockFn: BlockFn): void;
|
||||
each: Each;
|
||||
}
|
||||
export interface Describe extends DescribeBase {
|
||||
only: DescribeBase;
|
||||
skip: DescribeBase;
|
||||
}
|
||||
export interface Global extends NodeJS.Global {
|
||||
it: ItConcurrent;
|
||||
test: ItConcurrent;
|
||||
fit: ItBase & {
|
||||
concurrent?: ItConcurrentBase;
|
||||
};
|
||||
xit: ItBase;
|
||||
xtest: ItBase;
|
||||
describe: Describe;
|
||||
xdescribe: DescribeBase;
|
||||
fdescribe: DescribeBase;
|
||||
__coverage__: CoverageMapData;
|
||||
jasmine: Jasmine;
|
||||
fail: () => void;
|
||||
pending: () => void;
|
||||
spyOn: () => void;
|
||||
spyOnProperty: () => void;
|
||||
[extras: string]: any;
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=Global.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/types/build/Global.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/types/build/Global.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"Global.d.ts","sourceRoot":"","sources":["../src/Global.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAEtD,oBAAY,MAAM,GAAG,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,KAAK,KAAK,IAAI,CAAC;AACvD,oBAAY,QAAQ,GAAG,MAAM,CAAC;AAC9B,oBAAY,MAAM,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AACxE,oBAAY,OAAO,GAAG,MAAM,IAAI,CAAC;AACjC,oBAAY,SAAS,GAAG,MAAM,CAAC;AAE/B,oBAAY,GAAG,GAAG,OAAO,CAAC;AAC1B,oBAAY,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAC7B,oBAAY,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;AAC/B,oBAAY,UAAU,GAAG,KAAK,GAAG,GAAG,CAAC;AACrC,oBAAY,aAAa,GAAG,oBAAoB,CAAC;AACjD,oBAAY,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;AAC1C,oBAAY,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AACnD,oBAAY,UAAU,GAAG,CACvB,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAChB,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAGrC,aAAK,OAAO,GAAG;IAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,QAAQ,CAAA;CAAC,CAAC;AAE3E,aAAK,IAAI,GAAG,CACV,KAAK,EAAE,SAAS,EAChB,GAAG,kBAAkB,EAAE,KAAK,CAAC,OAAO,CAAC,KAClC,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;AAEjE,MAAM,WAAW,MAAM;IACrB,CAAC,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzD,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,EAAG,SAAQ,MAAM;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC;CACzD;AAED,MAAM,WAAW,gBAAgB;IAC/B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxE;AAED,MAAM,WAAW,oBAAqB,SAAQ,gBAAgB;IAC5D,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED,MAAM,WAAW,YAAa,SAAQ,EAAE;IACtC,UAAU,EAAE,oBAAoB,CAAC;CAClC;AAED,MAAM,WAAW,YAAY;IAC3B,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/C,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,QAAS,SAAQ,YAAY;IAC5C,IAAI,EAAE,YAAY,CAAC;IACnB,IAAI,EAAE,YAAY,CAAC;CACpB;AAGD,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM;IAC3C,EAAE,EAAE,YAAY,CAAC;IACjB,IAAI,EAAE,YAAY,CAAC;IACnB,GAAG,EAAE,MAAM,GAAG;QAAC,UAAU,CAAC,EAAE,gBAAgB,CAAA;KAAC,CAAC;IAC9C,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,YAAY,CAAC;IACxB,SAAS,EAAE,YAAY,CAAC;IACxB,YAAY,EAAE,eAAe,CAAC;IAC9B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC;CACvB"}
|
1
node_modules/metro-core/node_modules/@jest/types/build/Global.js
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/types/build/Global.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
'use strict';
|
11
node_modules/metro-core/node_modules/@jest/types/build/index.d.ts
generated
vendored
Normal file
11
node_modules/metro-core/node_modules/@jest/types/build/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import * as Circus from './Circus';
|
||||
import * as Config from './Config';
|
||||
import * as Global from './Global';
|
||||
export { Circus, Config, Global };
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
node_modules/metro-core/node_modules/@jest/types/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/metro-core/node_modules/@jest/types/build/index.d.ts.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAEnC,OAAO,EAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAC,CAAC"}
|
43
node_modules/metro-core/node_modules/@jest/types/build/index.js
generated
vendored
Normal file
43
node_modules/metro-core/node_modules/@jest/types/build/index.js
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.Global = exports.Config = exports.Circus = void 0;
|
||||
|
||||
var Circus = _interopRequireWildcard(require('./Circus'));
|
||||
|
||||
exports.Circus = Circus;
|
||||
|
||||
var Config = _interopRequireWildcard(require('./Config'));
|
||||
|
||||
exports.Config = Config;
|
||||
|
||||
var Global = _interopRequireWildcard(require('./Global'));
|
||||
|
||||
exports.Global = Global;
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
} else {
|
||||
var newObj = {};
|
||||
if (obj != null) {
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: {};
|
||||
if (desc.get || desc.set) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
return newObj;
|
||||
}
|
||||
}
|
24
node_modules/metro-core/node_modules/@jest/types/package.json
generated
vendored
Normal file
24
node_modules/metro-core/node_modules/@jest/types/package.json
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@jest/types",
|
||||
"version": "24.9.0",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-types"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"dependencies": {
|
||||
"@types/istanbul-lib-coverage": "^2.0.0",
|
||||
"@types/istanbul-reports": "^1.1.1",
|
||||
"@types/yargs": "^13.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "9ad0f4bc6b8bdd94989804226c28c9960d9da7d1"
|
||||
}
|
21
node_modules/metro-core/node_modules/@types/yargs/LICENSE
generated
vendored
Normal file
21
node_modules/metro-core/node_modules/@types/yargs/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
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
|
16
node_modules/metro-core/node_modules/@types/yargs/README.md
generated
vendored
Normal file
16
node_modules/metro-core/node_modules/@types/yargs/README.md
generated
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
# Installation
|
||||
> `npm install --save @types/yargs`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for yargs (https://github.com/chevex/yargs).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs/v13.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Wed, 23 Sep 2020 19:15:29 GMT
|
||||
* Dependencies: [@types/yargs-parser](https://npmjs.com/package/@types/yargs-parser)
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Martin Poelstra](https://github.com/poelstra), [Mizunashi Mana](https://github.com/mizunashi-mana), [Jeffery Grajkowski](https://github.com/pushplay), [Jimi (Dimitris) Charalampidis](https://github.com/JimiC), [Steffen Viken Valvåg](https://github.com/steffenvv), [Emily Marigold Klassen](https://github.com/forivall), and [ExE Boss](https://github.com/ExE-Boss).
|
777
node_modules/metro-core/node_modules/@types/yargs/index.d.ts
generated
vendored
Normal file
777
node_modules/metro-core/node_modules/@types/yargs/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,777 @@
|
||||
// Type definitions for yargs 13.0
|
||||
// Project: https://github.com/chevex/yargs, https://yargs.js.org
|
||||
// Definitions by: Martin Poelstra <https://github.com/poelstra>
|
||||
// Mizunashi Mana <https://github.com/mizunashi-mana>
|
||||
// Jeffery Grajkowski <https://github.com/pushplay>
|
||||
// Jimi (Dimitris) Charalampidis <https://github.com/JimiC>
|
||||
// Steffen Viken Valvåg <https://github.com/steffenvv>
|
||||
// Emily Marigold Klassen <https://github.com/forivall>
|
||||
// ExE Boss <https://github.com/ExE-Boss>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
// The following TSLint rules have been disabled:
|
||||
// unified-signatures: Because there is useful information in the argument names of the overloaded signatures
|
||||
|
||||
// Convention:
|
||||
// Use 'union types' when:
|
||||
// - parameter types have similar signature type (i.e. 'string | ReadonlyArray<string>')
|
||||
// - parameter names have the same semantic meaning (i.e. ['command', 'commands'] , ['key', 'keys'])
|
||||
// An example for not using 'union types' is the declaration of 'env' where `prefix` and `enable` parameters
|
||||
// have different semantics. On the other hand, in the declaration of 'usage', a `command: string` parameter
|
||||
// has the same semantic meaning with declaring an overload method by using `commands: ReadonlyArray<string>`,
|
||||
// thus it's preferred to use `command: string | ReadonlyArray<string>`
|
||||
// Use parameterless declaration instead of declaring all parameters optional,
|
||||
// when all parameters are optional and more than one
|
||||
|
||||
import { DetailedArguments, Configuration } from 'yargs-parser';
|
||||
|
||||
declare namespace yargs {
|
||||
type BuilderCallback<T, R> = ((args: Argv<T>) => Argv<R>) | ((args: Argv<T>) => void);
|
||||
|
||||
type ParserConfigurationOptions = Configuration & {
|
||||
/** Sort commands alphabetically. Default is `false` */
|
||||
'sort-commands': boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* The type parameter `T` is the expected shape of the parsed options.
|
||||
* `Arguments<T>` is those options plus `_` and `$0`, and an indexer falling
|
||||
* back to `unknown` for unknown options.
|
||||
*
|
||||
* For the return type / `argv` property, we create a mapped type over
|
||||
* `Arguments<T>` to simplify the inferred type signature in client code.
|
||||
*/
|
||||
interface Argv<T = {}> {
|
||||
(): { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
(args: ReadonlyArray<string>, cwd?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Set key names as equivalent such that updates to a key will propagate to aliases and vice-versa.
|
||||
*
|
||||
* Optionally `.alias()` can take an object that maps keys to aliases.
|
||||
* Each key of this object should be the canonical version of the option, and each value should be a string or an array of strings.
|
||||
*/
|
||||
// Aliases for previously declared options can inherit the types of those options.
|
||||
alias<K1 extends keyof T, K2 extends string>(shortName: K1, longName: K2 | ReadonlyArray<K2>): Argv<T & { [key in K2]: T[K1] }>;
|
||||
alias<K1 extends keyof T, K2 extends string>(shortName: K2, longName: K1 | ReadonlyArray<K1>): Argv<T & { [key in K2]: T[K1] }>;
|
||||
alias(shortName: string | ReadonlyArray<string>, longName: string | ReadonlyArray<string>): Argv<T>;
|
||||
alias(aliases: { [shortName: string]: string | ReadonlyArray<string> }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Get the arguments as a plain old object.
|
||||
*
|
||||
* Arguments without a corresponding flag show up in the `argv._` array.
|
||||
*
|
||||
* The script name or node command is available at `argv.$0` similarly to how `$0` works in bash or perl.
|
||||
*
|
||||
* If `yargs` is executed in an environment that embeds node and there's no script name (e.g. Electron or nw.js),
|
||||
* it will ignore the first parameter since it expects it to be the script name. In order to override
|
||||
* this behavior, use `.parse(process.argv.slice(1))` instead of .argv and the first parameter won't be ignored.
|
||||
*/
|
||||
argv: { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
|
||||
/**
|
||||
* Tell the parser to interpret `key` as an array.
|
||||
* If `.array('foo')` is set, `--foo foo bar` will be parsed as `['foo', 'bar']` rather than as `'foo'`.
|
||||
* Also, if you use the option multiple times all the values will be flattened in one array so `--foo foo --foo bar` will be parsed as `['foo', 'bar']`
|
||||
*
|
||||
* When the option is used with a positional, use `--` to tell `yargs` to stop adding values to the array.
|
||||
*/
|
||||
array<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToArray<T[key]> }>;
|
||||
array<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: Array<string | number> | undefined }>;
|
||||
|
||||
/**
|
||||
* Interpret `key` as a boolean. If a non-flag option follows `key` in `process.argv`, that string won't get set as the value of `key`.
|
||||
*
|
||||
* `key` will default to `false`, unless a `default(key, undefined)` is explicitly set.
|
||||
*
|
||||
* If `key` is an array, interpret all the elements as booleans.
|
||||
*/
|
||||
boolean<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: boolean | undefined }>;
|
||||
boolean<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: boolean | undefined }>;
|
||||
|
||||
/**
|
||||
* Check that certain conditions are met in the provided arguments.
|
||||
* @param func Called with two arguments, the parsed `argv` hash and an array of options and their aliases.
|
||||
* If `func` throws or returns a non-truthy value, show the thrown error, usage information, and exit.
|
||||
* @param global Indicates whether `check()` should be enabled both at the top-level and for each sub-command.
|
||||
*/
|
||||
check(func: (argv: Arguments<T>, aliases: { [alias: string]: string }) => any, global?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Limit valid values for key to a predefined set of choices, given as an array or as an individual value.
|
||||
* If this method is called multiple times, all enumerated values will be merged together.
|
||||
* Choices are generally strings or numbers, and value matching is case-sensitive.
|
||||
*
|
||||
* Optionally `.choices()` can take an object that maps multiple keys to their choices.
|
||||
*
|
||||
* Choices can also be specified as choices in the object given to `option()`.
|
||||
*/
|
||||
choices<K extends keyof T, C extends ReadonlyArray<any>>(key: K, values: C): Argv<Omit<T, K> & { [key in K]: C[number] | undefined }>;
|
||||
choices<K extends string, C extends ReadonlyArray<any>>(key: K, values: C): Argv<T & { [key in K]: C[number] | undefined }>;
|
||||
choices<C extends { [key: string]: ReadonlyArray<any> }>(choices: C): Argv<Omit<T, keyof C> & { [key in keyof C]: C[key][number] | undefined }>;
|
||||
|
||||
/**
|
||||
* Provide a synchronous function to coerce or transform the value(s) given on the command line for `key`.
|
||||
*
|
||||
* The coercion function should accept one argument, representing the parsed value from the command line, and should return a new value or throw an error.
|
||||
* The returned value will be used as the value for `key` (or one of its aliases) in `argv`.
|
||||
*
|
||||
* If the function throws, the error will be treated as a validation failure, delegating to either a custom `.fail()` handler or printing the error message in the console.
|
||||
*
|
||||
* Coercion will be applied to a value after all other modifications, such as `.normalize()`.
|
||||
*
|
||||
* Optionally `.coerce()` can take an object that maps several keys to their respective coercion function.
|
||||
*
|
||||
* You can also map the same function to several keys at one time. Just pass an array of keys as the first argument to `.coerce()`.
|
||||
*
|
||||
* If you are using dot-notion or arrays, .e.g., `user.email` and `user.password`, coercion will be applied to the final object that has been parsed
|
||||
*/
|
||||
coerce<K extends keyof T, V>(key: K | ReadonlyArray<K>, func: (arg: any) => V): Argv<Omit<T, K> & { [key in K]: V | undefined }>;
|
||||
coerce<K extends string, V>(key: K | ReadonlyArray<K>, func: (arg: any) => V): Argv<T & { [key in K]: V | undefined }>;
|
||||
coerce<O extends { [key: string]: (arg: any) => any }>(opts: O): Argv<Omit<T, keyof O> & { [key in keyof O]: ReturnType<O[key]> | undefined }>;
|
||||
|
||||
/**
|
||||
* Define the commands exposed by your application.
|
||||
* @param command Should be a string representing the command or an array of strings representing the command and its aliases.
|
||||
* @param description Use to provide a description for each command your application accepts (the values stored in `argv._`).
|
||||
* Set `description` to false to create a hidden command. Hidden commands don't show up in the help output and aren't available for completion.
|
||||
* @param [builder] Object to give hints about the options that your command accepts.
|
||||
* Can also be a function. This function is executed with a yargs instance, and can be used to provide advanced command specific help.
|
||||
*
|
||||
* Note that when `void` is returned, the handler `argv` object type will not include command-specific arguments.
|
||||
* @param [handler] Function, which will be executed with the parsed `argv` object.
|
||||
*/
|
||||
command<U = T>(command: string | ReadonlyArray<string>, description: string, builder?: BuilderCallback<T, U>, handler?: (args: Arguments<U>) => void): Argv<T>;
|
||||
command<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, description: string, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
|
||||
command<U>(command: string | ReadonlyArray<string>, description: string, module: CommandModule<T, U>): Argv<U>;
|
||||
command<U = T>(command: string | ReadonlyArray<string>, showInHelp: false, builder?: BuilderCallback<T, U>, handler?: (args: Arguments<U>) => void): Argv<T>;
|
||||
command<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, showInHelp: false, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
|
||||
command<U>(command: string | ReadonlyArray<string>, showInHelp: false, module: CommandModule<T, U>): Argv<U>;
|
||||
command<U>(module: CommandModule<T, U>): Argv<U>;
|
||||
|
||||
// Advanced API
|
||||
/** Apply command modules from a directory relative to the module calling this method. */
|
||||
commandDir(dir: string, opts?: RequireDirectoryOptions): Argv<T>;
|
||||
|
||||
/**
|
||||
* Enable bash/zsh-completion shortcuts for commands and options.
|
||||
*
|
||||
* If invoked without parameters, `.completion()` will make completion the command to output the completion script.
|
||||
*
|
||||
* @param [cmd] When present in `argv._`, will result in the `.bashrc` or `.zshrc` completion script being outputted.
|
||||
* To enable bash/zsh completions, concat the generated script to your `.bashrc` or `.bash_profile` (or `.zshrc` for zsh).
|
||||
* @param [description] Provide a description in your usage instructions for the command that generates the completion scripts.
|
||||
* @param [func] Rather than relying on yargs' default completion functionality, which shiver me timbers is pretty awesome, you can provide your own completion method.
|
||||
*/
|
||||
completion(): Argv<T>;
|
||||
completion(cmd: string, func?: AsyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, func?: SyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, func?: PromiseCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, description?: string | false, func?: AsyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, description?: string | false, func?: SyncCompletionFunction): Argv<T>;
|
||||
completion(cmd: string, description?: string | false, func?: PromiseCompletionFunction): Argv<T>;
|
||||
|
||||
/**
|
||||
* Tells the parser that if the option specified by `key` is passed in, it should be interpreted as a path to a JSON config file.
|
||||
* The file is loaded and parsed, and its properties are set as arguments.
|
||||
* Because the file is loaded using Node's require(), the filename MUST end in `.json` to be interpreted correctly.
|
||||
*
|
||||
* If invoked without parameters, `.config()` will make --config the option to pass the JSON config file.
|
||||
*
|
||||
* @param [description] Provided to customize the config (`key`) option in the usage string.
|
||||
* @param [explicitConfigurationObject] An explicit configuration `object`
|
||||
*/
|
||||
config(): Argv<T>;
|
||||
config(key: string | ReadonlyArray<string>, description?: string, parseFn?: (configPath: string) => object): Argv<T>;
|
||||
config(key: string | ReadonlyArray<string>, parseFn: (configPath: string) => object): Argv<T>;
|
||||
config(explicitConfigurationObject: object): Argv<T>;
|
||||
|
||||
/**
|
||||
* Given the key `x` is set, the key `y` must not be set. `y` can either be a single string or an array of argument names that `x` conflicts with.
|
||||
*
|
||||
* Optionally `.conflicts()` can accept an object specifying multiple conflicting keys.
|
||||
*/
|
||||
conflicts(key: string, value: string | ReadonlyArray<string>): Argv<T>;
|
||||
conflicts(conflicts: { [key: string]: string | ReadonlyArray<string> }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Interpret `key` as a boolean flag, but set its parsed value to the number of flag occurrences rather than `true` or `false`. Default value is thus `0`.
|
||||
*/
|
||||
count<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: number }>;
|
||||
count<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: number }>;
|
||||
|
||||
/**
|
||||
* Set `argv[key]` to `value` if no option was specified in `process.argv`.
|
||||
*
|
||||
* Optionally `.default()` can take an object that maps keys to default values.
|
||||
*
|
||||
* The default value can be a `function` which returns a value. The name of the function will be used in the usage string.
|
||||
*
|
||||
* Optionally, `description` can also be provided and will take precedence over displaying the value in the usage instructions.
|
||||
*/
|
||||
default<K extends keyof T, V>(key: K, value: V, description?: string): Argv<Omit<T, K> & { [key in K]: V }>;
|
||||
default<K extends string, V>(key: K, value: V, description?: string): Argv<T & { [key in K]: V }>;
|
||||
default<D extends { [key: string]: any }>(defaults: D, description?: string): Argv<Omit<T, keyof D> & D>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.demandCommand()' or '.demandOption()' instead
|
||||
*/
|
||||
demand<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
demand<K extends string>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<T & { [key in K]: unknown }>;
|
||||
demand(key: string | ReadonlyArray<string>, required?: boolean): Argv<T>;
|
||||
demand(positionals: number, msg: string): Argv<T>;
|
||||
demand(positionals: number, required?: boolean): Argv<T>;
|
||||
demand(positionals: number, max: number, msg?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* @param key If is a string, show the usage information and exit if key wasn't specified in `process.argv`.
|
||||
* If is an array, demand each element.
|
||||
* @param msg If string is given, it will be printed when the argument is missing, instead of the standard error message.
|
||||
* @param demand Controls whether the option is demanded; this is useful when using .options() to specify command line parameters.
|
||||
*/
|
||||
demandOption<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
demandOption<K extends string>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<T & { [key in K]: unknown }>;
|
||||
demandOption(key: string | ReadonlyArray<string>, demand?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Demand in context of commands.
|
||||
* You can demand a minimum and a maximum number a user can have within your program, as well as provide corresponding error messages if either of the demands is not met.
|
||||
*/
|
||||
demandCommand(): Argv<T>;
|
||||
demandCommand(min: number, minMsg?: string): Argv<T>;
|
||||
demandCommand(min: number, max?: number, minMsg?: string, maxMsg?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Describe a `key` for the generated usage information.
|
||||
*
|
||||
* Optionally `.describe()` can take an object that maps keys to descriptions.
|
||||
*/
|
||||
describe(key: string | ReadonlyArray<string>, description: string): Argv<T>;
|
||||
describe(descriptions: { [key: string]: string }): Argv<T>;
|
||||
|
||||
/** Should yargs attempt to detect the os' locale? Defaults to `true`. */
|
||||
detectLocale(detect: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Tell yargs to parse environment variables matching the given prefix and apply them to argv as though they were command line arguments.
|
||||
*
|
||||
* Use the "__" separator in the environment variable to indicate nested options. (e.g. prefix_nested__foo => nested.foo)
|
||||
*
|
||||
* If this method is called with no argument or with an empty string or with true, then all env vars will be applied to argv.
|
||||
*
|
||||
* Program arguments are defined in this order of precedence:
|
||||
* 1. Command line args
|
||||
* 2. Env vars
|
||||
* 3. Config file/objects
|
||||
* 4. Configured defaults
|
||||
*
|
||||
* Env var parsing is disabled by default, but you can also explicitly disable it by calling `.env(false)`, e.g. if you need to undo previous configuration.
|
||||
*/
|
||||
env(): Argv<T>;
|
||||
env(prefix: string): Argv<T>;
|
||||
env(enable: boolean): Argv<T>;
|
||||
|
||||
/** A message to print at the end of the usage instructions */
|
||||
epilog(msg: string): Argv<T>;
|
||||
/** A message to print at the end of the usage instructions */
|
||||
epilogue(msg: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Give some example invocations of your program.
|
||||
* Inside `cmd`, the string `$0` will get interpolated to the current script name or node command for the present script similar to how `$0` works in bash or perl.
|
||||
* Examples will be printed out as part of the help message.
|
||||
*/
|
||||
example(command: string, description: string): Argv<T>;
|
||||
|
||||
/** Manually indicate that the program should exit, and provide context about why we wanted to exit. Follows the behavior set by `.exitProcess().` */
|
||||
exit(code: number, err: Error): void;
|
||||
|
||||
/**
|
||||
* By default, yargs exits the process when the user passes a help flag, the user uses the `.version` functionality, validation fails, or the command handler fails.
|
||||
* Calling `.exitProcess(false)` disables this behavior, enabling further actions after yargs have been validated.
|
||||
*/
|
||||
exitProcess(enabled: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Method to execute when a failure occurs, rather than printing the failure message.
|
||||
* @param func Is called with the failure message that would have been printed, the Error instance originally thrown and yargs state when the failure occurred.
|
||||
*/
|
||||
fail(func: (msg: string, err: Error, yargs: Argv<T>) => any): Argv<T>;
|
||||
|
||||
/**
|
||||
* Allows to programmatically get completion choices for any line.
|
||||
* @param args An array of the words in the command line to complete.
|
||||
* @param done The callback to be called with the resulting completions.
|
||||
*/
|
||||
getCompletion(args: ReadonlyArray<string>, done: (completions: ReadonlyArray<string>) => void): Argv<T>;
|
||||
|
||||
/**
|
||||
* Indicate that an option (or group of options) should not be reset when a command is executed
|
||||
*
|
||||
* Options default to being global.
|
||||
*/
|
||||
global(key: string | ReadonlyArray<string>): Argv<T>;
|
||||
|
||||
/** Given a key, or an array of keys, places options under an alternative heading when displaying usage instructions */
|
||||
group(key: string | ReadonlyArray<string>, groupName: string): Argv<T>;
|
||||
|
||||
/** Hides a key from the generated usage information. Unless a `--show-hidden` option is also passed with `--help` (see `showHidden()`). */
|
||||
hide(key: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Configure an (e.g. `--help`) and implicit command that displays the usage string and exits the process.
|
||||
* By default yargs enables help on the `--help` option.
|
||||
*
|
||||
* Note that any multi-char aliases (e.g. `help`) used for the help option will also be used for the implicit command.
|
||||
* If there are no multi-char aliases (e.g. `h`), then all single-char aliases will be used for the command.
|
||||
*
|
||||
* If invoked without parameters, `.help()` will use `--help` as the option and help as the implicit command to trigger help output.
|
||||
*
|
||||
* @param [description] Customizes the description of the help option in the usage string.
|
||||
* @param [enableExplicit] If `false` is provided, it will disable --help.
|
||||
*/
|
||||
help(): Argv<T>;
|
||||
help(enableExplicit: boolean): Argv<T>;
|
||||
help(option: string, enableExplicit: boolean): Argv<T>;
|
||||
help(option: string, description?: string, enableExplicit?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Given the key `x` is set, it is required that the key `y` is set.
|
||||
* y` can either be the name of an argument to imply, a number indicating the position of an argument or an array of multiple implications to associate with `x`.
|
||||
*
|
||||
* Optionally `.implies()` can accept an object specifying multiple implications.
|
||||
*/
|
||||
implies(key: string, value: string | ReadonlyArray<string>): Argv<T>;
|
||||
implies(implies: { [key: string]: string | ReadonlyArray<string> }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Return the locale that yargs is currently using.
|
||||
*
|
||||
* By default, yargs will auto-detect the operating system's locale so that yargs-generated help content will display in the user's language.
|
||||
*/
|
||||
locale(): string;
|
||||
/**
|
||||
* Override the auto-detected locale from the user's operating system with a static locale.
|
||||
* Note that the OS locale can be modified by setting/exporting the `LC_ALL` environment variable.
|
||||
*/
|
||||
locale(loc: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Define global middleware functions to be called first, in list order, for all cli command.
|
||||
* @param callbacks Can be a function or a list of functions. Each callback gets passed a reference to argv.
|
||||
* @param [applyBeforeValidation] Set to `true` to apply middleware before validation. This will execute the middleware prior to validation checks, but after parsing.
|
||||
*/
|
||||
middleware(callbacks: MiddlewareFunction<T> | ReadonlyArray<MiddlewareFunction<T>>, applyBeforeValidation?: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* The number of arguments that should be consumed after a key. This can be a useful hint to prevent parsing ambiguity.
|
||||
*
|
||||
* Optionally `.nargs()` can take an object of `key`/`narg` pairs.
|
||||
*/
|
||||
nargs(key: string, count: number): Argv<T>;
|
||||
nargs(nargs: { [key: string]: number }): Argv<T>;
|
||||
|
||||
/** The key provided represents a path and should have `path.normalize()` applied. */
|
||||
normalize<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>;
|
||||
normalize<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: string | undefined }>;
|
||||
|
||||
/**
|
||||
* Tell the parser to always interpret key as a number.
|
||||
*
|
||||
* If `key` is an array, all elements will be parsed as numbers.
|
||||
*
|
||||
* If the option is given on the command line without a value, `argv` will be populated with `undefined`.
|
||||
*
|
||||
* If the value given on the command line cannot be parsed as a number, `argv` will be populated with `NaN`.
|
||||
*
|
||||
* Note that decimals, hexadecimals, and scientific notation are all accepted.
|
||||
*/
|
||||
number<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToNumber<T[key]> }>;
|
||||
number<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: number | undefined }>;
|
||||
|
||||
/**
|
||||
* This method can be used to make yargs aware of options that could exist.
|
||||
* You can also pass an opt object which can hold further customization, like `.alias()`, `.demandOption()` etc. for that option.
|
||||
*/
|
||||
option<K extends keyof T, O extends Options>(key: K, options: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
|
||||
option<K extends string, O extends Options>(key: K, options: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
|
||||
option<O extends { [key: string]: Options }>(options: O): Argv<Omit<T, keyof O> & InferredOptionTypes<O>>;
|
||||
|
||||
/**
|
||||
* This method can be used to make yargs aware of options that could exist.
|
||||
* You can also pass an opt object which can hold further customization, like `.alias()`, `.demandOption()` etc. for that option.
|
||||
*/
|
||||
options<K extends keyof T, O extends Options>(key: K, options: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
|
||||
options<K extends string, O extends Options>(key: K, options: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
|
||||
options<O extends { [key: string]: Options }>(options: O): Argv<Omit<T, keyof O> & InferredOptionTypes<O>>;
|
||||
|
||||
/**
|
||||
* Parse `args` instead of `process.argv`. Returns the `argv` object. `args` may either be a pre-processed argv array, or a raw argument string.
|
||||
*
|
||||
* Note: Providing a callback to parse() disables the `exitProcess` setting until after the callback is invoked.
|
||||
* @param [context] Provides a useful mechanism for passing state information to commands
|
||||
*/
|
||||
parse(arg?: string | ReadonlyArray<string>): { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
parse(arg: string | ReadonlyArray<string>, parseCallback: ParseCallback<T>): { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
parse(arg: string | ReadonlyArray<string>, context: object, parseCallback?: ParseCallback<T>): { [key in keyof Arguments<T>]: Arguments<T>[key] };
|
||||
|
||||
/**
|
||||
* If the arguments have not been parsed, this property is `false`.
|
||||
*
|
||||
* If the arguments have been parsed, this contain detailed parsed arguments.
|
||||
*/
|
||||
parsed: DetailedArguments | false;
|
||||
|
||||
/** Allows to configure advanced yargs features. */
|
||||
parserConfiguration(configuration: Partial<ParserConfigurationOptions>): Argv<T>;
|
||||
|
||||
/**
|
||||
* Similar to `config()`, indicates that yargs should interpret the object from the specified key in package.json as a configuration object.
|
||||
* @param [cwd] If provided, the package.json will be read from this location
|
||||
*/
|
||||
pkgConf(key: string | ReadonlyArray<string>, cwd?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Allows you to configure a command's positional arguments with an API similar to `.option()`.
|
||||
* `.positional()` should be called in a command's builder function, and is not available on the top-level yargs instance. If so, it will throw an error.
|
||||
*/
|
||||
positional<K extends keyof T, O extends PositionalOptions>(key: K, opt: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
|
||||
positional<K extends string, O extends PositionalOptions>(key: K, opt: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
|
||||
|
||||
/** Should yargs provide suggestions regarding similar commands if no matching command is found? */
|
||||
recommendCommands(): Argv<T>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.demandCommand()' or '.demandOption()' instead
|
||||
*/
|
||||
require<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
require(key: string, msg: string): Argv<T>;
|
||||
require(key: string, required: boolean): Argv<T>;
|
||||
require(keys: ReadonlyArray<number>, msg: string): Argv<T>;
|
||||
require(keys: ReadonlyArray<number>, required: boolean): Argv<T>;
|
||||
require(positionals: number, required: boolean): Argv<T>;
|
||||
require(positionals: number, msg: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.demandCommand()' or '.demandOption()' instead
|
||||
*/
|
||||
required<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
|
||||
required(key: string, msg: string): Argv<T>;
|
||||
required(key: string, required: boolean): Argv<T>;
|
||||
required(keys: ReadonlyArray<number>, msg: string): Argv<T>;
|
||||
required(keys: ReadonlyArray<number>, required: boolean): Argv<T>;
|
||||
required(positionals: number, required: boolean): Argv<T>;
|
||||
required(positionals: number, msg: string): Argv<T>;
|
||||
|
||||
requiresArg(key: string | ReadonlyArray<string>): Argv<T>;
|
||||
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use '.global()' instead
|
||||
*/
|
||||
reset(): Argv<T>;
|
||||
|
||||
/** Set the name of your script ($0). Default is the base filename executed by node (`process.argv[1]`) */
|
||||
scriptName($0: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Generate a bash completion script.
|
||||
* Users of your application can install this script in their `.bashrc`, and yargs will provide completion shortcuts for commands and options.
|
||||
*/
|
||||
showCompletionScript(): Argv<T>;
|
||||
|
||||
/**
|
||||
* Configure the `--show-hidden` option that displays the hidden keys (see `hide()`).
|
||||
* @param option If `boolean`, it enables/disables this option altogether. i.e. hidden keys will be permanently hidden if first argument is `false`.
|
||||
* If `string` it changes the key name ("--show-hidden").
|
||||
* @param description Changes the default description ("Show hidden options")
|
||||
*/
|
||||
showHidden(option?: string | boolean): Argv<T>;
|
||||
showHidden(option: string, description?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Print the usage data using the console function consoleLevel for printing.
|
||||
* @param [consoleLevel='error']
|
||||
*/
|
||||
showHelp(consoleLevel?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* By default, yargs outputs a usage string if any error is detected.
|
||||
* Use the `.showHelpOnFail()` method to customize this behavior.
|
||||
* @param enable If `false`, the usage string is not output.
|
||||
* @param [message] Message that is output after the error message.
|
||||
*/
|
||||
showHelpOnFail(enable: boolean, message?: string): Argv<T>;
|
||||
|
||||
/** Specifies either a single option key (string), or an array of options. If any of the options is present, yargs validation is skipped. */
|
||||
skipValidation(key: string | ReadonlyArray<string>): Argv<T>;
|
||||
|
||||
/**
|
||||
* Any command-line argument given that is not demanded, or does not have a corresponding description, will be reported as an error.
|
||||
*
|
||||
* Unrecognized commands will also be reported as errors.
|
||||
*/
|
||||
strict(): Argv<T>;
|
||||
strict(enabled: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Tell the parser logic not to interpret `key` as a number or boolean. This can be useful if you need to preserve leading zeros in an input.
|
||||
*
|
||||
* If `key` is an array, interpret all the elements as strings.
|
||||
*
|
||||
* `.string('_')` will result in non-hyphenated arguments being interpreted as strings, regardless of whether they resemble numbers.
|
||||
*/
|
||||
string<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>;
|
||||
string<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: string | undefined }>;
|
||||
|
||||
// Intended to be used with '.wrap()'
|
||||
terminalWidth(): number;
|
||||
|
||||
updateLocale(obj: { [key: string]: string }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Override the default strings used by yargs with the key/value pairs provided in obj
|
||||
*
|
||||
* If you explicitly specify a locale(), you should do so before calling `updateStrings()`.
|
||||
*/
|
||||
updateStrings(obj: { [key: string]: string }): Argv<T>;
|
||||
|
||||
/**
|
||||
* Set a usage message to show which commands to use.
|
||||
* Inside `message`, the string `$0` will get interpolated to the current script name or node command for the present script similar to how `$0` works in bash or perl.
|
||||
*
|
||||
* If the optional `description`/`builder`/`handler` are provided, `.usage()` acts an an alias for `.command()`.
|
||||
* This allows you to use `.usage()` to configure the default command that will be run as an entry-point to your application
|
||||
* and allows you to provide configuration for the positional arguments accepted by your program:
|
||||
*/
|
||||
usage(message: string): Argv<T>;
|
||||
usage<U>(command: string | ReadonlyArray<string>, description: string, builder?: (args: Argv<T>) => Argv<U>, handler?: (args: Arguments<U>) => void): Argv<T>;
|
||||
usage<U>(command: string | ReadonlyArray<string>, showInHelp: boolean, builder?: (args: Argv<T>) => Argv<U>, handler?: (args: Arguments<U>) => void): Argv<T>;
|
||||
usage<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, description: string, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
|
||||
usage<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, showInHelp: boolean, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
|
||||
|
||||
/**
|
||||
* Add an option (e.g. `--version`) that displays the version number (given by the version parameter) and exits the process.
|
||||
* By default yargs enables version for the `--version` option.
|
||||
*
|
||||
* If no arguments are passed to version (`.version()`), yargs will parse the package.json of your module and use its version value.
|
||||
*
|
||||
* If the boolean argument `false` is provided, it will disable `--version`.
|
||||
*/
|
||||
version(): Argv<T>;
|
||||
version(version: string): Argv<T>;
|
||||
version(enable: boolean): Argv<T>;
|
||||
version(optionKey: string, version: string): Argv<T>;
|
||||
version(optionKey: string, description: string, version: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Format usage output to wrap at columns many columns.
|
||||
*
|
||||
* By default wrap will be set to `Math.min(80, windowWidth)`. Use `.wrap(null)` to specify no column limit (no right-align).
|
||||
* Use `.wrap(yargs.terminalWidth())` to maximize the width of yargs' usage instructions.
|
||||
*/
|
||||
wrap(columns: number | null): Argv<T>;
|
||||
}
|
||||
|
||||
type Arguments<T = {}> = T & {
|
||||
/** Non-option arguments */
|
||||
_: string[];
|
||||
/** The script name or node command */
|
||||
$0: string;
|
||||
/** All remaining options */
|
||||
[argName: string]: unknown;
|
||||
};
|
||||
|
||||
interface RequireDirectoryOptions {
|
||||
/** Look for command modules in all subdirectories and apply them as a flattened (non-hierarchical) list. */
|
||||
recurse?: boolean;
|
||||
/** The types of files to look for when requiring command modules. */
|
||||
extensions?: ReadonlyArray<string>;
|
||||
/**
|
||||
* A synchronous function called for each command module encountered.
|
||||
* Accepts `commandObject`, `pathToFile`, and `filename` as arguments.
|
||||
* Returns `commandObject` to include the command; any falsy value to exclude/skip it.
|
||||
*/
|
||||
visit?: (commandObject: any, pathToFile?: string, filename?: string) => any;
|
||||
/** Whitelist certain modules */
|
||||
include?: RegExp | ((pathToFile: string) => boolean);
|
||||
/** Blacklist certain modules. */
|
||||
exclude?: RegExp | ((pathToFile: string) => boolean);
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/** string or array of strings, alias(es) for the canonical option key, see `alias()` */
|
||||
alias?: string | ReadonlyArray<string>;
|
||||
/** boolean, interpret option as an array, see `array()` */
|
||||
array?: boolean;
|
||||
/** boolean, interpret option as a boolean flag, see `boolean()` */
|
||||
boolean?: boolean;
|
||||
/** value or array of values, limit valid option arguments to a predefined set, see `choices()` */
|
||||
choices?: Choices;
|
||||
/** function, coerce or transform parsed command line values into another value, see `coerce()` */
|
||||
coerce?: (arg: any) => any;
|
||||
/** boolean, interpret option as a path to a JSON config file, see `config()` */
|
||||
config?: boolean;
|
||||
/** function, provide a custom config parsing function, see `config()` */
|
||||
configParser?: (configPath: string) => object;
|
||||
/** string or object, require certain keys not to be set, see `conflicts()` */
|
||||
conflicts?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
|
||||
/** boolean, interpret option as a count of boolean flags, see `count()` */
|
||||
count?: boolean;
|
||||
/** value, set a default value for the option, see `default()` */
|
||||
default?: any;
|
||||
/** string, use this description for the default value in help content, see `default()` */
|
||||
defaultDescription?: string;
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use 'demandOption' instead
|
||||
*/
|
||||
demand?: boolean | string;
|
||||
/** boolean or string, demand the option be given, with optional error message, see `demandOption()` */
|
||||
demandOption?: boolean | string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
desc?: string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
describe?: string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
description?: string;
|
||||
/** boolean, indicate that this key should not be reset when a command is invoked, see `global()` */
|
||||
global?: boolean;
|
||||
/** string, when displaying usage instructions place the option under an alternative group heading, see `group()` */
|
||||
group?: string;
|
||||
/** don't display option in help output. */
|
||||
hidden?: boolean;
|
||||
/** string or object, require certain keys to be set, see `implies()` */
|
||||
implies?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
|
||||
/** number, specify how many arguments should be consumed for the option, see `nargs()` */
|
||||
nargs?: number;
|
||||
/** boolean, apply path.normalize() to the option, see `normalize()` */
|
||||
normalize?: boolean;
|
||||
/** boolean, interpret option as a number, `number()` */
|
||||
number?: boolean;
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use 'demandOption' instead
|
||||
*/
|
||||
require?: boolean | string;
|
||||
/**
|
||||
* @deprecated since version 6.6.0
|
||||
* Use 'demandOption' instead
|
||||
*/
|
||||
required?: boolean | string;
|
||||
/** boolean, require the option be specified with a value, see `requiresArg()` */
|
||||
requiresArg?: boolean;
|
||||
/** boolean, skips validation if the option is present, see `skipValidation()` */
|
||||
skipValidation?: boolean;
|
||||
/** boolean, interpret option as a string, see `string()` */
|
||||
string?: boolean;
|
||||
type?: "array" | "count" | PositionalOptionsType;
|
||||
}
|
||||
|
||||
interface PositionalOptions {
|
||||
/** string or array of strings, see `alias()` */
|
||||
alias?: string | ReadonlyArray<string>;
|
||||
/** boolean, interpret option as an array, see `array()` */
|
||||
array?: boolean;
|
||||
/** value or array of values, limit valid option arguments to a predefined set, see `choices()` */
|
||||
choices?: Choices;
|
||||
/** function, coerce or transform parsed command line values into another value, see `coerce()` */
|
||||
coerce?: (arg: any) => any;
|
||||
/** string or object, require certain keys not to be set, see `conflicts()` */
|
||||
conflicts?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
|
||||
/** value, set a default value for the option, see `default()` */
|
||||
default?: any;
|
||||
/** boolean or string, demand the option be given, with optional error message, see `demandOption()` */
|
||||
demandOption?: boolean | string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
desc?: string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
describe?: string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
description?: string;
|
||||
/** string or object, require certain keys to be set, see `implies()` */
|
||||
implies?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
|
||||
/** boolean, apply path.normalize() to the option, see normalize() */
|
||||
normalize?: boolean;
|
||||
type?: PositionalOptionsType;
|
||||
}
|
||||
|
||||
/** Remove keys K in T */
|
||||
type Omit<T, K> = { [key in Exclude<keyof T, K>]: T[key] };
|
||||
|
||||
/** Remove undefined as a possible value for keys K in T */
|
||||
type Defined<T, K extends keyof T> = Omit<T, K> & { [key in K]: Exclude<T[key], undefined> };
|
||||
|
||||
/** Convert T to T[] and T | undefined to T[] | undefined */
|
||||
type ToArray<T> = Array<Exclude<T, undefined>> | Extract<T, undefined>;
|
||||
|
||||
/** Gives string[] if T is an array type, otherwise string. Preserves | undefined. */
|
||||
type ToString<T> = (Exclude<T, undefined> extends any[] ? string[] : string) | Extract<T, undefined>;
|
||||
|
||||
/** Gives number[] if T is an array type, otherwise number. Preserves | undefined. */
|
||||
type ToNumber<T> = (Exclude<T, undefined> extends any[] ? number[] : number) | Extract<T, undefined>;
|
||||
|
||||
type InferredOptionType<O extends Options | PositionalOptions> =
|
||||
O extends { default: infer D } ? D :
|
||||
O extends { type: "count" } ? number :
|
||||
O extends { count: true } ? number :
|
||||
O extends { required: string | true } ? RequiredOptionType<O> :
|
||||
O extends { require: string | true } ? RequiredOptionType<O> :
|
||||
O extends { demand: string | true } ? RequiredOptionType<O> :
|
||||
O extends { demandOption: string | true } ? RequiredOptionType<O> :
|
||||
RequiredOptionType<O> | undefined;
|
||||
|
||||
type RequiredOptionType<O extends Options | PositionalOptions> =
|
||||
O extends { type: "array", string: true } ? string[] :
|
||||
O extends { type: "array", number: true } ? number[] :
|
||||
O extends { type: "array", normalize: true } ? string[] :
|
||||
O extends { type: "string", array: true } ? string[] :
|
||||
O extends { type: "number", array: true } ? number[] :
|
||||
O extends { string: true, array: true } ? string[] :
|
||||
O extends { number: true, array: true } ? number[] :
|
||||
O extends { normalize: true, array: true } ? string[] :
|
||||
O extends { type: "array" } ? Array<string | number> :
|
||||
O extends { type: "boolean" } ? boolean :
|
||||
O extends { type: "number" } ? number :
|
||||
O extends { type: "string" } ? string :
|
||||
O extends { array: true } ? Array<string | number> :
|
||||
O extends { boolean: true } ? boolean :
|
||||
O extends { number: true } ? number :
|
||||
O extends { string: true } ? string :
|
||||
O extends { normalize: true } ? string :
|
||||
O extends { choices: ReadonlyArray<infer C> } ? C :
|
||||
O extends { coerce: (arg: any) => infer T } ? T :
|
||||
unknown;
|
||||
|
||||
type InferredOptionTypes<O extends { [key: string]: Options }> = { [key in keyof O]: InferredOptionType<O[key]> };
|
||||
|
||||
interface CommandModule<T = {}, U = {}> {
|
||||
/** array of strings (or a single string) representing aliases of `exports.command`, positional args defined in an alias are ignored */
|
||||
aliases?: ReadonlyArray<string> | string;
|
||||
/** object declaring the options the command accepts, or a function accepting and returning a yargs instance */
|
||||
builder?: CommandBuilder<T, U>;
|
||||
/** string (or array of strings) that executes this command when given on the command line, first string may contain positional args */
|
||||
command?: ReadonlyArray<string> | string;
|
||||
/** string used as the description for the command in help text, use `false` for a hidden command */
|
||||
describe?: string | false;
|
||||
/** a function which will be passed the parsed argv. */
|
||||
handler: (args: Arguments<U>) => void;
|
||||
}
|
||||
|
||||
type ParseCallback<T = {}> = (err: Error | undefined, argv: Arguments<T>, output: string) => void;
|
||||
type CommandBuilder<T = {}, U = {}> = { [key: string]: Options } | ((args: Argv<T>) => Argv<U>);
|
||||
type SyncCompletionFunction = (current: string, argv: any) => string[];
|
||||
type AsyncCompletionFunction = (current: string, argv: any, done: (completion: ReadonlyArray<string>) => void) => void;
|
||||
type PromiseCompletionFunction = (current: string, argv: any) => Promise<string[]>;
|
||||
type MiddlewareFunction<T = {}> = (args: Arguments<T>) => void;
|
||||
type Choices = ReadonlyArray<string | number | true | undefined>;
|
||||
type PositionalOptionsType = "boolean" | "number" | "string";
|
||||
}
|
||||
|
||||
declare var yargs: yargs.Argv;
|
||||
export = yargs;
|
56
node_modules/metro-core/node_modules/@types/yargs/package.json
generated
vendored
Normal file
56
node_modules/metro-core/node_modules/@types/yargs/package.json
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "@types/yargs",
|
||||
"version": "13.0.11",
|
||||
"description": "TypeScript definitions for yargs",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Martin Poelstra",
|
||||
"url": "https://github.com/poelstra",
|
||||
"githubUsername": "poelstra"
|
||||
},
|
||||
{
|
||||
"name": "Mizunashi Mana",
|
||||
"url": "https://github.com/mizunashi-mana",
|
||||
"githubUsername": "mizunashi-mana"
|
||||
},
|
||||
{
|
||||
"name": "Jeffery Grajkowski",
|
||||
"url": "https://github.com/pushplay",
|
||||
"githubUsername": "pushplay"
|
||||
},
|
||||
{
|
||||
"name": "Jimi (Dimitris) Charalampidis",
|
||||
"url": "https://github.com/JimiC",
|
||||
"githubUsername": "JimiC"
|
||||
},
|
||||
{
|
||||
"name": "Steffen Viken Valvåg",
|
||||
"url": "https://github.com/steffenvv",
|
||||
"githubUsername": "steffenvv"
|
||||
},
|
||||
{
|
||||
"name": "Emily Marigold Klassen",
|
||||
"url": "https://github.com/forivall",
|
||||
"githubUsername": "forivall"
|
||||
},
|
||||
{
|
||||
"name": "ExE Boss",
|
||||
"url": "https://github.com/ExE-Boss",
|
||||
"githubUsername": "ExE-Boss"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/yargs"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/yargs-parser": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "064f147d70f08ec7f0379158a1e21bfe3f20ceadcadc729bdf7e2272c3d3fac9",
|
||||
"typeScriptVersion": "3.2"
|
||||
}
|
9
node_modules/metro-core/node_modules/@types/yargs/yargs.d.ts
generated
vendored
Normal file
9
node_modules/metro-core/node_modules/@types/yargs/yargs.d.ts
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
import { Argv } from '.';
|
||||
|
||||
export = Yargs;
|
||||
|
||||
declare function Yargs(
|
||||
processArgs?: ReadonlyArray<string>,
|
||||
cwd?: string,
|
||||
parentRequire?: NodeRequire,
|
||||
): Argv;
|
15
node_modules/metro-core/node_modules/anymatch/LICENSE
generated
vendored
Normal file
15
node_modules/metro-core/node_modules/anymatch/LICENSE
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
The ISC License
|
||||
|
||||
Copyright (c) 2014 Elan Shanker
|
||||
|
||||
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.
|
99
node_modules/metro-core/node_modules/anymatch/README.md
generated
vendored
Normal file
99
node_modules/metro-core/node_modules/anymatch/README.md
generated
vendored
Normal file
@ -0,0 +1,99 @@
|
||||
anymatch [](https://travis-ci.org/micromatch/anymatch) [](https://coveralls.io/r/micromatch/anymatch?branch=master)
|
||||
======
|
||||
Javascript module to match a string against a regular expression, glob, string,
|
||||
or function that takes the string as an argument and returns a truthy or falsy
|
||||
value. The matcher can also be an array of any or all of these. Useful for
|
||||
allowing a very flexible user-defined config to define things like file paths.
|
||||
|
||||
__Note: This module has Bash-parity, please be aware that Windows-style backslashes are not supported as separators. See https://github.com/micromatch/micromatch#backslashes for more information.__
|
||||
|
||||
[](https://nodei.co/npm/anymatch/)
|
||||
[](https://nodei.co/npm-dl/anymatch/)
|
||||
|
||||
Usage
|
||||
-----
|
||||
```sh
|
||||
npm install anymatch --save
|
||||
```
|
||||
|
||||
#### anymatch (matchers, testString, [returnIndex], [startIndex], [endIndex])
|
||||
* __matchers__: (_Array|String|RegExp|Function_)
|
||||
String to be directly matched, string with glob patterns, regular expression
|
||||
test, function that takes the testString as an argument and returns a truthy
|
||||
value if it should be matched, or an array of any number and mix of these types.
|
||||
* __testString__: (_String|Array_) The string to test against the matchers. If
|
||||
passed as an array, the first element of the array will be used as the
|
||||
`testString` for non-function matchers, while the entire array will be applied
|
||||
as the arguments for function matchers.
|
||||
* __returnIndex__: (_Boolean [optional]_) If true, return the array index of
|
||||
the first matcher that that testString matched, or -1 if no match, instead of a
|
||||
boolean result.
|
||||
* __startIndex, endIndex__: (_Integer [optional]_) Can be used to define a
|
||||
subset out of the array of provided matchers to test against. Can be useful
|
||||
with bound matcher functions (see below). When used with `returnIndex = true`
|
||||
preserves original indexing. Behaves the same as `Array.prototype.slice` (i.e.
|
||||
includes array members up to, but not including endIndex).
|
||||
|
||||
```js
|
||||
var anymatch = require('anymatch');
|
||||
|
||||
var matchers = [
|
||||
'path/to/file.js',
|
||||
'path/anyjs/**/*.js',
|
||||
/foo\.js$/,
|
||||
function (string) {
|
||||
return string.indexOf('bar') !== -1 && string.length > 10
|
||||
}
|
||||
];
|
||||
|
||||
anymatch(matchers, 'path/to/file.js'); // true
|
||||
anymatch(matchers, 'path/anyjs/baz.js'); // true
|
||||
anymatch(matchers, 'path/to/foo.js'); // true
|
||||
anymatch(matchers, 'path/to/bar.js'); // true
|
||||
anymatch(matchers, 'bar.js'); // false
|
||||
|
||||
// returnIndex = true
|
||||
anymatch(matchers, 'foo.js', true); // 2
|
||||
anymatch(matchers, 'path/anyjs/foo.js', true); // 1
|
||||
|
||||
// skip matchers
|
||||
anymatch(matchers, 'path/to/file.js', false, 1); // false
|
||||
anymatch(matchers, 'path/anyjs/foo.js', true, 2, 3); // 2
|
||||
anymatch(matchers, 'path/to/bar.js', true, 0, 3); // -1
|
||||
|
||||
// using globs to match directories and their children
|
||||
anymatch('node_modules', 'node_modules'); // true
|
||||
anymatch('node_modules', 'node_modules/somelib/index.js'); // false
|
||||
anymatch('node_modules/**', 'node_modules/somelib/index.js'); // true
|
||||
anymatch('node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // false
|
||||
anymatch('**/node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // true
|
||||
```
|
||||
|
||||
#### anymatch (matchers)
|
||||
You can also pass in only your matcher(s) to get a curried function that has
|
||||
already been bound to the provided matching criteria. This can be used as an
|
||||
`Array.prototype.filter` callback.
|
||||
|
||||
```js
|
||||
var matcher = anymatch(matchers);
|
||||
|
||||
matcher('path/to/file.js'); // true
|
||||
matcher('path/anyjs/baz.js', true); // 1
|
||||
matcher('path/anyjs/baz.js', true, 2); // -1
|
||||
|
||||
['foo.js', 'bar.js'].filter(matcher); // ['foo.js']
|
||||
```
|
||||
|
||||
Change Log
|
||||
----------
|
||||
[See release notes page on GitHub](https://github.com/micromatch/anymatch/releases)
|
||||
|
||||
NOTE: As of v2.0.0, [micromatch](https://github.com/jonschlinkert/micromatch) moves away from minimatch-parity and inline with Bash. This includes handling backslashes differently (see https://github.com/micromatch/micromatch#backslashes for more information).
|
||||
|
||||
NOTE: As of v1.2.0, anymatch uses [micromatch](https://github.com/jonschlinkert/micromatch)
|
||||
for glob pattern matching. Issues with glob pattern matching should be
|
||||
reported directly to the [micromatch issue tracker](https://github.com/jonschlinkert/micromatch/issues).
|
||||
|
||||
License
|
||||
-------
|
||||
[ISC](https://raw.github.com/micromatch/anymatch/master/LICENSE)
|
67
node_modules/metro-core/node_modules/anymatch/index.js
generated
vendored
Normal file
67
node_modules/metro-core/node_modules/anymatch/index.js
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
'use strict';
|
||||
|
||||
var micromatch = require('micromatch');
|
||||
var normalize = require('normalize-path');
|
||||
var path = require('path'); // required for tests.
|
||||
var arrify = function(a) { return a == null ? [] : (Array.isArray(a) ? a : [a]); };
|
||||
|
||||
var anymatch = function(criteria, value, returnIndex, startIndex, endIndex) {
|
||||
criteria = arrify(criteria);
|
||||
value = arrify(value);
|
||||
if (arguments.length === 1) {
|
||||
return anymatch.bind(null, criteria.map(function(criterion) {
|
||||
return typeof criterion === 'string' && criterion[0] !== '!' ?
|
||||
micromatch.matcher(criterion) : criterion;
|
||||
}));
|
||||
}
|
||||
startIndex = startIndex || 0;
|
||||
var string = value[0];
|
||||
var altString, altValue;
|
||||
var matched = false;
|
||||
var matchIndex = -1;
|
||||
function testCriteria(criterion, index) {
|
||||
var result;
|
||||
switch (Object.prototype.toString.call(criterion)) {
|
||||
case '[object String]':
|
||||
result = string === criterion || altString && altString === criterion;
|
||||
result = result || micromatch.isMatch(string, criterion);
|
||||
break;
|
||||
case '[object RegExp]':
|
||||
result = criterion.test(string) || altString && criterion.test(altString);
|
||||
break;
|
||||
case '[object Function]':
|
||||
result = criterion.apply(null, value);
|
||||
result = result || altValue && criterion.apply(null, altValue);
|
||||
break;
|
||||
default:
|
||||
result = false;
|
||||
}
|
||||
if (result) {
|
||||
matchIndex = index + startIndex;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
var crit = criteria;
|
||||
var negGlobs = crit.reduce(function(arr, criterion, index) {
|
||||
if (typeof criterion === 'string' && criterion[0] === '!') {
|
||||
if (crit === criteria) {
|
||||
// make a copy before modifying
|
||||
crit = crit.slice();
|
||||
}
|
||||
crit[index] = null;
|
||||
arr.push(criterion.substr(1));
|
||||
}
|
||||
return arr;
|
||||
}, []);
|
||||
if (!negGlobs.length || !micromatch.any(string, negGlobs)) {
|
||||
if (path.sep === '\\' && typeof string === 'string') {
|
||||
altString = normalize(string);
|
||||
altString = altString === string ? null : altString;
|
||||
if (altString) altValue = [altString].concat(value.slice(1));
|
||||
}
|
||||
matched = crit.slice(startIndex, endIndex).some(testCriteria);
|
||||
}
|
||||
return returnIndex === true ? matchIndex : matched;
|
||||
};
|
||||
|
||||
module.exports = anymatch;
|
47
node_modules/metro-core/node_modules/anymatch/package.json
generated
vendored
Normal file
47
node_modules/metro-core/node_modules/anymatch/package.json
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "anymatch",
|
||||
"version": "2.0.0",
|
||||
"description": "Matches strings against configurable strings, globs, regular expressions, and/or functions",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"author": {
|
||||
"name": "Elan Shanker",
|
||||
"url": "http://github.com/es128"
|
||||
},
|
||||
"license": "ISC",
|
||||
"homepage": "https://github.com/micromatch/anymatch",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/micromatch/anymatch"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/micromatch/anymatch/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"match",
|
||||
"any",
|
||||
"string",
|
||||
"file",
|
||||
"fs",
|
||||
"list",
|
||||
"glob",
|
||||
"regex",
|
||||
"regexp",
|
||||
"regular",
|
||||
"expression",
|
||||
"function"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls"
|
||||
},
|
||||
"dependencies": {
|
||||
"micromatch": "^3.1.4",
|
||||
"normalize-path": "^2.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.7.0",
|
||||
"istanbul": "^0.4.5",
|
||||
"mocha": "^3.0.0"
|
||||
}
|
||||
}
|
21
node_modules/metro-core/node_modules/arr-diff/LICENSE
generated
vendored
Executable file
21
node_modules/metro-core/node_modules/arr-diff/LICENSE
generated
vendored
Executable file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2017, Jon Schlinkert
|
||||
|
||||
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.
|
130
node_modules/metro-core/node_modules/arr-diff/README.md
generated
vendored
Normal file
130
node_modules/metro-core/node_modules/arr-diff/README.md
generated
vendored
Normal file
@ -0,0 +1,130 @@
|
||||
# arr-diff [](https://www.npmjs.com/package/arr-diff) [](https://npmjs.org/package/arr-diff) [](https://travis-ci.org/jonschlinkert/arr-diff)
|
||||
|
||||
> Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save arr-diff
|
||||
```
|
||||
|
||||
Install with [yarn](https://yarnpkg.com):
|
||||
|
||||
```sh
|
||||
$ yarn add arr-diff
|
||||
```
|
||||
|
||||
Install with [bower](https://bower.io/)
|
||||
|
||||
```sh
|
||||
$ bower install arr-diff --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Returns the difference between the first array and additional arrays.
|
||||
|
||||
```js
|
||||
var diff = require('arr-diff');
|
||||
|
||||
var a = ['a', 'b', 'c', 'd'];
|
||||
var b = ['b', 'c'];
|
||||
|
||||
console.log(diff(a, b))
|
||||
//=> ['a', 'd']
|
||||
```
|
||||
|
||||
## Benchmarks
|
||||
|
||||
This library versus [array-differ](https://github.com/sindresorhus/array-differ), on April 14, 2017:
|
||||
|
||||
```
|
||||
Benchmarking: (4 of 4)
|
||||
· long-dupes
|
||||
· long
|
||||
· med
|
||||
· short
|
||||
|
||||
# benchmark/fixtures/long-dupes.js (100804 bytes)
|
||||
arr-diff-3.0.0 x 822 ops/sec ±0.67% (86 runs sampled)
|
||||
arr-diff-4.0.0 x 2,141 ops/sec ±0.42% (89 runs sampled)
|
||||
array-differ x 708 ops/sec ±0.70% (89 runs sampled)
|
||||
|
||||
fastest is arr-diff-4.0.0
|
||||
|
||||
# benchmark/fixtures/long.js (94529 bytes)
|
||||
arr-diff-3.0.0 x 882 ops/sec ±0.60% (87 runs sampled)
|
||||
arr-diff-4.0.0 x 2,329 ops/sec ±0.97% (83 runs sampled)
|
||||
array-differ x 769 ops/sec ±0.61% (90 runs sampled)
|
||||
|
||||
fastest is arr-diff-4.0.0
|
||||
|
||||
# benchmark/fixtures/med.js (708 bytes)
|
||||
arr-diff-3.0.0 x 856,150 ops/sec ±0.42% (89 runs sampled)
|
||||
arr-diff-4.0.0 x 4,665,249 ops/sec ±1.06% (89 runs sampled)
|
||||
array-differ x 653,888 ops/sec ±1.02% (86 runs sampled)
|
||||
|
||||
fastest is arr-diff-4.0.0
|
||||
|
||||
# benchmark/fixtures/short.js (60 bytes)
|
||||
arr-diff-3.0.0 x 3,078,467 ops/sec ±0.77% (93 runs sampled)
|
||||
arr-diff-4.0.0 x 9,213,296 ops/sec ±0.65% (89 runs sampled)
|
||||
array-differ x 1,337,051 ops/sec ±0.91% (92 runs sampled)
|
||||
|
||||
fastest is arr-diff-4.0.0
|
||||
```
|
||||
|
||||
## About
|
||||
|
||||
### Related projects
|
||||
|
||||
* [arr-flatten](https://www.npmjs.com/package/arr-flatten): Recursively flatten an array or arrays. This is the fastest implementation of array flatten. | [homepage](https://github.com/jonschlinkert/arr-flatten "Recursively flatten an array or arrays. This is the fastest implementation of array flatten.")
|
||||
* [array-filter](https://www.npmjs.com/package/array-filter): Array#filter for older browsers. | [homepage](https://github.com/juliangruber/array-filter "Array#filter for older browsers.")
|
||||
* [array-intersection](https://www.npmjs.com/package/array-intersection): Return an array with the unique values present in _all_ given arrays using strict equality… [more](https://github.com/jonschlinkert/array-intersection) | [homepage](https://github.com/jonschlinkert/array-intersection "Return an array with the unique values present in _all_ given arrays using strict equality for comparisons.")
|
||||
|
||||
### Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 33 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 2 | [paulmillr](https://github.com/paulmillr) |
|
||||
|
||||
### Building docs
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
### Running tests
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 14, 2017._
|
47
node_modules/metro-core/node_modules/arr-diff/index.js
generated
vendored
Normal file
47
node_modules/metro-core/node_modules/arr-diff/index.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
/*!
|
||||
* arr-diff <https://github.com/jonschlinkert/arr-diff>
|
||||
*
|
||||
* Copyright (c) 2014-2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function diff(arr/*, arrays*/) {
|
||||
var len = arguments.length;
|
||||
var idx = 0;
|
||||
while (++idx < len) {
|
||||
arr = diffArray(arr, arguments[idx]);
|
||||
}
|
||||
return arr;
|
||||
};
|
||||
|
||||
function diffArray(one, two) {
|
||||
if (!Array.isArray(two)) {
|
||||
return one.slice();
|
||||
}
|
||||
|
||||
var tlen = two.length
|
||||
var olen = one.length;
|
||||
var idx = -1;
|
||||
var arr = [];
|
||||
|
||||
while (++idx < olen) {
|
||||
var ele = one[idx];
|
||||
|
||||
var hasEle = false;
|
||||
for (var i = 0; i < tlen; i++) {
|
||||
var val = two[i];
|
||||
|
||||
if (ele === val) {
|
||||
hasEle = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (hasEle === false) {
|
||||
arr.push(ele);
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
}
|
69
node_modules/metro-core/node_modules/arr-diff/package.json
generated
vendored
Normal file
69
node_modules/metro-core/node_modules/arr-diff/package.json
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
{
|
||||
"name": "arr-diff",
|
||||
"description": "Returns an array with only the unique values from the first array, by excluding all values from additional arrays using strict equality for comparisons.",
|
||||
"version": "4.0.0",
|
||||
"homepage": "https://github.com/jonschlinkert/arr-diff",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"contributors": [
|
||||
"Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)",
|
||||
"Paul Miller <paul+gh@paulmillr.com> (paulmillr.com)"
|
||||
],
|
||||
"repository": "jonschlinkert/arr-diff",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/arr-diff/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"ansi-bold": "^0.1.1",
|
||||
"arr-flatten": "^1.0.1",
|
||||
"array-differ": "^1.0.0",
|
||||
"benchmarked": "^0.2.4",
|
||||
"gulp-format-md": "^0.1.9",
|
||||
"minimist": "^1.2.0",
|
||||
"mocha": "^2.4.5"
|
||||
},
|
||||
"keywords": [
|
||||
"arr",
|
||||
"array",
|
||||
"array differ",
|
||||
"array-differ",
|
||||
"diff",
|
||||
"differ",
|
||||
"difference"
|
||||
],
|
||||
"verb": {
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"arr-flatten",
|
||||
"array-filter",
|
||||
"array-intersection"
|
||||
]
|
||||
},
|
||||
"reflinks": [
|
||||
"array-differ",
|
||||
"verb"
|
||||
],
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
}
|
||||
}
|
||||
}
|
21
node_modules/metro-core/node_modules/braces/LICENSE
generated
vendored
Normal file
21
node_modules/metro-core/node_modules/braces/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2018, Jon Schlinkert.
|
||||
|
||||
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.
|
640
node_modules/metro-core/node_modules/braces/README.md
generated
vendored
Normal file
640
node_modules/metro-core/node_modules/braces/README.md
generated
vendored
Normal file
@ -0,0 +1,640 @@
|
||||
# braces [](https://www.npmjs.com/package/braces) [](https://npmjs.org/package/braces) [](https://npmjs.org/package/braces) [](https://travis-ci.org/micromatch/braces) [](https://ci.appveyor.com/project/micromatch/braces)
|
||||
|
||||
> Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.
|
||||
|
||||
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save braces
|
||||
```
|
||||
|
||||
## Why use braces?
|
||||
|
||||
Brace patterns are great for matching ranges. Users (and implementors) shouldn't have to think about whether or not they will break their application (or yours) from accidentally defining an aggressive brace pattern. _Braces is the only library that offers a [solution to this problem](#performance)_.
|
||||
|
||||
* **Safe(r)**: Braces isn't vulnerable to DoS attacks like [brace-expansion](https://github.com/juliangruber/brace-expansion), [minimatch](https://github.com/isaacs/minimatch) and [multimatch](https://github.com/sindresorhus/multimatch) (a different bug than the [other regex DoS bug](https://medium.com/node-security/minimatch-redos-vulnerability-590da24e6d3c#.jew0b6mpc)).
|
||||
* **Accurate**: complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests)
|
||||
* **[fast and performant](#benchmarks)**: Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity.
|
||||
* **Organized code base**: with parser and compiler that are eas(y|ier) to maintain and update when edge cases crop up.
|
||||
* **Well-tested**: thousands of test assertions. Passes 100% of the [minimatch](https://github.com/isaacs/minimatch) and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests as well (as of the writing of this).
|
||||
|
||||
## Usage
|
||||
|
||||
The main export is a function that takes one or more brace `patterns` and `options`.
|
||||
|
||||
```js
|
||||
var braces = require('braces');
|
||||
braces(pattern[, options]);
|
||||
```
|
||||
|
||||
By default, braces returns an optimized regex-source string. To get an array of brace patterns, use `brace.expand()`.
|
||||
|
||||
The following section explains the difference in more detail. _(If you're curious about "why" braces does this by default, see [brace matching pitfalls](#brace-matching-pitfalls)_.
|
||||
|
||||
### Optimized vs. expanded braces
|
||||
|
||||
**Optimized**
|
||||
|
||||
By default, patterns are optimized for regex and matching:
|
||||
|
||||
```js
|
||||
console.log(braces('a/{x,y,z}/b'));
|
||||
//=> ['a/(x|y|z)/b']
|
||||
```
|
||||
|
||||
**Expanded**
|
||||
|
||||
To expand patterns the same way as Bash or [minimatch](https://github.com/isaacs/minimatch), use the [.expand](#expand) method:
|
||||
|
||||
```js
|
||||
console.log(braces.expand('a/{x,y,z}/b'));
|
||||
//=> ['a/x/b', 'a/y/b', 'a/z/b']
|
||||
```
|
||||
|
||||
Or use [options.expand](#optionsexpand):
|
||||
|
||||
```js
|
||||
console.log(braces('a/{x,y,z}/b', {expand: true}));
|
||||
//=> ['a/x/b', 'a/y/b', 'a/z/b']
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
* [lists](#lists): Supports "lists": `a/{b,c}/d` => `['a/b/d', 'a/c/d']`
|
||||
* [sequences](#sequences): Supports alphabetical or numerical "sequences" (ranges): `{1..3}` => `['1', '2', '3']`
|
||||
* [steps](#steps): Supports "steps" or increments: `{2..10..2}` => `['2', '4', '6', '8', '10']`
|
||||
* [escaping](#escaping)
|
||||
* [options](#options)
|
||||
|
||||
### Lists
|
||||
|
||||
Uses [fill-range](https://github.com/jonschlinkert/fill-range) for expanding alphabetical or numeric lists:
|
||||
|
||||
```js
|
||||
console.log(braces('a/{foo,bar,baz}/*.js'));
|
||||
//=> ['a/(foo|bar|baz)/*.js']
|
||||
|
||||
console.log(braces.expand('a/{foo,bar,baz}/*.js'));
|
||||
//=> ['a/foo/*.js', 'a/bar/*.js', 'a/baz/*.js']
|
||||
```
|
||||
|
||||
### Sequences
|
||||
|
||||
Uses [fill-range](https://github.com/jonschlinkert/fill-range) for expanding alphabetical or numeric ranges (bash "sequences"):
|
||||
|
||||
```js
|
||||
console.log(braces.expand('{1..3}')); // ['1', '2', '3']
|
||||
console.log(braces.expand('a{01..03}b')); // ['a01b', 'a02b', 'a03b']
|
||||
console.log(braces.expand('a{1..3}b')); // ['a1b', 'a2b', 'a3b']
|
||||
console.log(braces.expand('{a..c}')); // ['a', 'b', 'c']
|
||||
console.log(braces.expand('foo/{a..c}')); // ['foo/a', 'foo/b', 'foo/c']
|
||||
|
||||
// supports padded ranges
|
||||
console.log(braces('a{01..03}b')); //=> [ 'a(0[1-3])b' ]
|
||||
console.log(braces('a{001..300}b')); //=> [ 'a(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)b' ]
|
||||
```
|
||||
|
||||
### Steps
|
||||
|
||||
Steps, or increments, may be used with ranges:
|
||||
|
||||
```js
|
||||
console.log(braces.expand('{2..10..2}'));
|
||||
//=> ['2', '4', '6', '8', '10']
|
||||
|
||||
console.log(braces('{2..10..2}'));
|
||||
//=> ['(2|4|6|8|10)']
|
||||
```
|
||||
|
||||
When the [.optimize](#optimize) method is used, or [options.optimize](#optionsoptimize) is set to true, sequences are passed to [to-regex-range](https://github.com/jonschlinkert/to-regex-range) for expansion.
|
||||
|
||||
### Nesting
|
||||
|
||||
Brace patterns may be nested. The results of each expanded string are not sorted, and left to right order is preserved.
|
||||
|
||||
**"Expanded" braces**
|
||||
|
||||
```js
|
||||
console.log(braces.expand('a{b,c,/{x,y}}/e'));
|
||||
//=> ['ab/e', 'ac/e', 'a/x/e', 'a/y/e']
|
||||
|
||||
console.log(braces.expand('a/{x,{1..5},y}/c'));
|
||||
//=> ['a/x/c', 'a/1/c', 'a/2/c', 'a/3/c', 'a/4/c', 'a/5/c', 'a/y/c']
|
||||
```
|
||||
|
||||
**"Optimized" braces**
|
||||
|
||||
```js
|
||||
console.log(braces('a{b,c,/{x,y}}/e'));
|
||||
//=> ['a(b|c|/(x|y))/e']
|
||||
|
||||
console.log(braces('a/{x,{1..5},y}/c'));
|
||||
//=> ['a/(x|([1-5])|y)/c']
|
||||
```
|
||||
|
||||
### Escaping
|
||||
|
||||
**Escaping braces**
|
||||
|
||||
A brace pattern will not be expanded or evaluted if _either the opening or closing brace is escaped_:
|
||||
|
||||
```js
|
||||
console.log(braces.expand('a\\{d,c,b}e'));
|
||||
//=> ['a{d,c,b}e']
|
||||
|
||||
console.log(braces.expand('a{d,c,b\\}e'));
|
||||
//=> ['a{d,c,b}e']
|
||||
```
|
||||
|
||||
**Escaping commas**
|
||||
|
||||
Commas inside braces may also be escaped:
|
||||
|
||||
```js
|
||||
console.log(braces.expand('a{b\\,c}d'));
|
||||
//=> ['a{b,c}d']
|
||||
|
||||
console.log(braces.expand('a{d\\,c,b}e'));
|
||||
//=> ['ad,ce', 'abe']
|
||||
```
|
||||
|
||||
**Single items**
|
||||
|
||||
Following bash conventions, a brace pattern is also not expanded when it contains a single character:
|
||||
|
||||
```js
|
||||
console.log(braces.expand('a{b}c'));
|
||||
//=> ['a{b}c']
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### options.maxLength
|
||||
|
||||
**Type**: `Number`
|
||||
|
||||
**Default**: `65,536`
|
||||
|
||||
**Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera.
|
||||
|
||||
```js
|
||||
console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error
|
||||
```
|
||||
|
||||
### options.expand
|
||||
|
||||
**Type**: `Boolean`
|
||||
|
||||
**Default**: `undefined`
|
||||
|
||||
**Description**: Generate an "expanded" brace pattern (this option is unncessary with the `.expand` method, which does the same thing).
|
||||
|
||||
```js
|
||||
console.log(braces('a/{b,c}/d', {expand: true}));
|
||||
//=> [ 'a/b/d', 'a/c/d' ]
|
||||
```
|
||||
|
||||
### options.optimize
|
||||
|
||||
**Type**: `Boolean`
|
||||
|
||||
**Default**: `true`
|
||||
|
||||
**Description**: Enabled by default.
|
||||
|
||||
```js
|
||||
console.log(braces('a/{b,c}/d'));
|
||||
//=> [ 'a/(b|c)/d' ]
|
||||
```
|
||||
|
||||
### options.nodupes
|
||||
|
||||
**Type**: `Boolean`
|
||||
|
||||
**Default**: `true`
|
||||
|
||||
**Description**: Duplicates are removed by default. To keep duplicates, pass `{nodupes: false}` on the options
|
||||
|
||||
### options.rangeLimit
|
||||
|
||||
**Type**: `Number`
|
||||
|
||||
**Default**: `250`
|
||||
|
||||
**Description**: When `braces.expand()` is used, or `options.expand` is true, brace patterns will automatically be [optimized](#optionsoptimize) when the difference between the range minimum and range maximum exceeds the `rangeLimit`. This is to prevent huge ranges from freezing your application.
|
||||
|
||||
You can set this to any number, or change `options.rangeLimit` to `Inifinity` to disable this altogether.
|
||||
|
||||
**Examples**
|
||||
|
||||
```js
|
||||
// pattern exceeds the "rangeLimit", so it's optimized automatically
|
||||
console.log(braces.expand('{1..1000}'));
|
||||
//=> ['([1-9]|[1-9][0-9]{1,2}|1000)']
|
||||
|
||||
// pattern does not exceed "rangeLimit", so it's NOT optimized
|
||||
console.log(braces.expand('{1..100}'));
|
||||
//=> ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '100']
|
||||
```
|
||||
|
||||
### options.transform
|
||||
|
||||
**Type**: `Function`
|
||||
|
||||
**Default**: `undefined`
|
||||
|
||||
**Description**: Customize range expansion.
|
||||
|
||||
```js
|
||||
var range = braces.expand('x{a..e}y', {
|
||||
transform: function(str) {
|
||||
return 'foo' + str;
|
||||
}
|
||||
});
|
||||
|
||||
console.log(range);
|
||||
//=> [ 'xfooay', 'xfooby', 'xfoocy', 'xfoody', 'xfooey' ]
|
||||
```
|
||||
|
||||
### options.quantifiers
|
||||
|
||||
**Type**: `Boolean`
|
||||
|
||||
**Default**: `undefined`
|
||||
|
||||
**Description**: In regular expressions, quanitifiers can be used to specify how many times a token can be repeated. For example, `a{1,3}` will match the letter `a` one to three times.
|
||||
|
||||
Unfortunately, regex quantifiers happen to share the same syntax as [Bash lists](#lists)
|
||||
|
||||
The `quantifiers` option tells braces to detect when [regex quantifiers](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#quantifiers) are defined in the given pattern, and not to try to expand them as lists.
|
||||
|
||||
**Examples**
|
||||
|
||||
```js
|
||||
var braces = require('braces');
|
||||
console.log(braces('a/b{1,3}/{x,y,z}'));
|
||||
//=> [ 'a/b(1|3)/(x|y|z)' ]
|
||||
console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true}));
|
||||
//=> [ 'a/b{1,3}/(x|y|z)' ]
|
||||
console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true}));
|
||||
//=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ]
|
||||
```
|
||||
|
||||
### options.unescape
|
||||
|
||||
**Type**: `Boolean`
|
||||
|
||||
**Default**: `undefined`
|
||||
|
||||
**Description**: Strip backslashes that were used for escaping from the result.
|
||||
|
||||
## What is "brace expansion"?
|
||||
|
||||
Brace expansion is a type of parameter expansion that was made popular by unix shells for generating lists of strings, as well as regex-like matching when used alongside wildcards (globs).
|
||||
|
||||
In addition to "expansion", braces are also used for matching. In other words:
|
||||
|
||||
* [brace expansion](#brace-expansion) is for generating new lists
|
||||
* [brace matching](#brace-matching) is for filtering existing lists
|
||||
|
||||
<details>
|
||||
<summary><strong>More about brace expansion</strong> (click to expand)</summary>
|
||||
|
||||
There are two main types of brace expansion:
|
||||
|
||||
1. **lists**: which are defined using comma-separated values inside curly braces: `{a,b,c}`
|
||||
2. **sequences**: which are defined using a starting value and an ending value, separated by two dots: `a{1..3}b`. Optionally, a third argument may be passed to define a "step" or increment to use: `a{1..100..10}b`. These are also sometimes referred to as "ranges".
|
||||
|
||||
Here are some example brace patterns to illustrate how they work:
|
||||
|
||||
**Sets**
|
||||
|
||||
```
|
||||
{a,b,c} => a b c
|
||||
{a,b,c}{1,2} => a1 a2 b1 b2 c1 c2
|
||||
```
|
||||
|
||||
**Sequences**
|
||||
|
||||
```
|
||||
{1..9} => 1 2 3 4 5 6 7 8 9
|
||||
{4..-4} => 4 3 2 1 0 -1 -2 -3 -4
|
||||
{1..20..3} => 1 4 7 10 13 16 19
|
||||
{a..j} => a b c d e f g h i j
|
||||
{j..a} => j i h g f e d c b a
|
||||
{a..z..3} => a d g j m p s v y
|
||||
```
|
||||
|
||||
**Combination**
|
||||
|
||||
Sets and sequences can be mixed together or used along with any other strings.
|
||||
|
||||
```
|
||||
{a,b,c}{1..3} => a1 a2 a3 b1 b2 b3 c1 c2 c3
|
||||
foo/{a,b,c}/bar => foo/a/bar foo/b/bar foo/c/bar
|
||||
```
|
||||
|
||||
The fact that braces can be "expanded" from relatively simple patterns makes them ideal for quickly generating test fixtures, file paths, and similar use cases.
|
||||
|
||||
## Brace matching
|
||||
|
||||
In addition to _expansion_, brace patterns are also useful for performing regular-expression-like matching.
|
||||
|
||||
For example, the pattern `foo/{1..3}/bar` would match any of following strings:
|
||||
|
||||
```
|
||||
foo/1/bar
|
||||
foo/2/bar
|
||||
foo/3/bar
|
||||
```
|
||||
|
||||
But not:
|
||||
|
||||
```
|
||||
baz/1/qux
|
||||
baz/2/qux
|
||||
baz/3/qux
|
||||
```
|
||||
|
||||
Braces can also be combined with [glob patterns](https://github.com/jonschlinkert/micromatch) to perform more advanced wildcard matching. For example, the pattern `*/{1..3}/*` would match any of following strings:
|
||||
|
||||
```
|
||||
foo/1/bar
|
||||
foo/2/bar
|
||||
foo/3/bar
|
||||
baz/1/qux
|
||||
baz/2/qux
|
||||
baz/3/qux
|
||||
```
|
||||
|
||||
## Brace matching pitfalls
|
||||
|
||||
Although brace patterns offer a user-friendly way of matching ranges or sets of strings, there are also some major disadvantages and potential risks you should be aware of.
|
||||
|
||||
### tldr
|
||||
|
||||
**"brace bombs"**
|
||||
|
||||
* brace expansion can eat up a huge amount of processing resources
|
||||
* as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially
|
||||
* users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!)
|
||||
|
||||
For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section.
|
||||
|
||||
### The solution
|
||||
|
||||
Jump to the [performance section](#performance) to see how Braces solves this problem in comparison to other libraries.
|
||||
|
||||
### Geometric complexity
|
||||
|
||||
At minimum, brace patterns with sets limited to two elements have quadradic or `O(n^2)` complexity. But the complexity of the algorithm increases exponentially as the number of sets, _and elements per set_, increases, which is `O(n^c)`.
|
||||
|
||||
For example, the following sets demonstrate quadratic (`O(n^2)`) complexity:
|
||||
|
||||
```
|
||||
{1,2}{3,4} => (2X2) => 13 14 23 24
|
||||
{1,2}{3,4}{5,6} => (2X2X2) => 135 136 145 146 235 236 245 246
|
||||
```
|
||||
|
||||
But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity:
|
||||
|
||||
```
|
||||
{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248
|
||||
249 257 258 259 267 268 269 347 348 349 357
|
||||
358 359 367 368 369
|
||||
```
|
||||
|
||||
Now, imagine how this complexity grows given that each element is a n-tuple:
|
||||
|
||||
```
|
||||
{1..100}{1..100} => (100X100) => 10,000 elements (38.4 kB)
|
||||
{1..100}{1..100}{1..100} => (100X100X100) => 1,000,000 elements (5.76 MB)
|
||||
```
|
||||
|
||||
Although these examples are clearly contrived, they demonstrate how brace patterns can quickly grow out of control.
|
||||
|
||||
**More information**
|
||||
|
||||
Interested in learning more about brace expansion?
|
||||
|
||||
* [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion)
|
||||
* [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion)
|
||||
* [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
|
||||
|
||||
</details>
|
||||
|
||||
## Performance
|
||||
|
||||
Braces is not only screaming fast, it's also more accurate the other brace expansion libraries.
|
||||
|
||||
### Better algorithms
|
||||
|
||||
Fortunately there is a solution to the ["brace bomb" problem](#brace-matching-pitfalls): _don't expand brace patterns into an array when they're used for matching_.
|
||||
|
||||
Instead, convert the pattern into an optimized regular expression. This is easier said than done, and braces is the only library that does this currently.
|
||||
|
||||
**The proof is in the numbers**
|
||||
|
||||
Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively.
|
||||
|
||||
| **Pattern** | **braces** | **[minimatch](https://github.com/isaacs/minimatch)** |
|
||||
| --- | --- | --- |
|
||||
| `{1..9007199254740991}`<sup class="footnote-ref"><a href="#fn1" id="fnref1">[1]</a></sup> | `298 B` (5ms 459μs) | N/A (freezes) |
|
||||
| `{1..1000000000000000}` | `41 B` (1ms 15μs) | N/A (freezes) |
|
||||
| `{1..100000000000000}` | `40 B` (890μs) | N/A (freezes) |
|
||||
| `{1..10000000000000}` | `39 B` (2ms 49μs) | N/A (freezes) |
|
||||
| `{1..1000000000000}` | `38 B` (608μs) | N/A (freezes) |
|
||||
| `{1..100000000000}` | `37 B` (397μs) | N/A (freezes) |
|
||||
| `{1..10000000000}` | `35 B` (983μs) | N/A (freezes) |
|
||||
| `{1..1000000000}` | `34 B` (798μs) | N/A (freezes) |
|
||||
| `{1..100000000}` | `33 B` (733μs) | N/A (freezes) |
|
||||
| `{1..10000000}` | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) |
|
||||
| `{1..1000000}` | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs) |
|
||||
| `{1..100000}` | `30 B` (950μs) | `588.89 kB` (146ms 921μs) |
|
||||
| `{1..10000}` | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs) |
|
||||
| `{1..1000}` | `28 B` (760μs) | `3.89 kB` (1ms 453μs) |
|
||||
| `{1..100}` | `22 B` (345μs) | `291 B` (196μs) |
|
||||
| `{1..10}` | `10 B` (533μs) | `20 B` (37μs) |
|
||||
| `{1..3}` | `7 B` (190μs) | `5 B` (27μs) |
|
||||
|
||||
### Faster algorithms
|
||||
|
||||
When you need expansion, braces is still much faster.
|
||||
|
||||
_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_
|
||||
|
||||
| **Pattern** | **braces** | **[minimatch](https://github.com/isaacs/minimatch)** |
|
||||
| --- | --- | --- |
|
||||
| `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) |
|
||||
| `{1..1000000}` | `6.89 MB` (458ms 576μs) | `6.89 MB` (1s 491ms 621μs) |
|
||||
| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) |
|
||||
| `{1..10000}` | `48.89 kB` (2ms 202μs) | `48.89 kB` (13ms 641μs) |
|
||||
| `{1..1000}` | `3.89 kB` (1ms 796μs) | `3.89 kB` (1ms 958μs) |
|
||||
| `{1..100}` | `291 B` (424μs) | `291 B` (211μs) |
|
||||
| `{1..10}` | `20 B` (487μs) | `20 B` (72μs) |
|
||||
| `{1..3}` | `5 B` (166μs) | `5 B` (27μs) |
|
||||
|
||||
If you'd like to run these comparisons yourself, see [test/support/generate.js](test/support/generate.js).
|
||||
|
||||
## Benchmarks
|
||||
|
||||
### Running benchmarks
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```bash
|
||||
npm i -d && npm benchmark
|
||||
```
|
||||
|
||||
### Latest results
|
||||
|
||||
```bash
|
||||
Benchmarking: (8 of 8)
|
||||
· combination-nested
|
||||
· combination
|
||||
· escaped
|
||||
· list-basic
|
||||
· list-multiple
|
||||
· no-braces
|
||||
· sequence-basic
|
||||
· sequence-multiple
|
||||
|
||||
# benchmark/fixtures/combination-nested.js (52 bytes)
|
||||
brace-expansion x 4,756 ops/sec ±1.09% (86 runs sampled)
|
||||
braces x 11,202,303 ops/sec ±1.06% (88 runs sampled)
|
||||
minimatch x 4,816 ops/sec ±0.99% (87 runs sampled)
|
||||
|
||||
fastest is braces
|
||||
|
||||
# benchmark/fixtures/combination.js (51 bytes)
|
||||
brace-expansion x 625 ops/sec ±0.87% (87 runs sampled)
|
||||
braces x 11,031,884 ops/sec ±0.72% (90 runs sampled)
|
||||
minimatch x 637 ops/sec ±0.84% (88 runs sampled)
|
||||
|
||||
fastest is braces
|
||||
|
||||
# benchmark/fixtures/escaped.js (44 bytes)
|
||||
brace-expansion x 163,325 ops/sec ±1.05% (87 runs sampled)
|
||||
braces x 10,655,071 ops/sec ±1.22% (88 runs sampled)
|
||||
minimatch x 147,495 ops/sec ±0.96% (88 runs sampled)
|
||||
|
||||
fastest is braces
|
||||
|
||||
# benchmark/fixtures/list-basic.js (40 bytes)
|
||||
brace-expansion x 99,726 ops/sec ±1.07% (83 runs sampled)
|
||||
braces x 10,596,584 ops/sec ±0.98% (88 runs sampled)
|
||||
minimatch x 100,069 ops/sec ±1.17% (86 runs sampled)
|
||||
|
||||
fastest is braces
|
||||
|
||||
# benchmark/fixtures/list-multiple.js (52 bytes)
|
||||
brace-expansion x 34,348 ops/sec ±1.08% (88 runs sampled)
|
||||
braces x 9,264,131 ops/sec ±1.12% (88 runs sampled)
|
||||
minimatch x 34,893 ops/sec ±0.87% (87 runs sampled)
|
||||
|
||||
fastest is braces
|
||||
|
||||
# benchmark/fixtures/no-braces.js (48 bytes)
|
||||
brace-expansion x 275,368 ops/sec ±1.18% (89 runs sampled)
|
||||
braces x 9,134,677 ops/sec ±0.95% (88 runs sampled)
|
||||
minimatch x 3,755,954 ops/sec ±1.13% (89 runs sampled)
|
||||
|
||||
fastest is braces
|
||||
|
||||
# benchmark/fixtures/sequence-basic.js (41 bytes)
|
||||
brace-expansion x 5,492 ops/sec ±1.35% (87 runs sampled)
|
||||
braces x 8,485,034 ops/sec ±1.28% (89 runs sampled)
|
||||
minimatch x 5,341 ops/sec ±1.17% (87 runs sampled)
|
||||
|
||||
fastest is braces
|
||||
|
||||
# benchmark/fixtures/sequence-multiple.js (51 bytes)
|
||||
brace-expansion x 116 ops/sec ±0.77% (77 runs sampled)
|
||||
braces x 9,445,118 ops/sec ±1.32% (84 runs sampled)
|
||||
minimatch x 109 ops/sec ±1.16% (76 runs sampled)
|
||||
|
||||
fastest is braces
|
||||
```
|
||||
|
||||
## About
|
||||
|
||||
<details>
|
||||
<summary><strong>Contributing</strong></summary>
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Running Tests</strong></summary>
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Building docs</strong></summary>
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Related projects
|
||||
|
||||
You might also be interested in these projects:
|
||||
|
||||
* [expand-brackets](https://www.npmjs.com/package/expand-brackets): Expand POSIX bracket expressions (character classes) in glob patterns. | [homepage](https://github.com/jonschlinkert/expand-brackets "Expand POSIX bracket expressions (character classes) in glob patterns.")
|
||||
* [extglob](https://www.npmjs.com/package/extglob): Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob… [more](https://github.com/micromatch/extglob) | [homepage](https://github.com/micromatch/extglob "Extended glob support for JavaScript. Adds (almost) the expressive power of regular expressions to glob patterns.")
|
||||
* [fill-range](https://www.npmjs.com/package/fill-range): Fill in a range of numbers or letters, optionally passing an increment or `step` to… [more](https://github.com/jonschlinkert/fill-range) | [homepage](https://github.com/jonschlinkert/fill-range "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`")
|
||||
* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/micromatch/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.")
|
||||
* [nanomatch](https://www.npmjs.com/package/nanomatch): Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash… [more](https://github.com/micromatch/nanomatch) | [homepage](https://github.com/micromatch/nanomatch "Fast, minimal glob matcher for node.js. Similar to micromatch, minimatch and multimatch, but complete Bash 4.3 wildcard support only (no support for exglobs, posix brackets or braces)")
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 188 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 4 | [doowb](https://github.com/doowb) |
|
||||
| 1 | [es128](https://github.com/es128) |
|
||||
| 1 | [eush77](https://github.com/eush77) |
|
||||
| 1 | [hemanth](https://github.com/hemanth) |
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [linkedin/in/jonschlinkert](https://linkedin.com/in/jonschlinkert)
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on February 17, 2018._
|
||||
|
||||
<hr class="footnotes-sep">
|
||||
<section class="footnotes">
|
||||
<ol class="footnotes-list">
|
||||
<li id="fn1" class="footnote-item">this is the largest safe integer allowed in JavaScript. <a href="#fnref1" class="footnote-backref">↩</a>
|
||||
|
||||
</li>
|
||||
</ol>
|
||||
</section>
|
318
node_modules/metro-core/node_modules/braces/index.js
generated
vendored
Normal file
318
node_modules/metro-core/node_modules/braces/index.js
generated
vendored
Normal file
@ -0,0 +1,318 @@
|
||||
'use strict';
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var toRegex = require('to-regex');
|
||||
var unique = require('array-unique');
|
||||
var extend = require('extend-shallow');
|
||||
|
||||
/**
|
||||
* Local dependencies
|
||||
*/
|
||||
|
||||
var compilers = require('./lib/compilers');
|
||||
var parsers = require('./lib/parsers');
|
||||
var Braces = require('./lib/braces');
|
||||
var utils = require('./lib/utils');
|
||||
var MAX_LENGTH = 1024 * 64;
|
||||
var cache = {};
|
||||
|
||||
/**
|
||||
* Convert the given `braces` pattern into a regex-compatible string. By default, only one string is generated for every input string. Set `options.expand` to true to return an array of patterns (similar to Bash or minimatch. Before using `options.expand`, it's recommended that you read the [performance notes](#performance)).
|
||||
*
|
||||
* ```js
|
||||
* var braces = require('braces');
|
||||
* console.log(braces('{a,b,c}'));
|
||||
* //=> ['(a|b|c)']
|
||||
*
|
||||
* console.log(braces('{a,b,c}', {expand: true}));
|
||||
* //=> ['a', 'b', 'c']
|
||||
* ```
|
||||
* @param {String} `str`
|
||||
* @param {Object} `options`
|
||||
* @return {String}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
function braces(pattern, options) {
|
||||
var key = utils.createKey(String(pattern), options);
|
||||
var arr = [];
|
||||
|
||||
var disabled = options && options.cache === false;
|
||||
if (!disabled && cache.hasOwnProperty(key)) {
|
||||
return cache[key];
|
||||
}
|
||||
|
||||
if (Array.isArray(pattern)) {
|
||||
for (var i = 0; i < pattern.length; i++) {
|
||||
arr.push.apply(arr, braces.create(pattern[i], options));
|
||||
}
|
||||
} else {
|
||||
arr = braces.create(pattern, options);
|
||||
}
|
||||
|
||||
if (options && options.nodupes === true) {
|
||||
arr = unique(arr);
|
||||
}
|
||||
|
||||
if (!disabled) {
|
||||
cache[key] = arr;
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expands a brace pattern into an array. This method is called by the main [braces](#braces) function when `options.expand` is true. Before using this method it's recommended that you read the [performance notes](#performance)) and advantages of using [.optimize](#optimize) instead.
|
||||
*
|
||||
* ```js
|
||||
* var braces = require('braces');
|
||||
* console.log(braces.expand('a/{b,c}/d'));
|
||||
* //=> ['a/b/d', 'a/c/d'];
|
||||
* ```
|
||||
* @param {String} `pattern` Brace pattern
|
||||
* @param {Object} `options`
|
||||
* @return {Array} Returns an array of expanded values.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.expand = function(pattern, options) {
|
||||
return braces.create(pattern, extend({}, options, {expand: true}));
|
||||
};
|
||||
|
||||
/**
|
||||
* Expands a brace pattern into a regex-compatible, optimized string. This method is called by the main [braces](#braces) function by default.
|
||||
*
|
||||
* ```js
|
||||
* var braces = require('braces');
|
||||
* console.log(braces.expand('a/{b,c}/d'));
|
||||
* //=> ['a/(b|c)/d']
|
||||
* ```
|
||||
* @param {String} `pattern` Brace pattern
|
||||
* @param {Object} `options`
|
||||
* @return {Array} Returns an array of expanded values.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.optimize = function(pattern, options) {
|
||||
return braces.create(pattern, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Processes a brace pattern and returns either an expanded array (if `options.expand` is true), a highly optimized regex-compatible string. This method is called by the main [braces](#braces) function.
|
||||
*
|
||||
* ```js
|
||||
* var braces = require('braces');
|
||||
* console.log(braces.create('user-{200..300}/project-{a,b,c}-{1..10}'))
|
||||
* //=> 'user-(20[0-9]|2[1-9][0-9]|300)/project-(a|b|c)-([1-9]|10)'
|
||||
* ```
|
||||
* @param {String} `pattern` Brace pattern
|
||||
* @param {Object} `options`
|
||||
* @return {Array} Returns an array of expanded values.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.create = function(pattern, options) {
|
||||
if (typeof pattern !== 'string') {
|
||||
throw new TypeError('expected a string');
|
||||
}
|
||||
|
||||
var maxLength = (options && options.maxLength) || MAX_LENGTH;
|
||||
if (pattern.length >= maxLength) {
|
||||
throw new Error('expected pattern to be less than ' + maxLength + ' characters');
|
||||
}
|
||||
|
||||
function create() {
|
||||
if (pattern === '' || pattern.length < 3) {
|
||||
return [pattern];
|
||||
}
|
||||
|
||||
if (utils.isEmptySets(pattern)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
if (utils.isQuotedString(pattern)) {
|
||||
return [pattern.slice(1, -1)];
|
||||
}
|
||||
|
||||
var proto = new Braces(options);
|
||||
var result = !options || options.expand !== true
|
||||
? proto.optimize(pattern, options)
|
||||
: proto.expand(pattern, options);
|
||||
|
||||
// get the generated pattern(s)
|
||||
var arr = result.output;
|
||||
|
||||
// filter out empty strings if specified
|
||||
if (options && options.noempty === true) {
|
||||
arr = arr.filter(Boolean);
|
||||
}
|
||||
|
||||
// filter out duplicates if specified
|
||||
if (options && options.nodupes === true) {
|
||||
arr = unique(arr);
|
||||
}
|
||||
|
||||
Object.defineProperty(arr, 'result', {
|
||||
enumerable: false,
|
||||
value: result
|
||||
});
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
return memoize('create', pattern, options, create);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a regular expression from the given string `pattern`.
|
||||
*
|
||||
* ```js
|
||||
* var braces = require('braces');
|
||||
*
|
||||
* console.log(braces.makeRe('id-{200..300}'));
|
||||
* //=> /^(?:id-(20[0-9]|2[1-9][0-9]|300))$/
|
||||
* ```
|
||||
* @param {String} `pattern` The pattern to convert to regex.
|
||||
* @param {Object} `options`
|
||||
* @return {RegExp}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.makeRe = function(pattern, options) {
|
||||
if (typeof pattern !== 'string') {
|
||||
throw new TypeError('expected a string');
|
||||
}
|
||||
|
||||
var maxLength = (options && options.maxLength) || MAX_LENGTH;
|
||||
if (pattern.length >= maxLength) {
|
||||
throw new Error('expected pattern to be less than ' + maxLength + ' characters');
|
||||
}
|
||||
|
||||
function makeRe() {
|
||||
var arr = braces(pattern, options);
|
||||
var opts = extend({strictErrors: false}, options);
|
||||
return toRegex(arr, opts);
|
||||
}
|
||||
|
||||
return memoize('makeRe', pattern, options, makeRe);
|
||||
};
|
||||
|
||||
/**
|
||||
* Parse the given `str` with the given `options`.
|
||||
*
|
||||
* ```js
|
||||
* var braces = require('braces');
|
||||
* var ast = braces.parse('a/{b,c}/d');
|
||||
* console.log(ast);
|
||||
* // { type: 'root',
|
||||
* // errors: [],
|
||||
* // input: 'a/{b,c}/d',
|
||||
* // nodes:
|
||||
* // [ { type: 'bos', val: '' },
|
||||
* // { type: 'text', val: 'a/' },
|
||||
* // { type: 'brace',
|
||||
* // nodes:
|
||||
* // [ { type: 'brace.open', val: '{' },
|
||||
* // { type: 'text', val: 'b,c' },
|
||||
* // { type: 'brace.close', val: '}' } ] },
|
||||
* // { type: 'text', val: '/d' },
|
||||
* // { type: 'eos', val: '' } ] }
|
||||
* ```
|
||||
* @param {String} `pattern` Brace pattern to parse
|
||||
* @param {Object} `options`
|
||||
* @return {Object} Returns an AST
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.parse = function(pattern, options) {
|
||||
var proto = new Braces(options);
|
||||
return proto.parse(pattern, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Compile the given `ast` or string with the given `options`.
|
||||
*
|
||||
* ```js
|
||||
* var braces = require('braces');
|
||||
* var ast = braces.parse('a/{b,c}/d');
|
||||
* console.log(braces.compile(ast));
|
||||
* // { options: { source: 'string' },
|
||||
* // state: {},
|
||||
* // compilers:
|
||||
* // { eos: [Function],
|
||||
* // noop: [Function],
|
||||
* // bos: [Function],
|
||||
* // brace: [Function],
|
||||
* // 'brace.open': [Function],
|
||||
* // text: [Function],
|
||||
* // 'brace.close': [Function] },
|
||||
* // output: [ 'a/(b|c)/d' ],
|
||||
* // ast:
|
||||
* // { ... },
|
||||
* // parsingErrors: [] }
|
||||
* ```
|
||||
* @param {Object|String} `ast` AST from [.parse](#parse). If a string is passed it will be parsed first.
|
||||
* @param {Object} `options`
|
||||
* @return {Object} Returns an object that has an `output` property with the compiled string.
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.compile = function(ast, options) {
|
||||
var proto = new Braces(options);
|
||||
return proto.compile(ast, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Clear the regex cache.
|
||||
*
|
||||
* ```js
|
||||
* braces.clearCache();
|
||||
* ```
|
||||
* @api public
|
||||
*/
|
||||
|
||||
braces.clearCache = function() {
|
||||
cache = braces.cache = {};
|
||||
};
|
||||
|
||||
/**
|
||||
* Memoize a generated regex or function. A unique key is generated
|
||||
* from the method name, pattern, and user-defined options. Set
|
||||
* options.memoize to false to disable.
|
||||
*/
|
||||
|
||||
function memoize(type, pattern, options, fn) {
|
||||
var key = utils.createKey(type + ':' + pattern, options);
|
||||
var disabled = options && options.cache === false;
|
||||
if (disabled) {
|
||||
braces.clearCache();
|
||||
return fn(pattern, options);
|
||||
}
|
||||
|
||||
if (cache.hasOwnProperty(key)) {
|
||||
return cache[key];
|
||||
}
|
||||
|
||||
var res = fn(pattern, options);
|
||||
cache[key] = res;
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* Expose `Braces` constructor and methods
|
||||
* @type {Function}
|
||||
*/
|
||||
|
||||
braces.Braces = Braces;
|
||||
braces.compilers = compilers;
|
||||
braces.parsers = parsers;
|
||||
braces.cache = cache;
|
||||
|
||||
/**
|
||||
* Expose `braces`
|
||||
* @type {Function}
|
||||
*/
|
||||
|
||||
module.exports = braces;
|
104
node_modules/metro-core/node_modules/braces/lib/braces.js
generated
vendored
Normal file
104
node_modules/metro-core/node_modules/braces/lib/braces.js
generated
vendored
Normal file
@ -0,0 +1,104 @@
|
||||
'use strict';
|
||||
|
||||
var extend = require('extend-shallow');
|
||||
var Snapdragon = require('snapdragon');
|
||||
var compilers = require('./compilers');
|
||||
var parsers = require('./parsers');
|
||||
var utils = require('./utils');
|
||||
|
||||
/**
|
||||
* Customize Snapdragon parser and renderer
|
||||
*/
|
||||
|
||||
function Braces(options) {
|
||||
this.options = extend({}, options);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize braces
|
||||
*/
|
||||
|
||||
Braces.prototype.init = function(options) {
|
||||
if (this.isInitialized) return;
|
||||
this.isInitialized = true;
|
||||
var opts = utils.createOptions({}, this.options, options);
|
||||
this.snapdragon = this.options.snapdragon || new Snapdragon(opts);
|
||||
this.compiler = this.snapdragon.compiler;
|
||||
this.parser = this.snapdragon.parser;
|
||||
|
||||
compilers(this.snapdragon, opts);
|
||||
parsers(this.snapdragon, opts);
|
||||
|
||||
/**
|
||||
* Call Snapdragon `.parse` method. When AST is returned, we check to
|
||||
* see if any unclosed braces are left on the stack and, if so, we iterate
|
||||
* over the stack and correct the AST so that compilers are called in the correct
|
||||
* order and unbalance braces are properly escaped.
|
||||
*/
|
||||
|
||||
utils.define(this.snapdragon, 'parse', function(pattern, options) {
|
||||
var parsed = Snapdragon.prototype.parse.apply(this, arguments);
|
||||
this.parser.ast.input = pattern;
|
||||
|
||||
var stack = this.parser.stack;
|
||||
while (stack.length) {
|
||||
addParent({type: 'brace.close', val: ''}, stack.pop());
|
||||
}
|
||||
|
||||
function addParent(node, parent) {
|
||||
utils.define(node, 'parent', parent);
|
||||
parent.nodes.push(node);
|
||||
}
|
||||
|
||||
// add non-enumerable parser reference
|
||||
utils.define(parsed, 'parser', this.parser);
|
||||
return parsed;
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Decorate `.parse` method
|
||||
*/
|
||||
|
||||
Braces.prototype.parse = function(ast, options) {
|
||||
if (ast && typeof ast === 'object' && ast.nodes) return ast;
|
||||
this.init(options);
|
||||
return this.snapdragon.parse(ast, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Decorate `.compile` method
|
||||
*/
|
||||
|
||||
Braces.prototype.compile = function(ast, options) {
|
||||
if (typeof ast === 'string') {
|
||||
ast = this.parse(ast, options);
|
||||
} else {
|
||||
this.init(options);
|
||||
}
|
||||
return this.snapdragon.compile(ast, options);
|
||||
};
|
||||
|
||||
/**
|
||||
* Expand
|
||||
*/
|
||||
|
||||
Braces.prototype.expand = function(pattern) {
|
||||
var ast = this.parse(pattern, {expand: true});
|
||||
return this.compile(ast, {expand: true});
|
||||
};
|
||||
|
||||
/**
|
||||
* Optimize
|
||||
*/
|
||||
|
||||
Braces.prototype.optimize = function(pattern) {
|
||||
var ast = this.parse(pattern, {optimize: true});
|
||||
return this.compile(ast, {optimize: true});
|
||||
};
|
||||
|
||||
/**
|
||||
* Expose `Braces`
|
||||
*/
|
||||
|
||||
module.exports = Braces;
|
282
node_modules/metro-core/node_modules/braces/lib/compilers.js
generated
vendored
Normal file
282
node_modules/metro-core/node_modules/braces/lib/compilers.js
generated
vendored
Normal file
@ -0,0 +1,282 @@
|
||||
'use strict';
|
||||
|
||||
var utils = require('./utils');
|
||||
|
||||
module.exports = function(braces, options) {
|
||||
braces.compiler
|
||||
|
||||
/**
|
||||
* bos
|
||||
*/
|
||||
|
||||
.set('bos', function() {
|
||||
if (this.output) return;
|
||||
this.ast.queue = isEscaped(this.ast) ? [this.ast.val] : [];
|
||||
this.ast.count = 1;
|
||||
})
|
||||
|
||||
/**
|
||||
* Square brackets
|
||||
*/
|
||||
|
||||
.set('bracket', function(node) {
|
||||
var close = node.close;
|
||||
var open = !node.escaped ? '[' : '\\[';
|
||||
var negated = node.negated;
|
||||
var inner = node.inner;
|
||||
|
||||
inner = inner.replace(/\\(?=[\\\w]|$)/g, '\\\\');
|
||||
if (inner === ']-') {
|
||||
inner = '\\]\\-';
|
||||
}
|
||||
|
||||
if (negated && inner.indexOf('.') === -1) {
|
||||
inner += '.';
|
||||
}
|
||||
if (negated && inner.indexOf('/') === -1) {
|
||||
inner += '/';
|
||||
}
|
||||
|
||||
var val = open + negated + inner + close;
|
||||
var queue = node.parent.queue;
|
||||
var last = utils.arrayify(queue.pop());
|
||||
|
||||
queue.push(utils.join(last, val));
|
||||
queue.push.apply(queue, []);
|
||||
})
|
||||
|
||||
/**
|
||||
* Brace
|
||||
*/
|
||||
|
||||
.set('brace', function(node) {
|
||||
node.queue = isEscaped(node) ? [node.val] : [];
|
||||
node.count = 1;
|
||||
return this.mapVisit(node.nodes);
|
||||
})
|
||||
|
||||
/**
|
||||
* Open
|
||||
*/
|
||||
|
||||
.set('brace.open', function(node) {
|
||||
node.parent.open = node.val;
|
||||
})
|
||||
|
||||
/**
|
||||
* Inner
|
||||
*/
|
||||
|
||||
.set('text', function(node) {
|
||||
var queue = node.parent.queue;
|
||||
var escaped = node.escaped;
|
||||
var segs = [node.val];
|
||||
|
||||
if (node.optimize === false) {
|
||||
options = utils.extend({}, options, {optimize: false});
|
||||
}
|
||||
|
||||
if (node.multiplier > 1) {
|
||||
node.parent.count *= node.multiplier;
|
||||
}
|
||||
|
||||
if (options.quantifiers === true && utils.isQuantifier(node.val)) {
|
||||
escaped = true;
|
||||
|
||||
} else if (node.val.length > 1) {
|
||||
if (isType(node.parent, 'brace') && !isEscaped(node)) {
|
||||
var expanded = utils.expand(node.val, options);
|
||||
segs = expanded.segs;
|
||||
|
||||
if (expanded.isOptimized) {
|
||||
node.parent.isOptimized = true;
|
||||
}
|
||||
|
||||
// if nothing was expanded, we probably have a literal brace
|
||||
if (!segs.length) {
|
||||
var val = (expanded.val || node.val);
|
||||
if (options.unescape !== false) {
|
||||
// unescape unexpanded brace sequence/set separators
|
||||
val = val.replace(/\\([,.])/g, '$1');
|
||||
// strip quotes
|
||||
val = val.replace(/["'`]/g, '');
|
||||
}
|
||||
|
||||
segs = [val];
|
||||
escaped = true;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (node.val === ',') {
|
||||
if (options.expand) {
|
||||
node.parent.queue.push(['']);
|
||||
segs = [''];
|
||||
} else {
|
||||
segs = ['|'];
|
||||
}
|
||||
} else {
|
||||
escaped = true;
|
||||
}
|
||||
|
||||
if (escaped && isType(node.parent, 'brace')) {
|
||||
if (node.parent.nodes.length <= 4 && node.parent.count === 1) {
|
||||
node.parent.escaped = true;
|
||||
} else if (node.parent.length <= 3) {
|
||||
node.parent.escaped = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasQueue(node.parent)) {
|
||||
node.parent.queue = segs;
|
||||
return;
|
||||
}
|
||||
|
||||
var last = utils.arrayify(queue.pop());
|
||||
if (node.parent.count > 1 && options.expand) {
|
||||
last = multiply(last, node.parent.count);
|
||||
node.parent.count = 1;
|
||||
}
|
||||
|
||||
queue.push(utils.join(utils.flatten(last), segs.shift()));
|
||||
queue.push.apply(queue, segs);
|
||||
})
|
||||
|
||||
/**
|
||||
* Close
|
||||
*/
|
||||
|
||||
.set('brace.close', function(node) {
|
||||
var queue = node.parent.queue;
|
||||
var prev = node.parent.parent;
|
||||
var last = prev.queue.pop();
|
||||
var open = node.parent.open;
|
||||
var close = node.val;
|
||||
|
||||
if (open && close && isOptimized(node, options)) {
|
||||
open = '(';
|
||||
close = ')';
|
||||
}
|
||||
|
||||
// if a close brace exists, and the previous segment is one character
|
||||
// don't wrap the result in braces or parens
|
||||
var ele = utils.last(queue);
|
||||
if (node.parent.count > 1 && options.expand) {
|
||||
ele = multiply(queue.pop(), node.parent.count);
|
||||
node.parent.count = 1;
|
||||
queue.push(ele);
|
||||
}
|
||||
|
||||
if (close && typeof ele === 'string' && ele.length === 1) {
|
||||
open = '';
|
||||
close = '';
|
||||
}
|
||||
|
||||
if ((isLiteralBrace(node, options) || noInner(node)) && !node.parent.hasEmpty) {
|
||||
queue.push(utils.join(open, queue.pop() || ''));
|
||||
queue = utils.flatten(utils.join(queue, close));
|
||||
}
|
||||
|
||||
if (typeof last === 'undefined') {
|
||||
prev.queue = [queue];
|
||||
} else {
|
||||
prev.queue.push(utils.flatten(utils.join(last, queue)));
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* eos
|
||||
*/
|
||||
|
||||
.set('eos', function(node) {
|
||||
if (this.input) return;
|
||||
|
||||
if (options.optimize !== false) {
|
||||
this.output = utils.last(utils.flatten(this.ast.queue));
|
||||
} else if (Array.isArray(utils.last(this.ast.queue))) {
|
||||
this.output = utils.flatten(this.ast.queue.pop());
|
||||
} else {
|
||||
this.output = utils.flatten(this.ast.queue);
|
||||
}
|
||||
|
||||
if (node.parent.count > 1 && options.expand) {
|
||||
this.output = multiply(this.output, node.parent.count);
|
||||
}
|
||||
|
||||
this.output = utils.arrayify(this.output);
|
||||
this.ast.queue = [];
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* Multiply the segments in the current brace level
|
||||
*/
|
||||
|
||||
function multiply(queue, n, options) {
|
||||
return utils.flatten(utils.repeat(utils.arrayify(queue), n));
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if `node` is escaped
|
||||
*/
|
||||
|
||||
function isEscaped(node) {
|
||||
return node.escaped === true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if regex parens should be used for sets. If the parent `type`
|
||||
* is not `brace`, then we're on a root node, which means we should never
|
||||
* expand segments and open/close braces should be `{}` (since this indicates
|
||||
* a brace is missing from the set)
|
||||
*/
|
||||
|
||||
function isOptimized(node, options) {
|
||||
if (node.parent.isOptimized) return true;
|
||||
return isType(node.parent, 'brace')
|
||||
&& !isEscaped(node.parent)
|
||||
&& options.expand !== true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the value in `node` should be wrapped in a literal brace.
|
||||
* @return {Boolean}
|
||||
*/
|
||||
|
||||
function isLiteralBrace(node, options) {
|
||||
return isEscaped(node.parent) || options.optimize !== false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given `node` does not have an inner value.
|
||||
* @return {Boolean}
|
||||
*/
|
||||
|
||||
function noInner(node, type) {
|
||||
if (node.parent.queue.length === 1) {
|
||||
return true;
|
||||
}
|
||||
var nodes = node.parent.nodes;
|
||||
return nodes.length === 3
|
||||
&& isType(nodes[0], 'brace.open')
|
||||
&& !isType(nodes[1], 'text')
|
||||
&& isType(nodes[2], 'brace.close');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given `node` is the given `type`
|
||||
* @return {Boolean}
|
||||
*/
|
||||
|
||||
function isType(node, type) {
|
||||
return typeof node !== 'undefined' && node.type === type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given `node` has a non-empty queue.
|
||||
* @return {Boolean}
|
||||
*/
|
||||
|
||||
function hasQueue(node) {
|
||||
return Array.isArray(node.queue) && node.queue.length;
|
||||
}
|
360
node_modules/metro-core/node_modules/braces/lib/parsers.js
generated
vendored
Normal file
360
node_modules/metro-core/node_modules/braces/lib/parsers.js
generated
vendored
Normal file
@ -0,0 +1,360 @@
|
||||
'use strict';
|
||||
|
||||
var Node = require('snapdragon-node');
|
||||
var utils = require('./utils');
|
||||
|
||||
/**
|
||||
* Braces parsers
|
||||
*/
|
||||
|
||||
module.exports = function(braces, options) {
|
||||
braces.parser
|
||||
.set('bos', function() {
|
||||
if (!this.parsed) {
|
||||
this.ast = this.nodes[0] = new Node(this.ast);
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* Character parsers
|
||||
*/
|
||||
|
||||
.set('escape', function() {
|
||||
var pos = this.position();
|
||||
var m = this.match(/^(?:\\(.)|\$\{)/);
|
||||
if (!m) return;
|
||||
|
||||
var prev = this.prev();
|
||||
var last = utils.last(prev.nodes);
|
||||
|
||||
var node = pos(new Node({
|
||||
type: 'text',
|
||||
multiplier: 1,
|
||||
val: m[0]
|
||||
}));
|
||||
|
||||
if (node.val === '\\\\') {
|
||||
return node;
|
||||
}
|
||||
|
||||
if (node.val === '${') {
|
||||
var str = this.input;
|
||||
var idx = -1;
|
||||
var ch;
|
||||
|
||||
while ((ch = str[++idx])) {
|
||||
this.consume(1);
|
||||
node.val += ch;
|
||||
if (ch === '\\') {
|
||||
node.val += str[++idx];
|
||||
continue;
|
||||
}
|
||||
if (ch === '}') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.options.unescape !== false) {
|
||||
node.val = node.val.replace(/\\([{}])/g, '$1');
|
||||
}
|
||||
|
||||
if (last.val === '"' && this.input.charAt(0) === '"') {
|
||||
last.val = node.val;
|
||||
this.consume(1);
|
||||
return;
|
||||
}
|
||||
|
||||
return concatNodes.call(this, pos, node, prev, options);
|
||||
})
|
||||
|
||||
/**
|
||||
* Brackets: "[...]" (basic, this is overridden by
|
||||
* other parsers in more advanced implementations)
|
||||
*/
|
||||
|
||||
.set('bracket', function() {
|
||||
var isInside = this.isInside('brace');
|
||||
var pos = this.position();
|
||||
var m = this.match(/^(?:\[([!^]?)([^\]]{2,}|\]-)(\]|[^*+?]+)|\[)/);
|
||||
if (!m) return;
|
||||
|
||||
var prev = this.prev();
|
||||
var val = m[0];
|
||||
var negated = m[1] ? '^' : '';
|
||||
var inner = m[2] || '';
|
||||
var close = m[3] || '';
|
||||
|
||||
if (isInside && prev.type === 'brace') {
|
||||
prev.text = prev.text || '';
|
||||
prev.text += val;
|
||||
}
|
||||
|
||||
var esc = this.input.slice(0, 2);
|
||||
if (inner === '' && esc === '\\]') {
|
||||
inner += esc;
|
||||
this.consume(2);
|
||||
|
||||
var str = this.input;
|
||||
var idx = -1;
|
||||
var ch;
|
||||
|
||||
while ((ch = str[++idx])) {
|
||||
this.consume(1);
|
||||
if (ch === ']') {
|
||||
close = ch;
|
||||
break;
|
||||
}
|
||||
inner += ch;
|
||||
}
|
||||
}
|
||||
|
||||
return pos(new Node({
|
||||
type: 'bracket',
|
||||
val: val,
|
||||
escaped: close !== ']',
|
||||
negated: negated,
|
||||
inner: inner,
|
||||
close: close
|
||||
}));
|
||||
})
|
||||
|
||||
/**
|
||||
* Empty braces (we capture these early to
|
||||
* speed up processing in the compiler)
|
||||
*/
|
||||
|
||||
.set('multiplier', function() {
|
||||
var isInside = this.isInside('brace');
|
||||
var pos = this.position();
|
||||
var m = this.match(/^\{((?:,|\{,+\})+)\}/);
|
||||
if (!m) return;
|
||||
|
||||
this.multiplier = true;
|
||||
var prev = this.prev();
|
||||
var val = m[0];
|
||||
|
||||
if (isInside && prev.type === 'brace') {
|
||||
prev.text = prev.text || '';
|
||||
prev.text += val;
|
||||
}
|
||||
|
||||
var node = pos(new Node({
|
||||
type: 'text',
|
||||
multiplier: 1,
|
||||
match: m,
|
||||
val: val
|
||||
}));
|
||||
|
||||
return concatNodes.call(this, pos, node, prev, options);
|
||||
})
|
||||
|
||||
/**
|
||||
* Open
|
||||
*/
|
||||
|
||||
.set('brace.open', function() {
|
||||
var pos = this.position();
|
||||
var m = this.match(/^\{(?!(?:[^\\}]?|,+)\})/);
|
||||
if (!m) return;
|
||||
|
||||
var prev = this.prev();
|
||||
var last = utils.last(prev.nodes);
|
||||
|
||||
// if the last parsed character was an extglob character
|
||||
// we need to _not optimize_ the brace pattern because
|
||||
// it might be mistaken for an extglob by a downstream parser
|
||||
if (last && last.val && isExtglobChar(last.val.slice(-1))) {
|
||||
last.optimize = false;
|
||||
}
|
||||
|
||||
var open = pos(new Node({
|
||||
type: 'brace.open',
|
||||
val: m[0]
|
||||
}));
|
||||
|
||||
var node = pos(new Node({
|
||||
type: 'brace',
|
||||
nodes: []
|
||||
}));
|
||||
|
||||
node.push(open);
|
||||
prev.push(node);
|
||||
this.push('brace', node);
|
||||
})
|
||||
|
||||
/**
|
||||
* Close
|
||||
*/
|
||||
|
||||
.set('brace.close', function() {
|
||||
var pos = this.position();
|
||||
var m = this.match(/^\}/);
|
||||
if (!m || !m[0]) return;
|
||||
|
||||
var brace = this.pop('brace');
|
||||
var node = pos(new Node({
|
||||
type: 'brace.close',
|
||||
val: m[0]
|
||||
}));
|
||||
|
||||
if (!this.isType(brace, 'brace')) {
|
||||
if (this.options.strict) {
|
||||
throw new Error('missing opening "{"');
|
||||
}
|
||||
node.type = 'text';
|
||||
node.multiplier = 0;
|
||||
node.escaped = true;
|
||||
return node;
|
||||
}
|
||||
|
||||
var prev = this.prev();
|
||||
var last = utils.last(prev.nodes);
|
||||
if (last.text) {
|
||||
var lastNode = utils.last(last.nodes);
|
||||
if (lastNode.val === ')' && /[!@*?+]\(/.test(last.text)) {
|
||||
var open = last.nodes[0];
|
||||
var text = last.nodes[1];
|
||||
if (open.type === 'brace.open' && text && text.type === 'text') {
|
||||
text.optimize = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (brace.nodes.length > 2) {
|
||||
var first = brace.nodes[1];
|
||||
if (first.type === 'text' && first.val === ',') {
|
||||
brace.nodes.splice(1, 1);
|
||||
brace.nodes.push(first);
|
||||
}
|
||||
}
|
||||
|
||||
brace.push(node);
|
||||
})
|
||||
|
||||
/**
|
||||
* Capture boundary characters
|
||||
*/
|
||||
|
||||
.set('boundary', function() {
|
||||
var pos = this.position();
|
||||
var m = this.match(/^[$^](?!\{)/);
|
||||
if (!m) return;
|
||||
return pos(new Node({
|
||||
type: 'text',
|
||||
val: m[0]
|
||||
}));
|
||||
})
|
||||
|
||||
/**
|
||||
* One or zero, non-comma characters wrapped in braces
|
||||
*/
|
||||
|
||||
.set('nobrace', function() {
|
||||
var isInside = this.isInside('brace');
|
||||
var pos = this.position();
|
||||
var m = this.match(/^\{[^,]?\}/);
|
||||
if (!m) return;
|
||||
|
||||
var prev = this.prev();
|
||||
var val = m[0];
|
||||
|
||||
if (isInside && prev.type === 'brace') {
|
||||
prev.text = prev.text || '';
|
||||
prev.text += val;
|
||||
}
|
||||
|
||||
return pos(new Node({
|
||||
type: 'text',
|
||||
multiplier: 0,
|
||||
val: val
|
||||
}));
|
||||
})
|
||||
|
||||
/**
|
||||
* Text
|
||||
*/
|
||||
|
||||
.set('text', function() {
|
||||
var isInside = this.isInside('brace');
|
||||
var pos = this.position();
|
||||
var m = this.match(/^((?!\\)[^${}[\]])+/);
|
||||
if (!m) return;
|
||||
|
||||
var prev = this.prev();
|
||||
var val = m[0];
|
||||
|
||||
if (isInside && prev.type === 'brace') {
|
||||
prev.text = prev.text || '';
|
||||
prev.text += val;
|
||||
}
|
||||
|
||||
var node = pos(new Node({
|
||||
type: 'text',
|
||||
multiplier: 1,
|
||||
val: val
|
||||
}));
|
||||
|
||||
return concatNodes.call(this, pos, node, prev, options);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the character is an extglob character.
|
||||
*/
|
||||
|
||||
function isExtglobChar(ch) {
|
||||
return ch === '!' || ch === '@' || ch === '*' || ch === '?' || ch === '+';
|
||||
}
|
||||
|
||||
/**
|
||||
* Combine text nodes, and calculate empty sets (`{,,}`)
|
||||
* @param {Function} `pos` Function to calculate node position
|
||||
* @param {Object} `node` AST node
|
||||
* @return {Object}
|
||||
*/
|
||||
|
||||
function concatNodes(pos, node, parent, options) {
|
||||
node.orig = node.val;
|
||||
var prev = this.prev();
|
||||
var last = utils.last(prev.nodes);
|
||||
var isEscaped = false;
|
||||
|
||||
if (node.val.length > 1) {
|
||||
var a = node.val.charAt(0);
|
||||
var b = node.val.slice(-1);
|
||||
|
||||
isEscaped = (a === '"' && b === '"')
|
||||
|| (a === "'" && b === "'")
|
||||
|| (a === '`' && b === '`');
|
||||
}
|
||||
|
||||
if (isEscaped && options.unescape !== false) {
|
||||
node.val = node.val.slice(1, node.val.length - 1);
|
||||
node.escaped = true;
|
||||
}
|
||||
|
||||
if (node.match) {
|
||||
var match = node.match[1];
|
||||
if (!match || match.indexOf('}') === -1) {
|
||||
match = node.match[0];
|
||||
}
|
||||
|
||||
// replace each set with a single ","
|
||||
var val = match.replace(/\{/g, ',').replace(/\}/g, '');
|
||||
node.multiplier *= val.length;
|
||||
node.val = '';
|
||||
}
|
||||
|
||||
var simpleText = last.type === 'text'
|
||||
&& last.multiplier === 1
|
||||
&& node.multiplier === 1
|
||||
&& node.val;
|
||||
|
||||
if (simpleText) {
|
||||
last.val += node.val;
|
||||
return;
|
||||
}
|
||||
|
||||
prev.push(node);
|
||||
}
|
343
node_modules/metro-core/node_modules/braces/lib/utils.js
generated
vendored
Normal file
343
node_modules/metro-core/node_modules/braces/lib/utils.js
generated
vendored
Normal file
@ -0,0 +1,343 @@
|
||||
'use strict';
|
||||
|
||||
var splitString = require('split-string');
|
||||
var utils = module.exports;
|
||||
|
||||
/**
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
utils.extend = require('extend-shallow');
|
||||
utils.flatten = require('arr-flatten');
|
||||
utils.isObject = require('isobject');
|
||||
utils.fillRange = require('fill-range');
|
||||
utils.repeat = require('repeat-element');
|
||||
utils.unique = require('array-unique');
|
||||
|
||||
utils.define = function(obj, key, val) {
|
||||
Object.defineProperty(obj, key, {
|
||||
writable: true,
|
||||
configurable: true,
|
||||
enumerable: false,
|
||||
value: val
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the given string contains only empty brace sets.
|
||||
*/
|
||||
|
||||
utils.isEmptySets = function(str) {
|
||||
return /^(?:\{,\})+$/.test(str);
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the given string contains only empty brace sets.
|
||||
*/
|
||||
|
||||
utils.isQuotedString = function(str) {
|
||||
var open = str.charAt(0);
|
||||
if (open === '\'' || open === '"' || open === '`') {
|
||||
return str.slice(-1) === open;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create the key to use for memoization. The unique key is generated
|
||||
* by iterating over the options and concatenating key-value pairs
|
||||
* to the pattern string.
|
||||
*/
|
||||
|
||||
utils.createKey = function(pattern, options) {
|
||||
var id = pattern;
|
||||
if (typeof options === 'undefined') {
|
||||
return id;
|
||||
}
|
||||
var keys = Object.keys(options);
|
||||
for (var i = 0; i < keys.length; i++) {
|
||||
var key = keys[i];
|
||||
id += ';' + key + '=' + String(options[key]);
|
||||
}
|
||||
return id;
|
||||
};
|
||||
|
||||
/**
|
||||
* Normalize options
|
||||
*/
|
||||
|
||||
utils.createOptions = function(options) {
|
||||
var opts = utils.extend.apply(null, arguments);
|
||||
if (typeof opts.expand === 'boolean') {
|
||||
opts.optimize = !opts.expand;
|
||||
}
|
||||
if (typeof opts.optimize === 'boolean') {
|
||||
opts.expand = !opts.optimize;
|
||||
}
|
||||
if (opts.optimize === true) {
|
||||
opts.makeRe = true;
|
||||
}
|
||||
return opts;
|
||||
};
|
||||
|
||||
/**
|
||||
* Join patterns in `a` to patterns in `b`
|
||||
*/
|
||||
|
||||
utils.join = function(a, b, options) {
|
||||
options = options || {};
|
||||
a = utils.arrayify(a);
|
||||
b = utils.arrayify(b);
|
||||
|
||||
if (!a.length) return b;
|
||||
if (!b.length) return a;
|
||||
|
||||
var len = a.length;
|
||||
var idx = -1;
|
||||
var arr = [];
|
||||
|
||||
while (++idx < len) {
|
||||
var val = a[idx];
|
||||
if (Array.isArray(val)) {
|
||||
for (var i = 0; i < val.length; i++) {
|
||||
val[i] = utils.join(val[i], b, options);
|
||||
}
|
||||
arr.push(val);
|
||||
continue;
|
||||
}
|
||||
|
||||
for (var j = 0; j < b.length; j++) {
|
||||
var bval = b[j];
|
||||
|
||||
if (Array.isArray(bval)) {
|
||||
arr.push(utils.join(val, bval, options));
|
||||
} else {
|
||||
arr.push(val + bval);
|
||||
}
|
||||
}
|
||||
}
|
||||
return arr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Split the given string on `,` if not escaped.
|
||||
*/
|
||||
|
||||
utils.split = function(str, options) {
|
||||
var opts = utils.extend({sep: ','}, options);
|
||||
if (typeof opts.keepQuotes !== 'boolean') {
|
||||
opts.keepQuotes = true;
|
||||
}
|
||||
if (opts.unescape === false) {
|
||||
opts.keepEscaping = true;
|
||||
}
|
||||
return splitString(str, opts, utils.escapeBrackets(opts));
|
||||
};
|
||||
|
||||
/**
|
||||
* Expand ranges or sets in the given `pattern`.
|
||||
*
|
||||
* @param {String} `str`
|
||||
* @param {Object} `options`
|
||||
* @return {Object}
|
||||
*/
|
||||
|
||||
utils.expand = function(str, options) {
|
||||
var opts = utils.extend({rangeLimit: 10000}, options);
|
||||
var segs = utils.split(str, opts);
|
||||
var tok = { segs: segs };
|
||||
|
||||
if (utils.isQuotedString(str)) {
|
||||
return tok;
|
||||
}
|
||||
|
||||
if (opts.rangeLimit === true) {
|
||||
opts.rangeLimit = 10000;
|
||||
}
|
||||
|
||||
if (segs.length > 1) {
|
||||
if (opts.optimize === false) {
|
||||
tok.val = segs[0];
|
||||
return tok;
|
||||
}
|
||||
|
||||
tok.segs = utils.stringifyArray(tok.segs);
|
||||
} else if (segs.length === 1) {
|
||||
var arr = str.split('..');
|
||||
|
||||
if (arr.length === 1) {
|
||||
tok.val = tok.segs[tok.segs.length - 1] || tok.val || str;
|
||||
tok.segs = [];
|
||||
return tok;
|
||||
}
|
||||
|
||||
if (arr.length === 2 && arr[0] === arr[1]) {
|
||||
tok.escaped = true;
|
||||
tok.val = arr[0];
|
||||
tok.segs = [];
|
||||
return tok;
|
||||
}
|
||||
|
||||
if (arr.length > 1) {
|
||||
if (opts.optimize !== false) {
|
||||
opts.optimize = true;
|
||||
delete opts.expand;
|
||||
}
|
||||
|
||||
if (opts.optimize !== true) {
|
||||
var min = Math.min(arr[0], arr[1]);
|
||||
var max = Math.max(arr[0], arr[1]);
|
||||
var step = arr[2] || 1;
|
||||
|
||||
if (opts.rangeLimit !== false && ((max - min) / step >= opts.rangeLimit)) {
|
||||
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
|
||||
}
|
||||
}
|
||||
|
||||
arr.push(opts);
|
||||
tok.segs = utils.fillRange.apply(null, arr);
|
||||
|
||||
if (!tok.segs.length) {
|
||||
tok.escaped = true;
|
||||
tok.val = str;
|
||||
return tok;
|
||||
}
|
||||
|
||||
if (opts.optimize === true) {
|
||||
tok.segs = utils.stringifyArray(tok.segs);
|
||||
}
|
||||
|
||||
if (tok.segs === '') {
|
||||
tok.val = str;
|
||||
} else {
|
||||
tok.val = tok.segs[0];
|
||||
}
|
||||
return tok;
|
||||
}
|
||||
} else {
|
||||
tok.val = str;
|
||||
}
|
||||
return tok;
|
||||
};
|
||||
|
||||
/**
|
||||
* Ensure commas inside brackets and parens are not split.
|
||||
* @param {Object} `tok` Token from the `split-string` module
|
||||
* @return {undefined}
|
||||
*/
|
||||
|
||||
utils.escapeBrackets = function(options) {
|
||||
return function(tok) {
|
||||
if (tok.escaped && tok.val === 'b') {
|
||||
tok.val = '\\b';
|
||||
return;
|
||||
}
|
||||
|
||||
if (tok.val !== '(' && tok.val !== '[') return;
|
||||
var opts = utils.extend({}, options);
|
||||
var brackets = [];
|
||||
var parens = [];
|
||||
var stack = [];
|
||||
var val = tok.val;
|
||||
var str = tok.str;
|
||||
var i = tok.idx - 1;
|
||||
|
||||
while (++i < str.length) {
|
||||
var ch = str[i];
|
||||
|
||||
if (ch === '\\') {
|
||||
val += (opts.keepEscaping === false ? '' : ch) + str[++i];
|
||||
continue;
|
||||
}
|
||||
|
||||
if (ch === '(') {
|
||||
parens.push(ch);
|
||||
stack.push(ch);
|
||||
}
|
||||
|
||||
if (ch === '[') {
|
||||
brackets.push(ch);
|
||||
stack.push(ch);
|
||||
}
|
||||
|
||||
if (ch === ')') {
|
||||
parens.pop();
|
||||
stack.pop();
|
||||
if (!stack.length) {
|
||||
val += ch;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ch === ']') {
|
||||
brackets.pop();
|
||||
stack.pop();
|
||||
if (!stack.length) {
|
||||
val += ch;
|
||||
break;
|
||||
}
|
||||
}
|
||||
val += ch;
|
||||
}
|
||||
|
||||
tok.split = false;
|
||||
tok.val = val.slice(1);
|
||||
tok.idx = i;
|
||||
};
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the given string looks like a regex quantifier
|
||||
* @return {Boolean}
|
||||
*/
|
||||
|
||||
utils.isQuantifier = function(str) {
|
||||
return /^(?:[0-9]?,[0-9]|[0-9],)$/.test(str);
|
||||
};
|
||||
|
||||
/**
|
||||
* Cast `val` to an array.
|
||||
* @param {*} `val`
|
||||
*/
|
||||
|
||||
utils.stringifyArray = function(arr) {
|
||||
return [utils.arrayify(arr).join('|')];
|
||||
};
|
||||
|
||||
/**
|
||||
* Cast `val` to an array.
|
||||
* @param {*} `val`
|
||||
*/
|
||||
|
||||
utils.arrayify = function(arr) {
|
||||
if (typeof arr === 'undefined') {
|
||||
return [];
|
||||
}
|
||||
if (typeof arr === 'string') {
|
||||
return [arr];
|
||||
}
|
||||
return arr;
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if the given `str` is a non-empty string
|
||||
* @return {Boolean}
|
||||
*/
|
||||
|
||||
utils.isString = function(str) {
|
||||
return str != null && typeof str === 'string';
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the last element from `array`
|
||||
* @param {Array} `array`
|
||||
* @return {*}
|
||||
*/
|
||||
|
||||
utils.last = function(arr, n) {
|
||||
return arr[arr.length - (n || 1)];
|
||||
};
|
||||
|
||||
utils.escapeRegex = function(str) {
|
||||
return str.replace(/\\?([!^*?()[\]{}+?/])/g, '\\$1');
|
||||
};
|
21
node_modules/metro-core/node_modules/braces/node_modules/extend-shallow/LICENSE
generated
vendored
Normal file
21
node_modules/metro-core/node_modules/braces/node_modules/extend-shallow/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2015, Jon Schlinkert.
|
||||
|
||||
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.
|
61
node_modules/metro-core/node_modules/braces/node_modules/extend-shallow/README.md
generated
vendored
Normal file
61
node_modules/metro-core/node_modules/braces/node_modules/extend-shallow/README.md
generated
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
# extend-shallow [](http://badge.fury.io/js/extend-shallow) [](https://travis-ci.org/jonschlinkert/extend-shallow)
|
||||
|
||||
> Extend an object with the properties of additional objects. node.js/javascript util.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/)
|
||||
|
||||
```sh
|
||||
$ npm i extend-shallow --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var extend = require('extend-shallow');
|
||||
|
||||
extend({a: 'b'}, {c: 'd'})
|
||||
//=> {a: 'b', c: 'd'}
|
||||
```
|
||||
|
||||
Pass an empty object to shallow clone:
|
||||
|
||||
```js
|
||||
var obj = {};
|
||||
extend(obj, {a: 'b'}, {c: 'd'})
|
||||
//=> {a: 'b', c: 'd'}
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util.
|
||||
* [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own)
|
||||
* [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in)
|
||||
* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor.
|
||||
* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null.
|
||||
* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value.
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm i -d && npm test
|
||||
```
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2015 Jon Schlinkert
|
||||
Released under the MIT license.
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._
|
33
node_modules/metro-core/node_modules/braces/node_modules/extend-shallow/index.js
generated
vendored
Normal file
33
node_modules/metro-core/node_modules/braces/node_modules/extend-shallow/index.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
'use strict';
|
||||
|
||||
var isObject = require('is-extendable');
|
||||
|
||||
module.exports = function extend(o/*, objects*/) {
|
||||
if (!isObject(o)) { o = {}; }
|
||||
|
||||
var len = arguments.length;
|
||||
for (var i = 1; i < len; i++) {
|
||||
var obj = arguments[i];
|
||||
|
||||
if (isObject(obj)) {
|
||||
assign(o, obj);
|
||||
}
|
||||
}
|
||||
return o;
|
||||
};
|
||||
|
||||
function assign(a, b) {
|
||||
for (var key in b) {
|
||||
if (hasOwn(b, key)) {
|
||||
a[key] = b[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given `key` is an own property of `obj`.
|
||||
*/
|
||||
|
||||
function hasOwn(obj, key) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
56
node_modules/metro-core/node_modules/braces/node_modules/extend-shallow/package.json
generated
vendored
Normal file
56
node_modules/metro-core/node_modules/braces/node_modules/extend-shallow/package.json
generated
vendored
Normal file
@ -0,0 +1,56 @@
|
||||
{
|
||||
"name": "extend-shallow",
|
||||
"description": "Extend an object with the properties of additional objects. node.js/javascript util.",
|
||||
"version": "2.0.1",
|
||||
"homepage": "https://github.com/jonschlinkert/extend-shallow",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"repository": "jonschlinkert/extend-shallow",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/extend-shallow/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"is-extendable": "^0.1.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"array-slice": "^0.2.3",
|
||||
"benchmarked": "^0.1.4",
|
||||
"chalk": "^1.0.0",
|
||||
"for-own": "^0.1.3",
|
||||
"glob": "^5.0.12",
|
||||
"is-plain-object": "^2.0.1",
|
||||
"kind-of": "^2.0.0",
|
||||
"minimist": "^1.1.1",
|
||||
"mocha": "^2.2.5",
|
||||
"should": "^7.0.1"
|
||||
},
|
||||
"keywords": [
|
||||
"assign",
|
||||
"extend",
|
||||
"javascript",
|
||||
"js",
|
||||
"keys",
|
||||
"merge",
|
||||
"obj",
|
||||
"object",
|
||||
"prop",
|
||||
"properties",
|
||||
"property",
|
||||
"props",
|
||||
"shallow",
|
||||
"util",
|
||||
"utility",
|
||||
"utils",
|
||||
"value"
|
||||
]
|
||||
}
|
21
node_modules/metro-core/node_modules/braces/node_modules/is-extendable/LICENSE
generated
vendored
Normal file
21
node_modules/metro-core/node_modules/braces/node_modules/is-extendable/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2015, Jon Schlinkert.
|
||||
|
||||
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.
|
72
node_modules/metro-core/node_modules/braces/node_modules/is-extendable/README.md
generated
vendored
Normal file
72
node_modules/metro-core/node_modules/braces/node_modules/is-extendable/README.md
generated
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
# is-extendable [](http://badge.fury.io/js/is-extendable)
|
||||
|
||||
> Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. "can the value have keys?"
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/)
|
||||
|
||||
```sh
|
||||
$ npm i is-extendable --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var isExtendable = require('is-extendable');
|
||||
```
|
||||
|
||||
Returns true if the value is any of the following:
|
||||
|
||||
* `array`
|
||||
* `regexp`
|
||||
* `plain object`
|
||||
* `function`
|
||||
* `date`
|
||||
* `error`
|
||||
|
||||
## Notes
|
||||
|
||||
All objects in JavaScript can have keys, but it's a pain to check for this, since we ether need to verify that the value is not `null` or `undefined` and:
|
||||
|
||||
* the value is not a primitive, or
|
||||
* that the object is an `object`, `function`
|
||||
|
||||
Also note that an `extendable` object is not the same as an [extensible object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible), which is one that (in es6) is not sealed, frozen, or marked as non-extensible using `preventExtensions`.
|
||||
|
||||
## Related projects
|
||||
|
||||
* [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object.
|
||||
* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util.
|
||||
* [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null.
|
||||
* [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor.
|
||||
* [is-equal-shallow](https://github.com/jonschlinkert/is-equal-shallow): Does a shallow comparison of two objects, returning false if the keys or values differ.
|
||||
* [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value.
|
||||
|
||||
## Running tests
|
||||
|
||||
Install dev dependencies:
|
||||
|
||||
```sh
|
||||
$ npm i -d && npm test
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-extendable/issues/new)
|
||||
|
||||
## Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
+ [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
|
||||
|
||||
## License
|
||||
|
||||
Copyright © 2015 Jon Schlinkert
|
||||
Released under the MIT license.
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 04, 2015._
|
13
node_modules/metro-core/node_modules/braces/node_modules/is-extendable/index.js
generated
vendored
Normal file
13
node_modules/metro-core/node_modules/braces/node_modules/is-extendable/index.js
generated
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
/*!
|
||||
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
||||
*
|
||||
* Copyright (c) 2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function isExtendable(val) {
|
||||
return typeof val !== 'undefined' && val !== null
|
||||
&& (typeof val === 'object' || typeof val === 'function');
|
||||
};
|
51
node_modules/metro-core/node_modules/braces/node_modules/is-extendable/package.json
generated
vendored
Normal file
51
node_modules/metro-core/node_modules/braces/node_modules/is-extendable/package.json
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "is-extendable",
|
||||
"description": "Returns true if a value is any of the object types: array, regexp, plain object, function or date. This is useful for determining if a value can be extended, e.g. \"can the value have keys?\"",
|
||||
"version": "0.1.1",
|
||||
"homepage": "https://github.com/jonschlinkert/is-extendable",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"repository": "jonschlinkert/is-extendable",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/is-extendable/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "*"
|
||||
},
|
||||
"keywords": [
|
||||
"array",
|
||||
"assign",
|
||||
"check",
|
||||
"date",
|
||||
"extend",
|
||||
"extensible",
|
||||
"function",
|
||||
"is",
|
||||
"object",
|
||||
"regex",
|
||||
"test"
|
||||
],
|
||||
"verbiage": {
|
||||
"related": {
|
||||
"list": [
|
||||
"isobject",
|
||||
"is-plain-object",
|
||||
"kind-of",
|
||||
"is-extendable",
|
||||
"is-equal-shallow",
|
||||
"extend-shallow",
|
||||
"assign-deep"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
108
node_modules/metro-core/node_modules/braces/package.json
generated
vendored
Normal file
108
node_modules/metro-core/node_modules/braces/package.json
generated
vendored
Normal file
@ -0,0 +1,108 @@
|
||||
{
|
||||
"name": "braces",
|
||||
"description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.",
|
||||
"version": "2.3.2",
|
||||
"homepage": "https://github.com/micromatch/braces",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"contributors": [
|
||||
"Brian Woodward (https://twitter.com/doowb)",
|
||||
"Elan Shanker (https://github.com/es128)",
|
||||
"Eugene Sharygin (https://github.com/eush77)",
|
||||
"hemanth.hm (http://h3manth.com)",
|
||||
"Jon Schlinkert (http://twitter.com/jonschlinkert)"
|
||||
],
|
||||
"repository": "micromatch/braces",
|
||||
"bugs": {
|
||||
"url": "https://github.com/micromatch/braces/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js",
|
||||
"lib"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha",
|
||||
"benchmark": "node benchmark"
|
||||
},
|
||||
"dependencies": {
|
||||
"arr-flatten": "^1.1.0",
|
||||
"array-unique": "^0.3.2",
|
||||
"extend-shallow": "^2.0.1",
|
||||
"fill-range": "^4.0.0",
|
||||
"isobject": "^3.0.1",
|
||||
"repeat-element": "^1.1.2",
|
||||
"snapdragon": "^0.8.1",
|
||||
"snapdragon-node": "^2.0.1",
|
||||
"split-string": "^3.0.2",
|
||||
"to-regex": "^3.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ansi-cyan": "^0.1.1",
|
||||
"benchmarked": "^2.0.0",
|
||||
"brace-expansion": "^1.1.8",
|
||||
"cross-spawn": "^5.1.0",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-eslint": "^4.0.0",
|
||||
"gulp-format-md": "^1.0.0",
|
||||
"gulp-istanbul": "^1.1.2",
|
||||
"gulp-mocha": "^3.0.1",
|
||||
"gulp-unused": "^0.2.1",
|
||||
"is-windows": "^1.0.1",
|
||||
"minimatch": "^3.0.4",
|
||||
"mocha": "^3.2.0",
|
||||
"noncharacters": "^1.1.0",
|
||||
"text-table": "^0.2.0",
|
||||
"time-diff": "^0.3.1",
|
||||
"yargs-parser": "^8.0.0"
|
||||
},
|
||||
"keywords": [
|
||||
"alpha",
|
||||
"alphabetical",
|
||||
"bash",
|
||||
"brace",
|
||||
"braces",
|
||||
"expand",
|
||||
"expansion",
|
||||
"filepath",
|
||||
"fill",
|
||||
"fs",
|
||||
"glob",
|
||||
"globbing",
|
||||
"letter",
|
||||
"match",
|
||||
"matches",
|
||||
"matching",
|
||||
"number",
|
||||
"numerical",
|
||||
"path",
|
||||
"range",
|
||||
"ranges",
|
||||
"sh"
|
||||
],
|
||||
"verb": {
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
},
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"expand-brackets",
|
||||
"extglob",
|
||||
"fill-range",
|
||||
"micromatch",
|
||||
"nanomatch"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
21
node_modules/metro-core/node_modules/extend-shallow/LICENSE
generated
vendored
Normal file
21
node_modules/metro-core/node_modules/extend-shallow/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-2015, 2017, Jon Schlinkert.
|
||||
|
||||
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.
|
97
node_modules/metro-core/node_modules/extend-shallow/README.md
generated
vendored
Normal file
97
node_modules/metro-core/node_modules/extend-shallow/README.md
generated
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
# extend-shallow [](https://www.npmjs.com/package/extend-shallow) [](https://npmjs.org/package/extend-shallow) [](https://npmjs.org/package/extend-shallow) [](https://travis-ci.org/jonschlinkert/extend-shallow)
|
||||
|
||||
> Extend an object with the properties of additional objects. node.js/javascript util.
|
||||
|
||||
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
|
||||
|
||||
## Install
|
||||
|
||||
Install with [npm](https://www.npmjs.com/):
|
||||
|
||||
```sh
|
||||
$ npm install --save extend-shallow
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var extend = require('extend-shallow');
|
||||
|
||||
extend({a: 'b'}, {c: 'd'})
|
||||
//=> {a: 'b', c: 'd'}
|
||||
```
|
||||
|
||||
Pass an empty object to shallow clone:
|
||||
|
||||
```js
|
||||
var obj = {};
|
||||
extend(obj, {a: 'b'}, {c: 'd'})
|
||||
//=> {a: 'b', c: 'd'}
|
||||
```
|
||||
|
||||
## About
|
||||
|
||||
<details>
|
||||
<summary><strong>Contributing</strong></summary>
|
||||
|
||||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Running Tests</strong></summary>
|
||||
|
||||
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
||||
|
||||
```sh
|
||||
$ npm install && npm test
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><strong>Building docs</strong></summary>
|
||||
|
||||
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
||||
|
||||
To generate the readme, run the following command:
|
||||
|
||||
```sh
|
||||
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Related projects
|
||||
|
||||
You might also be interested in these projects:
|
||||
|
||||
* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow "Extend an object with the properties of additional objects. node.js/javascript util.")
|
||||
* [for-in](https://www.npmjs.com/package/for-in): Iterate over the own and inherited enumerable properties of an object, and return an object… [more](https://github.com/jonschlinkert/for-in) | [homepage](https://github.com/jonschlinkert/for-in "Iterate over the own and inherited enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js")
|
||||
* [for-own](https://www.npmjs.com/package/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own) | [homepage](https://github.com/jonschlinkert/for-own "Iterate over the own enumerable properties of an object, and return an object with properties that evaluate to true from the callback. Exit early by returning `false`. JavaScript/Node.js.")
|
||||
* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object "Returns true if an object was created by the `Object` constructor.")
|
||||
* [isobject](https://www.npmjs.com/package/isobject): Returns true if the value is an object and not an array or null. | [homepage](https://github.com/jonschlinkert/isobject "Returns true if the value is an object and not an array or null.")
|
||||
* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.")
|
||||
|
||||
### Contributors
|
||||
|
||||
| **Commits** | **Contributor** |
|
||||
| --- | --- |
|
||||
| 33 | [jonschlinkert](https://github.com/jonschlinkert) |
|
||||
| 1 | [pdehaan](https://github.com/pdehaan) |
|
||||
|
||||
### Author
|
||||
|
||||
**Jon Schlinkert**
|
||||
|
||||
* [github/jonschlinkert](https://github.com/jonschlinkert)
|
||||
* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)
|
||||
|
||||
### License
|
||||
|
||||
Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert).
|
||||
Released under the [MIT License](LICENSE).
|
||||
|
||||
***
|
||||
|
||||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.6.0, on November 19, 2017._
|
60
node_modules/metro-core/node_modules/extend-shallow/index.js
generated
vendored
Normal file
60
node_modules/metro-core/node_modules/extend-shallow/index.js
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
'use strict';
|
||||
|
||||
var isExtendable = require('is-extendable');
|
||||
var assignSymbols = require('assign-symbols');
|
||||
|
||||
module.exports = Object.assign || function(obj/*, objects*/) {
|
||||
if (obj === null || typeof obj === 'undefined') {
|
||||
throw new TypeError('Cannot convert undefined or null to object');
|
||||
}
|
||||
if (!isObject(obj)) {
|
||||
obj = {};
|
||||
}
|
||||
for (var i = 1; i < arguments.length; i++) {
|
||||
var val = arguments[i];
|
||||
if (isString(val)) {
|
||||
val = toObject(val);
|
||||
}
|
||||
if (isObject(val)) {
|
||||
assign(obj, val);
|
||||
assignSymbols(obj, val);
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
|
||||
function assign(a, b) {
|
||||
for (var key in b) {
|
||||
if (hasOwn(b, key)) {
|
||||
a[key] = b[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function isString(val) {
|
||||
return (val && typeof val === 'string');
|
||||
}
|
||||
|
||||
function toObject(str) {
|
||||
var obj = {};
|
||||
for (var i in str) {
|
||||
obj[i] = str[i];
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
function isObject(val) {
|
||||
return (val && typeof val === 'object') || isExtendable(val);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given `key` is an own property of `obj`.
|
||||
*/
|
||||
|
||||
function hasOwn(obj, key) {
|
||||
return Object.prototype.hasOwnProperty.call(obj, key);
|
||||
}
|
||||
|
||||
function isEnum(obj, key) {
|
||||
return Object.prototype.propertyIsEnumerable.call(obj, key);
|
||||
}
|
83
node_modules/metro-core/node_modules/extend-shallow/package.json
generated
vendored
Normal file
83
node_modules/metro-core/node_modules/extend-shallow/package.json
generated
vendored
Normal file
@ -0,0 +1,83 @@
|
||||
{
|
||||
"name": "extend-shallow",
|
||||
"description": "Extend an object with the properties of additional objects. node.js/javascript util.",
|
||||
"version": "3.0.2",
|
||||
"homepage": "https://github.com/jonschlinkert/extend-shallow",
|
||||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
|
||||
"contributors": [
|
||||
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
|
||||
"Peter deHaan (http://about.me/peterdehaan)"
|
||||
],
|
||||
"repository": "jonschlinkert/extend-shallow",
|
||||
"bugs": {
|
||||
"url": "https://github.com/jonschlinkert/extend-shallow/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"main": "index.js",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"assign-symbols": "^1.0.0",
|
||||
"is-extendable": "^1.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"array-slice": "^1.0.0",
|
||||
"benchmarked": "^2.0.0",
|
||||
"for-own": "^1.0.0",
|
||||
"gulp-format-md": "^1.0.0",
|
||||
"is-plain-object": "^2.0.4",
|
||||
"kind-of": "^6.0.1",
|
||||
"minimist": "^1.2.0",
|
||||
"mocha": "^3.5.3",
|
||||
"object-assign": "^4.1.1"
|
||||
},
|
||||
"keywords": [
|
||||
"assign",
|
||||
"clone",
|
||||
"extend",
|
||||
"merge",
|
||||
"obj",
|
||||
"object",
|
||||
"object-assign",
|
||||
"object.assign",
|
||||
"prop",
|
||||
"properties",
|
||||
"property",
|
||||
"props",
|
||||
"shallow",
|
||||
"util",
|
||||
"utility",
|
||||
"utils",
|
||||
"value"
|
||||
],
|
||||
"verb": {
|
||||
"toc": false,
|
||||
"layout": "default",
|
||||
"tasks": [
|
||||
"readme"
|
||||
],
|
||||
"related": {
|
||||
"list": [
|
||||
"extend-shallow",
|
||||
"for-in",
|
||||
"for-own",
|
||||
"is-plain-object",
|
||||
"isobject",
|
||||
"kind-of"
|
||||
]
|
||||
},
|
||||
"plugins": [
|
||||
"gulp-format-md"
|
||||
],
|
||||
"lint": {
|
||||
"reflinks": true
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user