new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [ljharb]
|
||||
patreon: # Replace with a single Patreon username
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
tidelift: npm/is-date-object
|
||||
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||
liberapay: # Replace with a single Liberapay username
|
||||
issuehunt: # Replace with a single IssueHunt username
|
||||
otechie: # Replace with a single Otechie username
|
||||
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||
@@ -0,0 +1,11 @@
|
||||
export function applyMixins(derivedCtor, baseCtors) {
|
||||
for (var i = 0, len = baseCtors.length; i < len; i++) {
|
||||
var baseCtor = baseCtors[i];
|
||||
var propertyKeys = Object.getOwnPropertyNames(baseCtor.prototype);
|
||||
for (var j = 0, len2 = propertyKeys.length; j < len2; j++) {
|
||||
var name_1 = propertyKeys[j];
|
||||
derivedCtor.prototype[name_1] = baseCtor.prototype[name_1];
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=applyMixins.js.map
|
||||
@@ -0,0 +1,59 @@
|
||||
"use strict"
|
||||
|
||||
// builtin tooling
|
||||
const path = require("path")
|
||||
|
||||
// placeholder tooling
|
||||
let sugarss
|
||||
|
||||
module.exports = function processContent(
|
||||
result,
|
||||
content,
|
||||
filename,
|
||||
options,
|
||||
postcss
|
||||
) {
|
||||
const { plugins } = options
|
||||
const ext = path.extname(filename)
|
||||
|
||||
const parserList = []
|
||||
|
||||
// SugarSS support:
|
||||
if (ext === ".sss") {
|
||||
if (!sugarss) {
|
||||
try {
|
||||
sugarss = require("sugarss")
|
||||
} catch {} // Ignore
|
||||
}
|
||||
if (sugarss)
|
||||
return runPostcss(postcss, content, filename, plugins, [sugarss])
|
||||
}
|
||||
|
||||
// Syntax support:
|
||||
if (result.opts.syntax && result.opts.syntax.parse) {
|
||||
parserList.push(result.opts.syntax.parse)
|
||||
}
|
||||
|
||||
// Parser support:
|
||||
if (result.opts.parser) parserList.push(result.opts.parser)
|
||||
// Try the default as a last resort:
|
||||
parserList.push(null)
|
||||
|
||||
return runPostcss(postcss, content, filename, plugins, parserList)
|
||||
}
|
||||
|
||||
function runPostcss(postcss, content, filename, plugins, parsers, index) {
|
||||
if (!index) index = 0
|
||||
return postcss(plugins)
|
||||
.process(content, {
|
||||
from: filename,
|
||||
parser: parsers[index],
|
||||
})
|
||||
.catch(err => {
|
||||
// If there's an error, try the next parser
|
||||
index++
|
||||
// If there are no parsers left, throw it
|
||||
if (index === parsers.length) throw err
|
||||
return runPostcss(postcss, content, filename, plugins, parsers, index)
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isAscii;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/* eslint-disable no-control-regex */
|
||||
var ascii = /^[\x00-\x7F]+$/;
|
||||
/* eslint-enable no-control-regex */
|
||||
|
||||
function isAscii(str) {
|
||||
(0, _assertString.default)(str);
|
||||
return ascii.test(str);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,74 @@
|
||||
var http = require('http');
|
||||
var https = require('https');
|
||||
var url = require('url');
|
||||
|
||||
var isHttpResource = require('../utils/is-http-resource');
|
||||
var isHttpsResource = require('../utils/is-https-resource');
|
||||
var override = require('../utils/override');
|
||||
|
||||
var HTTP_PROTOCOL = 'http:';
|
||||
|
||||
function loadRemoteResource(uri, inlineRequest, inlineTimeout, callback) {
|
||||
var proxyProtocol = inlineRequest.protocol || inlineRequest.hostname;
|
||||
var errorHandled = false;
|
||||
var requestOptions;
|
||||
var fetch;
|
||||
|
||||
requestOptions = override(
|
||||
url.parse(uri),
|
||||
inlineRequest || {}
|
||||
);
|
||||
|
||||
if (inlineRequest.hostname !== undefined) {
|
||||
// overwrite as we always expect a http proxy currently
|
||||
requestOptions.protocol = inlineRequest.protocol || HTTP_PROTOCOL;
|
||||
requestOptions.path = requestOptions.href;
|
||||
}
|
||||
|
||||
fetch = (proxyProtocol && !isHttpsResource(proxyProtocol)) || isHttpResource(uri) ?
|
||||
http.get :
|
||||
https.get;
|
||||
|
||||
fetch(requestOptions, function (res) {
|
||||
var chunks = [];
|
||||
var movedUri;
|
||||
|
||||
if (errorHandled) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (res.statusCode < 200 || res.statusCode > 399) {
|
||||
return callback(res.statusCode, null);
|
||||
} else if (res.statusCode > 299) {
|
||||
movedUri = url.resolve(uri, res.headers.location);
|
||||
return loadRemoteResource(movedUri, inlineRequest, inlineTimeout, callback);
|
||||
}
|
||||
|
||||
res.on('data', function (chunk) {
|
||||
chunks.push(chunk.toString());
|
||||
});
|
||||
res.on('end', function () {
|
||||
var body = chunks.join('');
|
||||
callback(null, body);
|
||||
});
|
||||
})
|
||||
.on('error', function (res) {
|
||||
if (errorHandled) {
|
||||
return;
|
||||
}
|
||||
|
||||
errorHandled = true;
|
||||
callback(res.message, null);
|
||||
})
|
||||
.on('timeout', function () {
|
||||
if (errorHandled) {
|
||||
return;
|
||||
}
|
||||
|
||||
errorHandled = true;
|
||||
callback('timeout', null);
|
||||
})
|
||||
.setTimeout(inlineTimeout);
|
||||
}
|
||||
|
||||
module.exports = loadRemoteResource;
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('conformsTo', require('../conformsTo'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"tmp","version":"0.0.33","files":{"package.json":{"checkedAt":1678883671213,"integrity":"sha512-4ddkuDscWIM1wHVm7+xKlCNnoh3owZk7yhXIVL1m2tXwKxTtheu0EZC90o9npKWDDnQSVOG45x2uQYmWVGTURQ==","mode":420,"size":751},"README.md":{"checkedAt":1678883671213,"integrity":"sha512-wcKYt35AxvNVtoPYSHEzJIeK9OpPjnOa+XBD7V6t9gONxqw9p63rzEfgbNAC1YxCowKjkcN+ZL7c5NGYyT9UtA==","mode":420,"size":9293},"LICENSE":{"checkedAt":1678883671215,"integrity":"sha512-gOe4xTF53LpustIrsiPrkrQIRsloP3h5F4RRS0lJHUe31twcqFYjyOHxinJrXu4fyFkzsOd9KXxLUQx+b40uSw==","mode":420,"size":1082},"lib/tmp.js":{"checkedAt":1678883671216,"integrity":"sha512-AhtEvoIrfFzef7hZ0AOTXjuQmh1hijU9CxtaZ5fMNZ+LuXjWIjEHEdtDyO350WYn67Y/GoZpuzpa9d3lL31sBg==","mode":420,"size":14895}}}
|
||||
@@ -0,0 +1,3 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('../5/CheckObjectCoercible');
|
||||
@@ -0,0 +1,40 @@
|
||||
// Stack grow safe implementation
|
||||
|
||||
"use strict";
|
||||
|
||||
var ensureValue = require("../../object/valid-value")
|
||||
, isArray = Array.isArray
|
||||
, objHasOwnProperty = Object.prototype.hasOwnProperty;
|
||||
|
||||
module.exports = function () {
|
||||
var input = ensureValue(this), index = 0, remaining, remainingIndexes, length, i, result = [];
|
||||
// Jslint: ignore
|
||||
main: while (input) {
|
||||
length = input.length;
|
||||
for (i = index; i < length; ++i) {
|
||||
if (!objHasOwnProperty.call(input, i)) continue;
|
||||
if (isArray(input[i])) {
|
||||
if (i < length - 1) {
|
||||
// eslint-disable-next-line max-depth
|
||||
if (!remaining) {
|
||||
remaining = [];
|
||||
remainingIndexes = [];
|
||||
}
|
||||
remaining.push(input);
|
||||
remainingIndexes.push(i + 1);
|
||||
}
|
||||
input = input[i];
|
||||
index = 0;
|
||||
continue main;
|
||||
}
|
||||
result.push(input[i]);
|
||||
}
|
||||
if (remaining) {
|
||||
input = remaining.pop();
|
||||
index = remainingIndexes.pop();
|
||||
} else {
|
||||
input = null;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
import { Stringifier } from './postcss.js'
|
||||
|
||||
declare const stringify: Stringifier
|
||||
|
||||
export default stringify
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
|
||||
var isCallable = require("./object/is-callable");
|
||||
|
||||
module.exports = function (value) {
|
||||
try {
|
||||
if (value && isCallable(value.toString)) return value.toString();
|
||||
return String(value);
|
||||
} catch (e) {
|
||||
return "<Non-coercible to string value>";
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,7 @@
|
||||
import { EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
|
||||
|
||||
declare function ensurePromise<T>(value: any, options?: EnsureBaseOptions): Promise<T>;
|
||||
declare function ensurePromise<T>(value: any, options?: EnsureBaseOptions & EnsureIsOptional): Promise<T> | null;
|
||||
declare function ensurePromise<T>(value: any, options?: EnsureBaseOptions & EnsureIsOptional & EnsureDefault<Promise<T>>): Promise<T>;
|
||||
|
||||
export default ensurePromise;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","2":"C K L G M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB EC FC","194":"BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB"},D:{"1":"uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB","322":"TB UB VB WB XB YB"},E:{"2":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"1":"MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB EB FB PC QC RC SC qB AC TC rB","322":"GB HB IB JB KB LB"},G:{"2":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"2":"oC"},I:{"1":"f","2":"tB I pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"1":"h","2":"A B C qB AC rB"},L:{"1":"H"},M:{"2":"H"},N:{"2":"A B"},O:{"1":"vC"},P:{"1":"g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C","2":"I"},Q:{"1":"1B"},R:{"1":"9C"},S:{"194":"AD BD"}},B:5,C:"ImageCapture API"};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,39 @@
|
||||
# is-obj [](https://travis-ci.org/sindresorhus/is-obj)
|
||||
|
||||
> Check if a value is an object
|
||||
|
||||
Keep in mind that array, function, regexp, etc, are objects in JavaScript.<br>
|
||||
See [`is-plain-obj`](https://github.com/sindresorhus/is-plain-obj) if you want to check for plain objects.
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install is-obj
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const isObject = require('is-obj');
|
||||
|
||||
isObject({foo: 'bar'});
|
||||
//=> true
|
||||
|
||||
isObject([1, 2, 3]);
|
||||
//=> true
|
||||
|
||||
isObject('foo');
|
||||
//=> false
|
||||
```
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [is](https://github.com/sindresorhus/is) - Type check values
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
||||
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Convert a typed array to a Buffer without a copy
|
||||
*
|
||||
* Author: Feross Aboukhadijeh <https://feross.org>
|
||||
* License: MIT
|
||||
*
|
||||
* `npm install typedarray-to-buffer`
|
||||
*/
|
||||
|
||||
var isTypedArray = require('is-typedarray').strict
|
||||
|
||||
module.exports = function typedarrayToBuffer (arr) {
|
||||
if (isTypedArray(arr)) {
|
||||
// To avoid a copy, use the typed array's underlying ArrayBuffer to back new Buffer
|
||||
var buf = Buffer.from(arr.buffer)
|
||||
if (arr.byteLength !== arr.buffer.byteLength) {
|
||||
// Respect the "view", i.e. byteOffset and byteLength, without doing a copy
|
||||
buf = buf.slice(arr.byteOffset, arr.byteOffset + arr.byteLength)
|
||||
}
|
||||
return buf
|
||||
} else {
|
||||
// Pass through all other types to `Buffer.from`
|
||||
return Buffer.from(arr)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/** Used to match `RegExp` flags from their coerced string values. */
|
||||
var reFlags = /\w*$/;
|
||||
|
||||
/**
|
||||
* Creates a clone of `regexp`.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} regexp The regexp to clone.
|
||||
* @returns {Object} Returns the cloned regexp.
|
||||
*/
|
||||
function cloneRegExp(regexp) {
|
||||
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
||||
result.lastIndex = regexp.lastIndex;
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = cloneRegExp;
|
||||
@@ -0,0 +1,158 @@
|
||||
import { EventEmitter } from 'node:events';
|
||||
import is from '@sindresorhus/is';
|
||||
import PCancelable from 'p-cancelable';
|
||||
import { HTTPError, RetryError, } from '../core/errors.js';
|
||||
import Request from '../core/index.js';
|
||||
import { parseBody, isResponseOk } from '../core/response.js';
|
||||
import proxyEvents from '../core/utils/proxy-events.js';
|
||||
import { CancelError } from './types.js';
|
||||
const proxiedRequestEvents = [
|
||||
'request',
|
||||
'response',
|
||||
'redirect',
|
||||
'uploadProgress',
|
||||
'downloadProgress',
|
||||
];
|
||||
export default function asPromise(firstRequest) {
|
||||
let globalRequest;
|
||||
let globalResponse;
|
||||
let normalizedOptions;
|
||||
const emitter = new EventEmitter();
|
||||
const promise = new PCancelable((resolve, reject, onCancel) => {
|
||||
onCancel(() => {
|
||||
globalRequest.destroy();
|
||||
});
|
||||
onCancel.shouldReject = false;
|
||||
onCancel(() => {
|
||||
reject(new CancelError(globalRequest));
|
||||
});
|
||||
const makeRequest = (retryCount) => {
|
||||
// Errors when a new request is made after the promise settles.
|
||||
// Used to detect a race condition.
|
||||
// See https://github.com/sindresorhus/got/issues/1489
|
||||
onCancel(() => { });
|
||||
const request = firstRequest ?? new Request(undefined, undefined, normalizedOptions);
|
||||
request.retryCount = retryCount;
|
||||
request._noPipe = true;
|
||||
globalRequest = request;
|
||||
request.once('response', async (response) => {
|
||||
// Parse body
|
||||
const contentEncoding = (response.headers['content-encoding'] ?? '').toLowerCase();
|
||||
const isCompressed = contentEncoding === 'gzip' || contentEncoding === 'deflate' || contentEncoding === 'br';
|
||||
const { options } = request;
|
||||
if (isCompressed && !options.decompress) {
|
||||
response.body = response.rawBody;
|
||||
}
|
||||
else {
|
||||
try {
|
||||
response.body = parseBody(response, options.responseType, options.parseJson, options.encoding);
|
||||
}
|
||||
catch (error) {
|
||||
// Fall back to `utf8`
|
||||
response.body = response.rawBody.toString();
|
||||
if (isResponseOk(response)) {
|
||||
request._beforeError(error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
const hooks = options.hooks.afterResponse;
|
||||
for (const [index, hook] of hooks.entries()) {
|
||||
// @ts-expect-error TS doesn't notice that CancelableRequest is a Promise
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
response = await hook(response, async (updatedOptions) => {
|
||||
options.merge(updatedOptions);
|
||||
options.prefixUrl = '';
|
||||
if (updatedOptions.url) {
|
||||
options.url = updatedOptions.url;
|
||||
}
|
||||
// Remove any further hooks for that request, because we'll call them anyway.
|
||||
// The loop continues. We don't want duplicates (asPromise recursion).
|
||||
options.hooks.afterResponse = options.hooks.afterResponse.slice(0, index);
|
||||
throw new RetryError(request);
|
||||
});
|
||||
if (!(is.object(response) && is.number(response.statusCode) && !is.nullOrUndefined(response.body))) {
|
||||
throw new TypeError('The `afterResponse` hook returned an invalid value');
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
request._beforeError(error);
|
||||
return;
|
||||
}
|
||||
globalResponse = response;
|
||||
if (!isResponseOk(response)) {
|
||||
request._beforeError(new HTTPError(response));
|
||||
return;
|
||||
}
|
||||
request.destroy();
|
||||
resolve(request.options.resolveBodyOnly ? response.body : response);
|
||||
});
|
||||
const onError = (error) => {
|
||||
if (promise.isCanceled) {
|
||||
return;
|
||||
}
|
||||
const { options } = request;
|
||||
if (error instanceof HTTPError && !options.throwHttpErrors) {
|
||||
const { response } = error;
|
||||
request.destroy();
|
||||
resolve(request.options.resolveBodyOnly ? response.body : response);
|
||||
return;
|
||||
}
|
||||
reject(error);
|
||||
};
|
||||
request.once('error', onError);
|
||||
const previousBody = request.options?.body;
|
||||
request.once('retry', (newRetryCount, error) => {
|
||||
firstRequest = undefined;
|
||||
const newBody = request.options.body;
|
||||
if (previousBody === newBody && is.nodeStream(newBody)) {
|
||||
error.message = 'Cannot retry with consumed body stream';
|
||||
onError(error);
|
||||
return;
|
||||
}
|
||||
// This is needed! We need to reuse `request.options` because they can get modified!
|
||||
// For example, by calling `promise.json()`.
|
||||
normalizedOptions = request.options;
|
||||
makeRequest(newRetryCount);
|
||||
});
|
||||
proxyEvents(request, emitter, proxiedRequestEvents);
|
||||
if (is.undefined(firstRequest)) {
|
||||
void request.flush();
|
||||
}
|
||||
};
|
||||
makeRequest(0);
|
||||
});
|
||||
promise.on = (event, fn) => {
|
||||
emitter.on(event, fn);
|
||||
return promise;
|
||||
};
|
||||
promise.off = (event, fn) => {
|
||||
emitter.off(event, fn);
|
||||
return promise;
|
||||
};
|
||||
const shortcut = (responseType) => {
|
||||
const newPromise = (async () => {
|
||||
// Wait until downloading has ended
|
||||
await promise;
|
||||
const { options } = globalResponse.request;
|
||||
return parseBody(globalResponse, responseType, options.parseJson, options.encoding);
|
||||
})();
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
Object.defineProperties(newPromise, Object.getOwnPropertyDescriptors(promise));
|
||||
return newPromise;
|
||||
};
|
||||
promise.json = () => {
|
||||
if (globalRequest.options) {
|
||||
const { headers } = globalRequest.options;
|
||||
if (!globalRequest.writableFinished && !('accept' in headers)) {
|
||||
headers.accept = 'application/json';
|
||||
}
|
||||
}
|
||||
return shortcut('json');
|
||||
};
|
||||
promise.buffer = () => shortcut('buffer');
|
||||
promise.text = () => shortcut('text');
|
||||
return promise;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
let list = require('postcss').list
|
||||
|
||||
let Value = require('../value')
|
||||
|
||||
class CrossFade extends Value {
|
||||
replace(string, prefix) {
|
||||
return list
|
||||
.space(string)
|
||||
.map(value => {
|
||||
if (value.slice(0, +this.name.length + 1) !== this.name + '(') {
|
||||
return value
|
||||
}
|
||||
|
||||
let close = value.lastIndexOf(')')
|
||||
let after = value.slice(close + 1)
|
||||
let args = value.slice(this.name.length + 1, close)
|
||||
|
||||
if (prefix === '-webkit-') {
|
||||
let match = args.match(/\d*.?\d+%?/)
|
||||
if (match) {
|
||||
args = args.slice(match[0].length).trim()
|
||||
args += `, ${match[0]}`
|
||||
} else {
|
||||
args += ', 0.5'
|
||||
}
|
||||
}
|
||||
return prefix + this.name + '(' + args + ')' + after
|
||||
})
|
||||
.join(' ')
|
||||
}
|
||||
}
|
||||
|
||||
CrossFade.names = ['cross-fade']
|
||||
|
||||
module.exports = CrossFade
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AsyncScheduler.d.ts","sourceRoot":"","sources":["../../../../src/internal/scheduler/AsyncScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,qBAAa,cAAe,SAAQ,SAAS;IACpC,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAM;gBAiBjC,eAAe,EAAE,OAAO,MAAM,EAAE,GAAG,GAAE,MAAM,MAAsB;IAItE,KAAK,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI;CA0B7C"}
|
||||
@@ -0,0 +1 @@
|
||||
node_modules
|
||||
@@ -0,0 +1,66 @@
|
||||
# :eight_spoked_asterisk: :stars: :sparkles: :dizzy: :star2: :star2: :sparkles: :dizzy: :star2: :star2: Contributing :star: :star2: :dizzy: :sparkles: :star: :star2: :dizzy: :sparkles: :stars: :eight_spoked_asterisk:
|
||||
|
||||
So, you want to contribute to this project! That's awesome. However, before
|
||||
doing so, please read the following simple steps how to contribute. This will
|
||||
make the life easier and will avoid wasting time on things which are not
|
||||
requested. :sparkles:
|
||||
|
||||
## Discuss the changes before doing them
|
||||
- First of all, open an issue in the repository, using the [bug tracker][1],
|
||||
describing the contribution you would like to make, the bug you found or any
|
||||
other ideas you have. This will help us to get you started on the right
|
||||
foot.
|
||||
|
||||
- If it makes sense, add the platform and software information (e.g. operating
|
||||
system, Node.JS version etc.), screenshots (so we can see what you are
|
||||
seeing).
|
||||
|
||||
- It is recommended to wait for feedback before continuing to next steps.
|
||||
However, if the issue is clear (e.g. a typo) and the fix is simple, you can
|
||||
continue and fix it.
|
||||
|
||||
## Fixing issues
|
||||
- Fork the project in your account and create a branch with your fix:
|
||||
`some-great-feature` or `some-issue-fix`.
|
||||
|
||||
- Commit your changes in that branch, writing the code following the
|
||||
[code style][2]. If the project contains tests (generally, the `test`
|
||||
directory), you are encouraged to add a test as well. :memo:
|
||||
|
||||
- If the project contains a `package.json` or a `bower.json` file add yourself
|
||||
in the `contributors` array (or `authors` in the case of `bower.json`;
|
||||
if the array does not exist, create it):
|
||||
|
||||
```json
|
||||
{
|
||||
"contributors": [
|
||||
"Your Name <and@email.address> (http://your.website)"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## Creating a pull request
|
||||
|
||||
- Open a pull request, and reference the initial issue in the pull request
|
||||
message (e.g. *fixes #<your-issue-number>*). Write a good description and
|
||||
title, so everybody will know what is fixed/improved.
|
||||
|
||||
- If it makes sense, add screenshots, gifs etc., so it is easier to see what
|
||||
is going on.
|
||||
|
||||
## Wait for feedback
|
||||
Before accepting your contributions, we will review them. You may get feedback
|
||||
about what should be fixed in your modified code. If so, just keep committing
|
||||
in your branch and the pull request will be updated automatically.
|
||||
|
||||
## Everyone is happy!
|
||||
Finally, your contributions will be merged, and everyone will be happy! :smile:
|
||||
Contributions are more than welcome!
|
||||
|
||||
Thanks! :sweat_smile:
|
||||
|
||||
|
||||
|
||||
[1]: https://github.com/IonicaBizau/node-is-ssh/issues
|
||||
|
||||
[2]: https://github.com/IonicaBizau/code-style
|
||||
@@ -0,0 +1,9 @@
|
||||
var compactable = require('../compactable');
|
||||
|
||||
function overridesNonComponentShorthand(property1, property2) {
|
||||
return property1.name in compactable &&
|
||||
'overridesShorthands' in compactable[property1.name] &&
|
||||
compactable[property1.name].overridesShorthands.indexOf(property2.name) > -1;
|
||||
}
|
||||
|
||||
module.exports = overridesNonComponentShorthand;
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function () {
|
||||
var trunc = Math.trunc;
|
||||
if (typeof trunc !== "function") return false;
|
||||
return trunc(13.67) === 13 && trunc(-13.67) === -13;
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
var chain = require('./chain');
|
||||
|
||||
/**
|
||||
* Creates a `lodash` wrapper instance with explicit method chain sequences enabled.
|
||||
*
|
||||
* @name chain
|
||||
* @memberOf _
|
||||
* @since 0.1.0
|
||||
* @category Seq
|
||||
* @returns {Object} Returns the new `lodash` wrapper instance.
|
||||
* @example
|
||||
*
|
||||
* var users = [
|
||||
* { 'user': 'barney', 'age': 36 },
|
||||
* { 'user': 'fred', 'age': 40 }
|
||||
* ];
|
||||
*
|
||||
* // A sequence without explicit chaining.
|
||||
* _(users).head();
|
||||
* // => { 'user': 'barney', 'age': 36 }
|
||||
*
|
||||
* // A sequence with explicit chaining.
|
||||
* _(users)
|
||||
* .chain()
|
||||
* .head()
|
||||
* .pick('user')
|
||||
* .value();
|
||||
* // => { 'user': 'barney' }
|
||||
*/
|
||||
function wrapperChain() {
|
||||
return chain(this);
|
||||
}
|
||||
|
||||
module.exports = wrapperChain;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.00243,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0.00243,"76":0,"77":0,"78":0.00243,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0.00243,"85":0,"86":0,"87":0,"88":0,"89":0.00243,"90":0,"91":0.00243,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0.00487,"103":0,"104":0.0146,"105":0,"106":0.0073,"107":0.00243,"108":0.06572,"109":0.18498,"110":0.09979,"111":0.00243,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0.00487,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.0073,"50":0.00243,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0.00487,"57":0,"58":0,"59":0.00243,"60":0,"61":0,"62":0,"63":0,"64":0.00243,"65":0.00487,"66":0,"67":0,"68":0.00243,"69":0,"70":0.00243,"71":0.00974,"72":0,"73":0,"74":0.0146,"75":0.00487,"76":0.00487,"77":0.00243,"78":0,"79":0.00243,"80":0.00487,"81":0.0073,"83":0.00243,"84":0.00243,"85":0,"86":0.00243,"87":0.00243,"88":0.00243,"89":0,"90":0.00487,"91":0.0073,"92":0.00974,"93":0.04138,"94":0.00974,"95":0,"96":0.00487,"97":0.00243,"98":0.00243,"99":0.00487,"100":0.00243,"101":0.00243,"102":0.00974,"103":0.04138,"104":0.00243,"105":0.00974,"106":0.00487,"107":0.02191,"108":0.05598,"109":1.06122,"110":0.71803,"111":0.01704,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0.00243,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0.00243,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0.00243,"58":0,"60":0.04625,"62":0,"63":0.05111,"64":0.02191,"65":0.04868,"66":0.07302,"67":0.18985,"68":0,"69":0,"70":0,"71":0,"72":0.0073,"73":0,"74":0.00487,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0.00243,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0.05355,"95":0.1071,"9.5-9.6":0,"10.0-10.1":0,"10.5":0.00243,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0.02191},B:{"12":0.0146,"13":0.00487,"14":0.0073,"15":0.00243,"16":0.0073,"17":0.00243,"18":0.02677,"79":0,"80":0,"81":0,"83":0,"84":0.00243,"85":0.00974,"86":0,"87":0,"88":0,"89":0.00243,"90":0.0073,"91":0,"92":0.0146,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0.00243,"100":0.00243,"101":0.00243,"102":0,"103":0.00243,"104":0.00487,"105":0.00243,"106":0.00243,"107":0.02191,"108":0.07545,"109":0.31642,"110":0.27504},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00487,"14":0.00243,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0.00243,"12.1":0.01217,"13.1":0.01704,"14.1":0.00974,"15.1":0.00243,"15.2-15.3":0.00243,"15.4":0,"15.5":0.00974,"15.6":0.01947,"16.0":0.00243,"16.1":0.00243,"16.2":0.03894,"16.3":0.01704,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0.00758,"7.0-7.1":0.00455,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.06216,"10.0-10.2":0,"10.3":0.04245,"11.0-11.2":0.00758,"11.3-11.4":0.02578,"12.0-12.1":3.92397,"12.2-12.5":1.03558,"13.0-13.1":0.42302,"13.2":0.01668,"13.3":0.12433,"13.4-13.7":0.4397,"14.0-14.4":0.9719,"14.5-14.8":1.0841,"15.0-15.1":0.46093,"15.2-15.3":0.56555,"15.4":0.41999,"15.5":0.50945,"15.6":0.78692,"16.0":0.53674,"16.1":1.36915,"16.2":0.70049,"16.3":1.00222,"16.4":0},P:{"4":0.02056,"20":0.2364,"5.0-5.4":0.03084,"6.2-6.4":0.01028,"7.2-7.4":0.05139,"8.2":0,"9.2":0.02056,"10.1":0,"11.1-11.2":0.13362,"12.0":0,"13.0":0.01028,"14.0":0.03084,"15.0":0.02056,"16.0":0.08223,"17.0":0.04111,"18.0":0.04111,"19.0":0.35974},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00644,"4.4":0,"4.4.3-4.4.4":0.10631},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0.00243,"11":0.00974,"5.5":0},N:{"10":0.01513,"11":0},S:{"2.5":0.18915,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.93062},H:{"0":6.8335},L:{"0":69.16245},R:{_:"0"},M:{"0":0.3783},Q:{"13.1":0}};
|
||||
@@ -0,0 +1,6 @@
|
||||
export type ResponseStatsOrgnisation = {
|
||||
id: number;
|
||||
name: string;
|
||||
distance: number;
|
||||
donationAmount: number;
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
module.exports = string => {
|
||||
const match = string.match(/^[ \t]*(?=\S)/gm);
|
||||
|
||||
if (!match) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
return match.reduce((r, a) => Math.min(r, a.length), Infinity);
|
||||
};
|
||||
@@ -0,0 +1,153 @@
|
||||
"use strict";
|
||||
|
||||
// Some environments don't have global Buffer (e.g. React Native).
|
||||
// Solution would be installing npm modules "buffer" and "stream" explicitly.
|
||||
var Buffer = require("safer-buffer").Buffer;
|
||||
|
||||
var bomHandling = require("./bom-handling"),
|
||||
iconv = module.exports;
|
||||
|
||||
// All codecs and aliases are kept here, keyed by encoding name/alias.
|
||||
// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`.
|
||||
iconv.encodings = null;
|
||||
|
||||
// Characters emitted in case of error.
|
||||
iconv.defaultCharUnicode = '<27>';
|
||||
iconv.defaultCharSingleByte = '?';
|
||||
|
||||
// Public API.
|
||||
iconv.encode = function encode(str, encoding, options) {
|
||||
str = "" + (str || ""); // Ensure string.
|
||||
|
||||
var encoder = iconv.getEncoder(encoding, options);
|
||||
|
||||
var res = encoder.write(str);
|
||||
var trail = encoder.end();
|
||||
|
||||
return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res;
|
||||
}
|
||||
|
||||
iconv.decode = function decode(buf, encoding, options) {
|
||||
if (typeof buf === 'string') {
|
||||
if (!iconv.skipDecodeWarning) {
|
||||
console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding');
|
||||
iconv.skipDecodeWarning = true;
|
||||
}
|
||||
|
||||
buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer.
|
||||
}
|
||||
|
||||
var decoder = iconv.getDecoder(encoding, options);
|
||||
|
||||
var res = decoder.write(buf);
|
||||
var trail = decoder.end();
|
||||
|
||||
return trail ? (res + trail) : res;
|
||||
}
|
||||
|
||||
iconv.encodingExists = function encodingExists(enc) {
|
||||
try {
|
||||
iconv.getCodec(enc);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Legacy aliases to convert functions
|
||||
iconv.toEncoding = iconv.encode;
|
||||
iconv.fromEncoding = iconv.decode;
|
||||
|
||||
// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache.
|
||||
iconv._codecDataCache = {};
|
||||
iconv.getCodec = function getCodec(encoding) {
|
||||
if (!iconv.encodings)
|
||||
iconv.encodings = require("../encodings"); // Lazy load all encoding definitions.
|
||||
|
||||
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
|
||||
var enc = iconv._canonicalizeEncoding(encoding);
|
||||
|
||||
// Traverse iconv.encodings to find actual codec.
|
||||
var codecOptions = {};
|
||||
while (true) {
|
||||
var codec = iconv._codecDataCache[enc];
|
||||
if (codec)
|
||||
return codec;
|
||||
|
||||
var codecDef = iconv.encodings[enc];
|
||||
|
||||
switch (typeof codecDef) {
|
||||
case "string": // Direct alias to other encoding.
|
||||
enc = codecDef;
|
||||
break;
|
||||
|
||||
case "object": // Alias with options. Can be layered.
|
||||
for (var key in codecDef)
|
||||
codecOptions[key] = codecDef[key];
|
||||
|
||||
if (!codecOptions.encodingName)
|
||||
codecOptions.encodingName = enc;
|
||||
|
||||
enc = codecDef.type;
|
||||
break;
|
||||
|
||||
case "function": // Codec itself.
|
||||
if (!codecOptions.encodingName)
|
||||
codecOptions.encodingName = enc;
|
||||
|
||||
// The codec function must load all tables and return object with .encoder and .decoder methods.
|
||||
// It'll be called only once (for each different options object).
|
||||
codec = new codecDef(codecOptions, iconv);
|
||||
|
||||
iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later.
|
||||
return codec;
|
||||
|
||||
default:
|
||||
throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
iconv._canonicalizeEncoding = function(encoding) {
|
||||
// Canonicalize encoding name: strip all non-alphanumeric chars and appended year.
|
||||
return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, "");
|
||||
}
|
||||
|
||||
iconv.getEncoder = function getEncoder(encoding, options) {
|
||||
var codec = iconv.getCodec(encoding),
|
||||
encoder = new codec.encoder(options, codec);
|
||||
|
||||
if (codec.bomAware && options && options.addBOM)
|
||||
encoder = new bomHandling.PrependBOM(encoder, options);
|
||||
|
||||
return encoder;
|
||||
}
|
||||
|
||||
iconv.getDecoder = function getDecoder(encoding, options) {
|
||||
var codec = iconv.getCodec(encoding),
|
||||
decoder = new codec.decoder(options, codec);
|
||||
|
||||
if (codec.bomAware && !(options && options.stripBOM === false))
|
||||
decoder = new bomHandling.StripBOM(decoder, options);
|
||||
|
||||
return decoder;
|
||||
}
|
||||
|
||||
|
||||
// Load extensions in Node. All of them are omitted in Browserify build via 'browser' field in package.json.
|
||||
var nodeVer = typeof process !== 'undefined' && process.versions && process.versions.node;
|
||||
if (nodeVer) {
|
||||
|
||||
// Load streaming support in Node v0.10+
|
||||
var nodeVerArr = nodeVer.split(".").map(Number);
|
||||
if (nodeVerArr[0] > 0 || nodeVerArr[1] >= 10) {
|
||||
require("./streams")(iconv);
|
||||
}
|
||||
|
||||
// Load Node primitive extensions.
|
||||
require("./extend-node")(iconv);
|
||||
}
|
||||
|
||||
if ("Ā" != "\u0100") {
|
||||
console.error("iconv-lite warning: javascript files use encoding different from utf-8. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info.");
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../../../packages/ecma402-abstract/types/core.ts"],"names":[],"mappings":"AAAA,oBAAY,MAAM,GAAG,MAAM,CAAA;AAC3B,MAAM,WAAW,UAAU,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,CAAA;IACP,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,EAAE,CAAC,EAAE,MAAM,CAAA;CACZ"}
|
||||
@@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
withAlphaValue: ()=>withAlphaValue,
|
||||
default: ()=>withAlphaVariable
|
||||
});
|
||||
const _color = require("./color");
|
||||
function withAlphaValue(color, alphaValue, defaultValue) {
|
||||
if (typeof color === "function") {
|
||||
return color({
|
||||
opacityValue: alphaValue
|
||||
});
|
||||
}
|
||||
let parsed = (0, _color.parseColor)(color, {
|
||||
loose: true
|
||||
});
|
||||
if (parsed === null) {
|
||||
return defaultValue;
|
||||
}
|
||||
return (0, _color.formatColor)({
|
||||
...parsed,
|
||||
alpha: alphaValue
|
||||
});
|
||||
}
|
||||
function withAlphaVariable({ color , property , variable }) {
|
||||
let properties = [].concat(property);
|
||||
if (typeof color === "function") {
|
||||
return {
|
||||
[variable]: "1",
|
||||
...Object.fromEntries(properties.map((p)=>{
|
||||
return [
|
||||
p,
|
||||
color({
|
||||
opacityVariable: variable,
|
||||
opacityValue: `var(${variable})`
|
||||
})
|
||||
];
|
||||
}))
|
||||
};
|
||||
}
|
||||
const parsed = (0, _color.parseColor)(color);
|
||||
if (parsed === null) {
|
||||
return Object.fromEntries(properties.map((p)=>[
|
||||
p,
|
||||
color
|
||||
]));
|
||||
}
|
||||
if (parsed.alpha !== undefined) {
|
||||
// Has an alpha value, return color as-is
|
||||
return Object.fromEntries(properties.map((p)=>[
|
||||
p,
|
||||
color
|
||||
]));
|
||||
}
|
||||
return {
|
||||
[variable]: "1",
|
||||
...Object.fromEntries(properties.map((p)=>{
|
||||
return [
|
||||
p,
|
||||
(0, _color.formatColor)({
|
||||
...parsed,
|
||||
alpha: `var(${variable})`
|
||||
})
|
||||
];
|
||||
}))
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
'use strict';
|
||||
const align = {
|
||||
right: alignRight,
|
||||
center: alignCenter
|
||||
};
|
||||
const top = 0;
|
||||
const right = 1;
|
||||
const bottom = 2;
|
||||
const left = 3;
|
||||
export class UI {
|
||||
constructor(opts) {
|
||||
var _a;
|
||||
this.width = opts.width;
|
||||
this.wrap = (_a = opts.wrap) !== null && _a !== void 0 ? _a : true;
|
||||
this.rows = [];
|
||||
}
|
||||
span(...args) {
|
||||
const cols = this.div(...args);
|
||||
cols.span = true;
|
||||
}
|
||||
resetOutput() {
|
||||
this.rows = [];
|
||||
}
|
||||
div(...args) {
|
||||
if (args.length === 0) {
|
||||
this.div('');
|
||||
}
|
||||
if (this.wrap && this.shouldApplyLayoutDSL(...args) && typeof args[0] === 'string') {
|
||||
return this.applyLayoutDSL(args[0]);
|
||||
}
|
||||
const cols = args.map(arg => {
|
||||
if (typeof arg === 'string') {
|
||||
return this.colFromString(arg);
|
||||
}
|
||||
return arg;
|
||||
});
|
||||
this.rows.push(cols);
|
||||
return cols;
|
||||
}
|
||||
shouldApplyLayoutDSL(...args) {
|
||||
return args.length === 1 && typeof args[0] === 'string' &&
|
||||
/[\t\n]/.test(args[0]);
|
||||
}
|
||||
applyLayoutDSL(str) {
|
||||
const rows = str.split('\n').map(row => row.split('\t'));
|
||||
let leftColumnWidth = 0;
|
||||
// simple heuristic for layout, make sure the
|
||||
// second column lines up along the left-hand.
|
||||
// don't allow the first column to take up more
|
||||
// than 50% of the screen.
|
||||
rows.forEach(columns => {
|
||||
if (columns.length > 1 && mixin.stringWidth(columns[0]) > leftColumnWidth) {
|
||||
leftColumnWidth = Math.min(Math.floor(this.width * 0.5), mixin.stringWidth(columns[0]));
|
||||
}
|
||||
});
|
||||
// generate a table:
|
||||
// replacing ' ' with padding calculations.
|
||||
// using the algorithmically generated width.
|
||||
rows.forEach(columns => {
|
||||
this.div(...columns.map((r, i) => {
|
||||
return {
|
||||
text: r.trim(),
|
||||
padding: this.measurePadding(r),
|
||||
width: (i === 0 && columns.length > 1) ? leftColumnWidth : undefined
|
||||
};
|
||||
}));
|
||||
});
|
||||
return this.rows[this.rows.length - 1];
|
||||
}
|
||||
colFromString(text) {
|
||||
return {
|
||||
text,
|
||||
padding: this.measurePadding(text)
|
||||
};
|
||||
}
|
||||
measurePadding(str) {
|
||||
// measure padding without ansi escape codes
|
||||
const noAnsi = mixin.stripAnsi(str);
|
||||
return [0, noAnsi.match(/\s*$/)[0].length, 0, noAnsi.match(/^\s*/)[0].length];
|
||||
}
|
||||
toString() {
|
||||
const lines = [];
|
||||
this.rows.forEach(row => {
|
||||
this.rowToString(row, lines);
|
||||
});
|
||||
// don't display any lines with the
|
||||
// hidden flag set.
|
||||
return lines
|
||||
.filter(line => !line.hidden)
|
||||
.map(line => line.text)
|
||||
.join('\n');
|
||||
}
|
||||
rowToString(row, lines) {
|
||||
this.rasterize(row).forEach((rrow, r) => {
|
||||
let str = '';
|
||||
rrow.forEach((col, c) => {
|
||||
const { width } = row[c]; // the width with padding.
|
||||
const wrapWidth = this.negatePadding(row[c]); // the width without padding.
|
||||
let ts = col; // temporary string used during alignment/padding.
|
||||
if (wrapWidth > mixin.stringWidth(col)) {
|
||||
ts += ' '.repeat(wrapWidth - mixin.stringWidth(col));
|
||||
}
|
||||
// align the string within its column.
|
||||
if (row[c].align && row[c].align !== 'left' && this.wrap) {
|
||||
const fn = align[row[c].align];
|
||||
ts = fn(ts, wrapWidth);
|
||||
if (mixin.stringWidth(ts) < wrapWidth) {
|
||||
ts += ' '.repeat((width || 0) - mixin.stringWidth(ts) - 1);
|
||||
}
|
||||
}
|
||||
// apply border and padding to string.
|
||||
const padding = row[c].padding || [0, 0, 0, 0];
|
||||
if (padding[left]) {
|
||||
str += ' '.repeat(padding[left]);
|
||||
}
|
||||
str += addBorder(row[c], ts, '| ');
|
||||
str += ts;
|
||||
str += addBorder(row[c], ts, ' |');
|
||||
if (padding[right]) {
|
||||
str += ' '.repeat(padding[right]);
|
||||
}
|
||||
// if prior row is span, try to render the
|
||||
// current row on the prior line.
|
||||
if (r === 0 && lines.length > 0) {
|
||||
str = this.renderInline(str, lines[lines.length - 1]);
|
||||
}
|
||||
});
|
||||
// remove trailing whitespace.
|
||||
lines.push({
|
||||
text: str.replace(/ +$/, ''),
|
||||
span: row.span
|
||||
});
|
||||
});
|
||||
return lines;
|
||||
}
|
||||
// if the full 'source' can render in
|
||||
// the target line, do so.
|
||||
renderInline(source, previousLine) {
|
||||
const match = source.match(/^ */);
|
||||
const leadingWhitespace = match ? match[0].length : 0;
|
||||
const target = previousLine.text;
|
||||
const targetTextWidth = mixin.stringWidth(target.trimRight());
|
||||
if (!previousLine.span) {
|
||||
return source;
|
||||
}
|
||||
// if we're not applying wrapping logic,
|
||||
// just always append to the span.
|
||||
if (!this.wrap) {
|
||||
previousLine.hidden = true;
|
||||
return target + source;
|
||||
}
|
||||
if (leadingWhitespace < targetTextWidth) {
|
||||
return source;
|
||||
}
|
||||
previousLine.hidden = true;
|
||||
return target.trimRight() + ' '.repeat(leadingWhitespace - targetTextWidth) + source.trimLeft();
|
||||
}
|
||||
rasterize(row) {
|
||||
const rrows = [];
|
||||
const widths = this.columnWidths(row);
|
||||
let wrapped;
|
||||
// word wrap all columns, and create
|
||||
// a data-structure that is easy to rasterize.
|
||||
row.forEach((col, c) => {
|
||||
// leave room for left and right padding.
|
||||
col.width = widths[c];
|
||||
if (this.wrap) {
|
||||
wrapped = mixin.wrap(col.text, this.negatePadding(col), { hard: true }).split('\n');
|
||||
}
|
||||
else {
|
||||
wrapped = col.text.split('\n');
|
||||
}
|
||||
if (col.border) {
|
||||
wrapped.unshift('.' + '-'.repeat(this.negatePadding(col) + 2) + '.');
|
||||
wrapped.push("'" + '-'.repeat(this.negatePadding(col) + 2) + "'");
|
||||
}
|
||||
// add top and bottom padding.
|
||||
if (col.padding) {
|
||||
wrapped.unshift(...new Array(col.padding[top] || 0).fill(''));
|
||||
wrapped.push(...new Array(col.padding[bottom] || 0).fill(''));
|
||||
}
|
||||
wrapped.forEach((str, r) => {
|
||||
if (!rrows[r]) {
|
||||
rrows.push([]);
|
||||
}
|
||||
const rrow = rrows[r];
|
||||
for (let i = 0; i < c; i++) {
|
||||
if (rrow[i] === undefined) {
|
||||
rrow.push('');
|
||||
}
|
||||
}
|
||||
rrow.push(str);
|
||||
});
|
||||
});
|
||||
return rrows;
|
||||
}
|
||||
negatePadding(col) {
|
||||
let wrapWidth = col.width || 0;
|
||||
if (col.padding) {
|
||||
wrapWidth -= (col.padding[left] || 0) + (col.padding[right] || 0);
|
||||
}
|
||||
if (col.border) {
|
||||
wrapWidth -= 4;
|
||||
}
|
||||
return wrapWidth;
|
||||
}
|
||||
columnWidths(row) {
|
||||
if (!this.wrap) {
|
||||
return row.map(col => {
|
||||
return col.width || mixin.stringWidth(col.text);
|
||||
});
|
||||
}
|
||||
let unset = row.length;
|
||||
let remainingWidth = this.width;
|
||||
// column widths can be set in config.
|
||||
const widths = row.map(col => {
|
||||
if (col.width) {
|
||||
unset--;
|
||||
remainingWidth -= col.width;
|
||||
return col.width;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
// any unset widths should be calculated.
|
||||
const unsetWidth = unset ? Math.floor(remainingWidth / unset) : 0;
|
||||
return widths.map((w, i) => {
|
||||
if (w === undefined) {
|
||||
return Math.max(unsetWidth, _minWidth(row[i]));
|
||||
}
|
||||
return w;
|
||||
});
|
||||
}
|
||||
}
|
||||
function addBorder(col, ts, style) {
|
||||
if (col.border) {
|
||||
if (/[.']-+[.']/.test(ts)) {
|
||||
return '';
|
||||
}
|
||||
if (ts.trim().length !== 0) {
|
||||
return style;
|
||||
}
|
||||
return ' ';
|
||||
}
|
||||
return '';
|
||||
}
|
||||
// calculates the minimum width of
|
||||
// a column, based on padding preferences.
|
||||
function _minWidth(col) {
|
||||
const padding = col.padding || [];
|
||||
const minWidth = 1 + (padding[left] || 0) + (padding[right] || 0);
|
||||
if (col.border) {
|
||||
return minWidth + 4;
|
||||
}
|
||||
return minWidth;
|
||||
}
|
||||
function getWindowWidth() {
|
||||
/* istanbul ignore next: depends on terminal */
|
||||
if (typeof process === 'object' && process.stdout && process.stdout.columns) {
|
||||
return process.stdout.columns;
|
||||
}
|
||||
return 80;
|
||||
}
|
||||
function alignRight(str, width) {
|
||||
str = str.trim();
|
||||
const strWidth = mixin.stringWidth(str);
|
||||
if (strWidth < width) {
|
||||
return ' '.repeat(width - strWidth) + str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function alignCenter(str, width) {
|
||||
str = str.trim();
|
||||
const strWidth = mixin.stringWidth(str);
|
||||
/* istanbul ignore next */
|
||||
if (strWidth >= width) {
|
||||
return str;
|
||||
}
|
||||
return ' '.repeat((width - strWidth) >> 1) + str;
|
||||
}
|
||||
let mixin;
|
||||
export function cliui(opts, _mixin) {
|
||||
mixin = _mixin;
|
||||
return new UI({
|
||||
width: (opts === null || opts === void 0 ? void 0 : opts.width) || getWindowWidth(),
|
||||
wrap: opts === null || opts === void 0 ? void 0 : opts.wrap
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "xregexp",
|
||||
"version": "2.0.0",
|
||||
"homepage": "http://xregexp.com/",
|
||||
"author": "Steven Levithan <steves_list@hotmail.com>",
|
||||
"license": "MIT",
|
||||
"repository" : {
|
||||
"type": "git",
|
||||
"url": "https://github.com/slevithan/XRegExp.git"
|
||||
},
|
||||
"description": "Extended JavaScript regular expressions",
|
||||
"keywords": ["regex", "regexp"],
|
||||
"main": "./xregexp-all.js",
|
||||
"scripts": {
|
||||
"test": "node tests/node-qunit.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"qunit": ">= 0.2.x"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
var parserMgr = require("./parserMgr.js");
|
||||
var CSVError = require("./CSVError");
|
||||
var numReg = /^[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?$/;
|
||||
/**
|
||||
* Convert lines of csv array into json
|
||||
* @param {[type]} lines [[col1,col2,col3]]
|
||||
* @param {[type]} params Converter params with _headers field populated
|
||||
* @param {[type]} idx start pos of the lines
|
||||
* @return {[type]} [{err:null,json:obj,index:line,row:[csv row]}]
|
||||
*/
|
||||
module.exports = function (lines, params, idx) {
|
||||
if (params._needParseJson) {
|
||||
if (!params._headers || !Array.isArray(params._headers)) {
|
||||
params._headers = [];
|
||||
}
|
||||
if (!params.parseRules) {
|
||||
var row = params._headers;
|
||||
params.parseRules = parserMgr.initParsers(row, params);
|
||||
}
|
||||
return processRows(lines, params, idx);
|
||||
} else {
|
||||
return justReturnRows(lines, params, idx);
|
||||
}
|
||||
};
|
||||
|
||||
function justReturnRows(lines, params, idx) {
|
||||
var rtn = [];
|
||||
for (var i = 0, len = lines.length; i < len; i++) {
|
||||
rtn.push({
|
||||
err: null,
|
||||
json: {},
|
||||
index: idx++,
|
||||
row: lines[i]
|
||||
});
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
function processRows(csvRows, params, startIndex) {
|
||||
var res = [];
|
||||
for (var i = 0, len = csvRows.length; i < len; i++) {
|
||||
var r = processRow(csvRows[i], params, startIndex++);
|
||||
if (r) {
|
||||
res.push(r);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
function processRow(row, param, index) {
|
||||
var parseRules = param.parseRules;
|
||||
if (param.checkColumn && row.length !== parseRules.length) {
|
||||
return {
|
||||
err: CSVError.column_mismatched(index)
|
||||
};
|
||||
}
|
||||
|
||||
var headRow = param._headers;
|
||||
var resultRow = convertRowToJson(row, headRow, param);
|
||||
if (resultRow) {
|
||||
return {
|
||||
json: resultRow,
|
||||
index: index,
|
||||
row: row
|
||||
};
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function convertRowToJson(row, headRow, param) {
|
||||
var hasValue = false;
|
||||
var resultRow = {};
|
||||
|
||||
for (var i = 0, len = row.length; i < len; i++) {
|
||||
var convertFunc, head, item;
|
||||
item = row[i];
|
||||
|
||||
if (param.ignoreEmpty && item === '') {
|
||||
continue;
|
||||
}
|
||||
hasValue = true;
|
||||
|
||||
head = headRow[i];
|
||||
if (!head || head === "") {
|
||||
head = headRow[i] = "field" + (i + 1);
|
||||
}
|
||||
var convFunc = getConvFunc(head, i, param);
|
||||
if (convFunc) {
|
||||
var convRes = convFunc(item, head, resultRow,row,i);
|
||||
if (convRes !== undefined) {
|
||||
setPath(resultRow, head, convRes);
|
||||
}
|
||||
} else {
|
||||
var flag = getFlag(head, i, param);
|
||||
if (flag === 'omit') {
|
||||
continue;
|
||||
}
|
||||
if (param.checkType) {
|
||||
convertFunc = checkType(item, head, i, param);
|
||||
item = convertFunc(item);
|
||||
}
|
||||
var title = getTitle(head, i, param);
|
||||
if (flag === 'flat' || param.flatKeys) {
|
||||
resultRow[title] = item;
|
||||
} else {
|
||||
setPath(resultRow, title, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (hasValue) {
|
||||
return resultRow;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var builtInConv={
|
||||
"string":stringType,
|
||||
"number":numberType,
|
||||
"omit":function(){}
|
||||
}
|
||||
function getConvFunc(head,i,param){
|
||||
if (param._columnConv[i] !== undefined){
|
||||
return param._columnConv[i];
|
||||
}else{
|
||||
var flag=param.colParser[head];
|
||||
if (flag === undefined){
|
||||
return param._columnConv[i]=false;
|
||||
}
|
||||
if (typeof flag ==="string"){
|
||||
flag=flag.trim().toLowerCase();
|
||||
var builtInFunc=builtInConv[flag];
|
||||
if (builtInFunc){
|
||||
return param._columnConv[i]=builtInFunc;
|
||||
}else{
|
||||
return param._columnConv[i]=false;
|
||||
}
|
||||
}else if (typeof flag ==="function"){
|
||||
return param._columnConv[i]=flag;
|
||||
}else{
|
||||
return param._columnConv[i]=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
function setPath(json, path, value) {
|
||||
var _set = require('lodash/set');
|
||||
var pathArr = path.split('.');
|
||||
if (pathArr.length === 1) {
|
||||
json[path] = value;
|
||||
} else {
|
||||
_set(json, path, value);
|
||||
}
|
||||
}
|
||||
|
||||
function getFlag(head, i, param) {
|
||||
if (typeof param._headerFlag[i] === "string") {
|
||||
return param._headerFlag[i];
|
||||
} else if (head.indexOf('*omit*') > -1) {
|
||||
return param._headerFlag[i] = 'omit';
|
||||
} else if (head.indexOf('*flat*') > -1) {
|
||||
return param._headerFlag[i] = 'flat';
|
||||
} else {
|
||||
return param._headerFlag[i] = '';
|
||||
}
|
||||
}
|
||||
|
||||
function getTitle(head, i, param) {
|
||||
if (param._headerTitle[i]) {
|
||||
return param._headerTitle[i];
|
||||
}
|
||||
|
||||
var flag = getFlag(head, i, param);
|
||||
var str = head.replace('*flat*', '').replace('string#!', '').replace('number#!', '');
|
||||
return param._headerTitle[i] = str;
|
||||
}
|
||||
|
||||
function checkType(item, head, headIdx, param) {
|
||||
if (param._headerType[headIdx]) {
|
||||
return param._headerType[headIdx];
|
||||
} else if (head.indexOf('number#!') > -1) {
|
||||
return param._headerType[headIdx] = numberType;
|
||||
} else if (head.indexOf('string#!') > -1) {
|
||||
return param._headerType[headIdx] = stringType;
|
||||
} else if (param.checkType) {
|
||||
return param._headerType[headIdx] = dynamicType;
|
||||
} else {
|
||||
return param._headerType[headIdx] = stringType;
|
||||
}
|
||||
}
|
||||
|
||||
function numberType(item) {
|
||||
var rtn = parseFloat(item);
|
||||
if (isNaN(rtn)) {
|
||||
return item;
|
||||
}
|
||||
return rtn;
|
||||
}
|
||||
|
||||
function stringType(item) {
|
||||
return item.toString();
|
||||
}
|
||||
|
||||
function dynamicType(item) {
|
||||
var trimed = item.trim();
|
||||
if (trimed === "") {
|
||||
return stringType(item);
|
||||
}
|
||||
if (numReg.test(trimed)) {
|
||||
return numberType(item);
|
||||
} else if (trimed.length === 5 && trimed.toLowerCase() === "false" || trimed.length === 4 && trimed.toLowerCase() === "true") {
|
||||
return booleanType(item);
|
||||
} else if (trimed[0] === "{" && trimed[trimed.length - 1] === "}" || trimed[0] === "[" && trimed[trimed.length - 1] === "]") {
|
||||
return jsonType(item);
|
||||
} else {
|
||||
return stringType(item);
|
||||
}
|
||||
}
|
||||
|
||||
function booleanType(item) {
|
||||
var trimed = item.trim();
|
||||
if (trimed.length === 5 && trimed.toLowerCase() === "false") {
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function jsonType(item) {
|
||||
try {
|
||||
return JSON.parse(item);
|
||||
} catch (e) {
|
||||
return item;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
const SemVer = require('../classes/semver')
|
||||
|
||||
const inc = (version, release, options, identifier) => {
|
||||
if (typeof (options) === 'string') {
|
||||
identifier = options
|
||||
options = undefined
|
||||
}
|
||||
|
||||
try {
|
||||
return new SemVer(
|
||||
version instanceof SemVer ? version.version : version,
|
||||
options
|
||||
).inc(release, identifier).version
|
||||
} catch (er) {
|
||||
return null
|
||||
}
|
||||
}
|
||||
module.exports = inc
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../../../src/internal/util/noop.ts"],"names":[],"mappings":"AACA,wBAAgB,IAAI,SAAM"}
|
||||
@@ -0,0 +1,39 @@
|
||||
"use strict";
|
||||
/***
|
||||
* Node External Editor
|
||||
*
|
||||
* Kevin Gravier <kevin@mrkmg.com>
|
||||
* MIT 2018
|
||||
*/
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var RemoveFileError = /** @class */ (function (_super) {
|
||||
__extends(RemoveFileError, _super);
|
||||
function RemoveFileError(originalError) {
|
||||
var _newTarget = this.constructor;
|
||||
var _this = _super.call(this, "Failed to cleanup temporary file") || this;
|
||||
_this.originalError = originalError;
|
||||
var proto = _newTarget.prototype;
|
||||
if (Object.setPrototypeOf) {
|
||||
Object.setPrototypeOf(_this, proto);
|
||||
}
|
||||
else {
|
||||
_this.__proto__ = _newTarget.prototype;
|
||||
}
|
||||
return _this;
|
||||
}
|
||||
return RemoveFileError;
|
||||
}(Error));
|
||||
exports.RemoveFileError = RemoveFileError;
|
||||
@@ -0,0 +1,43 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
{{#unless options.hideCredit}}
|
||||
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
|
||||
{{/unless}}
|
||||
|
||||
{{#each releases}}
|
||||
{{#if href}}
|
||||
## [{{title}}]({{href}}){{#if tag}} - {{isoDate}}{{/if}}
|
||||
{{else}}
|
||||
## {{title}}{{#if tag}} - {{isoDate}}{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{#if summary}}
|
||||
{{summary}}
|
||||
{{/if}}
|
||||
|
||||
{{#if merges}}
|
||||
### Merged
|
||||
|
||||
{{#each merges}}
|
||||
- {{#if commit.breaking}}**Breaking change:** {{/if}}{{message}} {{#if href}}[`#{{id}}`]({{href}}){{/if}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
|
||||
{{#if fixes}}
|
||||
### Fixed
|
||||
|
||||
{{#each fixes}}
|
||||
- {{#if commit.breaking}}**Breaking change:** {{/if}}{{commit.subject}}{{#each fixes}} {{#if href}}[`#{{id}}`]({{href}}){{/if}}{{/each}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
|
||||
{{#commit-list commits heading='### Commits'}}
|
||||
- {{#if breaking}}**Breaking change:** {{/if}}{{subject}} {{#if href}}[`{{shorthash}}`]({{href}}){{/if}}
|
||||
{{/commit-list}}
|
||||
|
||||
{{/each}}
|
||||
@@ -0,0 +1,55 @@
|
||||
{
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||
"name": "glob",
|
||||
"description": "a little globber",
|
||||
"version": "7.2.3",
|
||||
"publishConfig": {
|
||||
"tag": "v7-legacy"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/node-glob.git"
|
||||
},
|
||||
"main": "glob.js",
|
||||
"files": [
|
||||
"glob.js",
|
||||
"sync.js",
|
||||
"common.js"
|
||||
],
|
||||
"engines": {
|
||||
"node": "*"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs.realpath": "^1.0.0",
|
||||
"inflight": "^1.0.4",
|
||||
"inherits": "2",
|
||||
"minimatch": "^3.1.1",
|
||||
"once": "^1.3.0",
|
||||
"path-is-absolute": "^1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"memfs": "^3.2.0",
|
||||
"mkdirp": "0",
|
||||
"rimraf": "^2.2.8",
|
||||
"tap": "^15.0.6",
|
||||
"tick": "0.0.6"
|
||||
},
|
||||
"tap": {
|
||||
"before": "test/00-setup.js",
|
||||
"after": "test/zz-cleanup.js",
|
||||
"jobs": 1
|
||||
},
|
||||
"scripts": {
|
||||
"prepublish": "npm run benchclean",
|
||||
"profclean": "rm -f v8.log profile.txt",
|
||||
"test": "tap",
|
||||
"test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js",
|
||||
"bench": "bash benchmark.sh",
|
||||
"prof": "bash prof.sh && cat profile.txt",
|
||||
"benchclean": "node benchclean.js"
|
||||
},
|
||||
"license": "ISC",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var defined = require('../');
|
||||
|
||||
test('falsy', function (t) {
|
||||
t.plan(1);
|
||||
var opts = { y: false, w: 4 };
|
||||
var x = defined(opts.x, opts.y, opts.w, 8);
|
||||
t.equal(x, false);
|
||||
});
|
||||
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isRgbColor;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var rgbColor = /^rgb\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){2}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\)$/;
|
||||
var rgbaColor = /^rgba\((([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5]),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;
|
||||
var rgbColorPercent = /^rgb\((([0-9]%|[1-9][0-9]%|100%),){2}([0-9]%|[1-9][0-9]%|100%)\)$/;
|
||||
var rgbaColorPercent = /^rgba\((([0-9]%|[1-9][0-9]%|100%),){3}(0?\.\d|1(\.0)?|0(\.0)?)\)$/;
|
||||
|
||||
function isRgbColor(str) {
|
||||
var includePercentValues = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
||||
(0, _assertString.default)(str);
|
||||
|
||||
if (!includePercentValues) {
|
||||
return rgbColor.test(str) || rgbaColor.test(str);
|
||||
}
|
||||
|
||||
return rgbColor.test(str) || rgbaColor.test(str) || rgbColorPercent.test(str) || rgbaColorPercent.test(str);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"name": "is-array-buffer",
|
||||
"version": "3.0.2",
|
||||
"description": "Is this value a JS ArrayBuffer?",
|
||||
"main": "index.js",
|
||||
"exports": {
|
||||
".": "./index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"prepack": "npmignore --auto --commentLines=autogenerated",
|
||||
"prepublishOnly": "safe-publish-latest",
|
||||
"prepublish": "not-in-publish || npm run prepublishOnly",
|
||||
"lint": "eslint --ext=.js,.mjs .",
|
||||
"pretest": "npm run lint",
|
||||
"tests-only": "nyc tape 'test/**/*.js'",
|
||||
"test": "npm run tests-only --",
|
||||
"posttest": "aud --production",
|
||||
"version": "auto-changelog && git add CHANGELOG.md",
|
||||
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/inspect-js/is-array-buffer.git"
|
||||
},
|
||||
"keywords": [
|
||||
"javascript",
|
||||
"ecmascript",
|
||||
"is",
|
||||
"arraybuffer",
|
||||
"array",
|
||||
"buffer"
|
||||
],
|
||||
"author": "Jordan Harband <ljharb@gmail.com>",
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/ljharb"
|
||||
},
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/inspect-js/is-array-buffer/issues"
|
||||
},
|
||||
"homepage": "https://github.com/inspect-js/is-array-buffer#readme",
|
||||
"devDependencies": {
|
||||
"@ljharb/eslint-config": "^21.0.1",
|
||||
"aud": "^2.0.2",
|
||||
"auto-changelog": "^2.4.0",
|
||||
"available-typed-arrays": "^1.0.5",
|
||||
"es-value-fixtures": "^1.4.2",
|
||||
"eslint": "=8.8.0",
|
||||
"for-each": "^0.3.3",
|
||||
"in-publish": "^2.0.1",
|
||||
"npmignore": "^0.3.0",
|
||||
"nyc": "^10.3.2",
|
||||
"object-inspect": "^1.12.3",
|
||||
"safe-publish-latest": "^2.0.0",
|
||||
"tape": "^5.6.3"
|
||||
},
|
||||
"auto-changelog": {
|
||||
"output": "CHANGELOG.md",
|
||||
"template": "keepachangelog",
|
||||
"unreleased": false,
|
||||
"commitLimit": false,
|
||||
"backfillLimit": false,
|
||||
"hideCredit": true,
|
||||
"startingVersion": "2.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"call-bind": "^1.0.2",
|
||||
"get-intrinsic": "^1.2.0",
|
||||
"is-typed-array": "^1.1.10"
|
||||
},
|
||||
"publishConfig": {
|
||||
"ignore": [
|
||||
".github/workflows"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
'use strict'
|
||||
|
||||
const vendors = require('./vendors.json')
|
||||
|
||||
const env = process.env
|
||||
|
||||
// Used for testing only
|
||||
Object.defineProperty(exports, '_vendors', {
|
||||
value: vendors.map(function (v) {
|
||||
return v.constant
|
||||
})
|
||||
})
|
||||
|
||||
exports.name = null
|
||||
exports.isPR = null
|
||||
|
||||
vendors.forEach(function (vendor) {
|
||||
const envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env]
|
||||
const isCI = envs.every(function (obj) {
|
||||
return checkEnv(obj)
|
||||
})
|
||||
|
||||
exports[vendor.constant] = isCI
|
||||
|
||||
if (!isCI) {
|
||||
return
|
||||
}
|
||||
|
||||
exports.name = vendor.name
|
||||
|
||||
switch (typeof vendor.pr) {
|
||||
case 'string':
|
||||
// "pr": "CIRRUS_PR"
|
||||
exports.isPR = !!env[vendor.pr]
|
||||
break
|
||||
case 'object':
|
||||
if ('env' in vendor.pr) {
|
||||
// "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" }
|
||||
exports.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne
|
||||
} else if ('any' in vendor.pr) {
|
||||
// "pr": { "any": ["ghprbPullId", "CHANGE_ID"] }
|
||||
exports.isPR = vendor.pr.any.some(function (key) {
|
||||
return !!env[key]
|
||||
})
|
||||
} else {
|
||||
// "pr": { "DRONE_BUILD_EVENT": "pull_request" }
|
||||
exports.isPR = checkEnv(vendor.pr)
|
||||
}
|
||||
break
|
||||
default:
|
||||
// PR detection not supported for this vendor
|
||||
exports.isPR = null
|
||||
}
|
||||
})
|
||||
|
||||
exports.isCI = !!(
|
||||
env.CI !== 'false' && // Bypass all checks if CI env is explicitly set to 'false'
|
||||
(env.BUILD_ID || // Jenkins, Cloudbees
|
||||
env.BUILD_NUMBER || // Jenkins, TeamCity
|
||||
env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
|
||||
env.CI_APP_ID || // Appflow
|
||||
env.CI_BUILD_ID || // Appflow
|
||||
env.CI_BUILD_NUMBER || // Appflow
|
||||
env.CI_NAME || // Codeship and others
|
||||
env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
|
||||
env.RUN_ID || // TaskCluster, dsari
|
||||
exports.name ||
|
||||
false)
|
||||
)
|
||||
|
||||
function checkEnv (obj) {
|
||||
// "env": "CIRRUS"
|
||||
if (typeof obj === 'string') return !!env[obj]
|
||||
|
||||
// "env": { "env": "NODE", "includes": "/app/.heroku/node/bin/node" }
|
||||
if ('env' in obj) {
|
||||
// Currently there are no other types, uncomment when there are
|
||||
// if ('includes' in obj) {
|
||||
return env[obj.env] && env[obj.env].includes(obj.includes)
|
||||
// }
|
||||
}
|
||||
if ('any' in obj) {
|
||||
return obj.any.some(function (k) {
|
||||
return !!env[k]
|
||||
})
|
||||
}
|
||||
return Object.keys(obj).every(function (k) {
|
||||
return env[k] === obj[k]
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"animationFrame.js","sourceRoot":"","sources":["../../../../src/internal/scheduler/animationFrame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAkCpE,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;AAKzF,MAAM,CAAC,MAAM,cAAc,GAAG,uBAAuB,CAAC"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../src/internal/operators/filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAIrF,gHAAgH;AAChH,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3I,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,KAAK,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACnH,wBAAgB,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,kBAAkB,GAAG,gBAAgB,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AAChG,gHAAgH;AAChH,wBAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,EAAE,OAAO,EAAE,CAAC,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAC;AAChI,wBAAgB,MAAM,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,GAAG,wBAAwB,CAAC,CAAC,CAAC,CAAC"}
|
||||
@@ -0,0 +1,495 @@
|
||||
// Type definitions for UglifyJS 3.17
|
||||
// Project: https://github.com/mishoo/UglifyJS
|
||||
// Definitions by: Alan Agius <https://github.com/alan-agius4>
|
||||
// Tanguy Krotoff <https://github.com/tkrotoff>
|
||||
// John Reilly <https://github.com/johnnyreilly>
|
||||
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { RawSourceMap } from 'source-map';
|
||||
export interface ParseOptions {
|
||||
/**
|
||||
* Support top level `return` statements
|
||||
* @default false
|
||||
*/
|
||||
bare_returns?: boolean | undefined;
|
||||
/** @default true */
|
||||
html5_comments?: boolean | undefined;
|
||||
/**
|
||||
* Support `#!command` as the first line
|
||||
* @default true
|
||||
*/
|
||||
shebang?: boolean | undefined;
|
||||
}
|
||||
|
||||
export interface CompressOptions {
|
||||
/**
|
||||
* Replace `arguments[index]` with function parameter name whenever possible.
|
||||
* @default true
|
||||
*/
|
||||
arguments?: boolean | undefined;
|
||||
/**
|
||||
* Apply optimizations to assignment expressions
|
||||
* @default true
|
||||
*/
|
||||
assignments?: boolean | undefined;
|
||||
/**
|
||||
* Various optimizations for boolean context, for example `!!a ? b : c → a ? b : c`
|
||||
* @default true
|
||||
*/
|
||||
booleans?: boolean | undefined;
|
||||
/**
|
||||
* Collapse single-use non-constant variables, side effects permitting.
|
||||
* @default true
|
||||
*/
|
||||
collapse_vars?: boolean | undefined;
|
||||
/**
|
||||
* Apply certain optimizations to binary nodes, e.g. `!(a <= b) → a > b,` attempts to negate binary nodes, e.g. `a = !b && !c && !d && !e → a=!(b||c||d||e)` etc
|
||||
* @default true
|
||||
*/
|
||||
comparisons?: boolean | undefined;
|
||||
/**
|
||||
* Apply optimizations for `if-s` and conditional expressions.
|
||||
* @default true
|
||||
*/
|
||||
conditionals?: boolean | undefined;
|
||||
/**
|
||||
* Remove unreachable code
|
||||
* @default true
|
||||
*/
|
||||
dead_code?: boolean | undefined;
|
||||
/**
|
||||
* remove redundant or non-standard directives
|
||||
* @default true
|
||||
*/
|
||||
directives?: boolean | undefined;
|
||||
/**
|
||||
* Pass `true` to discard calls to console.* functions.
|
||||
* If you wish to drop a specific function call such as `console.info` and/or retain side effects from function
|
||||
* arguments after dropping the function call then use `pure_funcs` instead.
|
||||
* @default true
|
||||
*/
|
||||
drop_console?: boolean | undefined;
|
||||
/**
|
||||
* Remove `debugger;` statements
|
||||
* @default true
|
||||
*/
|
||||
drop_debugger?: boolean | undefined;
|
||||
/**
|
||||
* Attempt to evaluate constant expressions
|
||||
* @default true
|
||||
*/
|
||||
evaluate?: boolean | undefined;
|
||||
/**
|
||||
* Pass `true` to preserve completion values from terminal statements without `return`, e.g. in bookmarklets.
|
||||
* @default false
|
||||
*/
|
||||
expression?: boolean | undefined;
|
||||
/**
|
||||
* convert declarations from varto function whenever possible
|
||||
* @default true
|
||||
*/
|
||||
functions?: boolean | undefined;
|
||||
/**
|
||||
* @default {}
|
||||
*/
|
||||
global_defs?: object | undefined;
|
||||
/**
|
||||
* hoist function declarations
|
||||
* @default false
|
||||
*/
|
||||
|
||||
/**
|
||||
* hoist `export` statements to facilitate various `compress` and `mangle` optimizations.
|
||||
* @default true
|
||||
*/
|
||||
hoist_exports?: boolean | undefined;
|
||||
hoist_funs?: boolean | undefined;
|
||||
/**
|
||||
* Hoist properties from constant object and array literals into regular variables subject to a set of constraints.
|
||||
* For example: `var o={p:1, q:2}; f(o.p, o.q);` is converted to `f(1, 2);`. Note: `hoist_props` works best with mangle enabled,
|
||||
* the compress option passes set to 2 or higher, and the compress option toplevel enabled.
|
||||
* @default true
|
||||
*/
|
||||
hoist_props?: boolean | undefined;
|
||||
/**
|
||||
* Hoist var declarations (this is `false` by default because it seems to increase the size of the output in general)
|
||||
* @default false
|
||||
*/
|
||||
hoist_vars?: boolean | undefined;
|
||||
/**
|
||||
* Optimizations for if/return and if/continue
|
||||
* @default true
|
||||
*/
|
||||
if_return?: boolean | undefined;
|
||||
/**
|
||||
* drop unreferenced import symbols when used with `unused`
|
||||
* @default true
|
||||
*/
|
||||
imports?: boolean | undefined;
|
||||
/**
|
||||
* Inline calls to function with simple/return statement
|
||||
* - false -- same as `Disabled`
|
||||
* - `Disabled` -- disabled inlining
|
||||
* - `SimpleFunctions` -- inline simple functions
|
||||
* - `WithArguments` -- inline functions with arguments
|
||||
* - `WithArgumentsAndVariables` -- inline functions with arguments and variables
|
||||
* - true -- same as `WithArgumentsAndVariables`
|
||||
* @default true
|
||||
*/
|
||||
inline?: boolean | InlineFunctions | undefined;
|
||||
/**
|
||||
* join consecutive `var` statements
|
||||
* @default true
|
||||
*/
|
||||
join_vars?: boolean | undefined;
|
||||
/**
|
||||
* Prevents the compressor from discarding unused function arguments.
|
||||
* You need this for code which relies on `Function.length`
|
||||
* @default 'strict'
|
||||
*/
|
||||
keep_fargs?: 'strict' | boolean | undefined;
|
||||
/**
|
||||
* Pass true to prevent the compressor from discarding function names.
|
||||
* Useful for code relying on `Function.prototype.name`.
|
||||
* @default false
|
||||
*/
|
||||
keep_fnames?: boolean | undefined;
|
||||
/**
|
||||
* Pass true to prevent Infinity from being compressed into `1/0`, which may cause performance issues on `Chrome`
|
||||
* @default false
|
||||
*/
|
||||
keep_infinity?: boolean | undefined;
|
||||
/**
|
||||
* Optimizations for `do`, `while` and `for` loops when we can statically determine the condition.
|
||||
* @default true
|
||||
*/
|
||||
loops?: boolean | undefined;
|
||||
/**
|
||||
* combine and reuse variables.
|
||||
* @default true
|
||||
*/
|
||||
merge_vars?: boolean | undefined;
|
||||
/**
|
||||
* set to `true` if you wish to process input as ES module,
|
||||
* i.e. implicit `"use strict";` alongside with `toplevel` enabled.
|
||||
* @default false
|
||||
*/
|
||||
module?: boolean | undefined;
|
||||
/**
|
||||
* negate `Immediately-Called Function Expressions` where the return value is discarded,
|
||||
* to avoid the parens that the code generator would insert.
|
||||
* @default true
|
||||
*/
|
||||
negate_iife?: boolean | undefined;
|
||||
/**
|
||||
* compact duplicate keys in object literals
|
||||
* @default true
|
||||
*/
|
||||
objects?: boolean | undefined;
|
||||
/**
|
||||
* The maximum number of times to run compress.
|
||||
* In some cases more than one pass leads to further compressed code.
|
||||
* Keep in mind more passes will take more time.
|
||||
* @default 1
|
||||
*/
|
||||
passes?: number | undefined;
|
||||
/**
|
||||
* Rewrite property access using the dot notation, for example `foo["bar"]` to `foo.bar`
|
||||
* @default true
|
||||
*/
|
||||
properties?: boolean | undefined;
|
||||
/**
|
||||
* An array of names and UglifyJS will assume that those functions do not produce side effects.
|
||||
* DANGER: will not check if the name is redefined in scope.
|
||||
* An example case here, for instance `var q = Math.floor(a/b)`.
|
||||
* If variable q is not used elsewhere, UglifyJS will drop it, but will still keep the `Math.floor(a/b)`,
|
||||
* not knowing what it does. You can pass `pure_funcs: [ 'Math.floor' ]` to let it know that this function
|
||||
* won't produce any side effect, in which case the whole statement would get discarded. The current
|
||||
* implementation adds some overhead (compression will be slower).
|
||||
* @default null
|
||||
*/
|
||||
pure_funcs?: string[] | null | undefined;
|
||||
/**
|
||||
* If you pass true for this, UglifyJS will assume that object property access
|
||||
* (e.g. foo.bar or foo["bar"]) doesn't have any side effects.
|
||||
* Specify "strict" to treat foo.bar as side-effect-free only when foo is certain to not throw,
|
||||
* i.e. not null or undefine
|
||||
* @default 'strict'
|
||||
*/
|
||||
pure_getters?: boolean | 'strict' | undefined;
|
||||
/**
|
||||
* Allows single-use functions to be inlined as function expressions when permissible allowing further optimization.
|
||||
* Enabled by default. Option depends on reduce_vars being enabled. Some code runs faster in the Chrome V8 engine if
|
||||
* this option is disabled. Does not negatively impact other major browsers.
|
||||
* @default true
|
||||
*/
|
||||
reduce_funcs?: boolean | undefined;
|
||||
/**
|
||||
* Improve optimization on variables assigned with and used as constant values.
|
||||
* @default true
|
||||
*/
|
||||
reduce_vars?: boolean | undefined;
|
||||
/**
|
||||
* join consecutive simple statements using the comma operator.
|
||||
* May be set to a positive integer to specify the maximum number of
|
||||
* consecutive comma sequences that will be generated.
|
||||
* If this option is set to true then the default sequences limit is 200.
|
||||
* Set option to false or 0 to disable. The smallest sequences length is 2.
|
||||
* A sequences value of 1 is grandfathered to be equivalent to true and as such means 200.
|
||||
* On rare occasions the default sequences limit leads to very slow compress times in which case
|
||||
* a value of 20 or less is recommended
|
||||
* @default true
|
||||
*/
|
||||
sequences?: boolean | undefined;
|
||||
/**
|
||||
* Pass false to disable potentially dropping functions marked as "pure".
|
||||
* @default true
|
||||
*/
|
||||
side_effects?: boolean | undefined;
|
||||
/**
|
||||
* compact string concatenations
|
||||
* @default true
|
||||
*/
|
||||
strings?: boolean | undefined;
|
||||
/**
|
||||
* De-duplicate and remove unreachable `switch` branches.
|
||||
* @default true
|
||||
*/
|
||||
switches?: boolean | undefined;
|
||||
/**
|
||||
* Compact template literals by embedding expressions and/or converting to string literals, e.g. `foo ${42}` → "foo 42"
|
||||
* @default true
|
||||
*/
|
||||
templates?: boolean | undefined;
|
||||
/**
|
||||
* Drop unreferenced functions ("funcs") and/or variables ("vars") in the top level scope (false by default,
|
||||
* true to drop both unreferenced functions and variables)
|
||||
* @default false
|
||||
*/
|
||||
toplevel?: boolean | undefined;
|
||||
/**
|
||||
* Prevent specific toplevel functions and variables from unused removal
|
||||
* (can be array, comma-separated, RegExp or function. Implies toplevel)
|
||||
* @default null
|
||||
*/
|
||||
top_retain?: boolean | null | undefined;
|
||||
/**
|
||||
* Transforms typeof foo == "undefined" into foo === void 0.
|
||||
* Note: recommend to set this value to false for IE10 and earlier versions due to known issues
|
||||
* @default true
|
||||
*/
|
||||
typeofs?: boolean | undefined;
|
||||
/**
|
||||
* apply "unsafe" transformations (discussion below)
|
||||
* @default false
|
||||
*/
|
||||
unsafe?: boolean | undefined;
|
||||
/**
|
||||
* Compress expressions like a `<= b` assuming none of the operands can be (coerced to) `NaN`.
|
||||
* @default false
|
||||
*/
|
||||
unsafe_comps?: boolean | undefined;
|
||||
/**
|
||||
* Compress and mangle `Function(args, code)` when both args and code are string literals.
|
||||
* @default false
|
||||
*/
|
||||
unsafe_Function?: boolean | undefined;
|
||||
/**
|
||||
* Optimize numerical expressions like `2 * x * 3` into `6 * x`,
|
||||
* which may give imprecise floating point results.
|
||||
* @default false
|
||||
*/
|
||||
unsafe_math?: boolean | undefined;
|
||||
/**
|
||||
* Optimize expressions like `Array.prototype.slice.call(a)` into `[].slice.call(a)`
|
||||
* @default false
|
||||
*/
|
||||
unsafe_proto?: boolean | undefined;
|
||||
/**
|
||||
* Enable substitutions of variables with `RegExp` values the same way as if they are constants.
|
||||
* @default false
|
||||
*/
|
||||
unsafe_regexp?: boolean | undefined;
|
||||
/**
|
||||
* substitute void 0 if there is a variable named undefined in scope
|
||||
* (variable name will be mangled, typically reduced to a single character)
|
||||
* @default false
|
||||
*/
|
||||
unsafe_undefined?: boolean | undefined;
|
||||
/**
|
||||
* drop unreferenced functions and variables
|
||||
* (simple direct variable assignments do not count as references unless set to "keep_assign")
|
||||
* @default true
|
||||
*/
|
||||
unused?: boolean | undefined;
|
||||
/**
|
||||
* convert block-scoped declaractions into `var`
|
||||
* whenever safe to do so
|
||||
* @default true
|
||||
*/
|
||||
varify?: boolean | undefined;
|
||||
/**
|
||||
* Support non-standard Safari/Webkit.
|
||||
* By default UglifyJS will not try to be Safari-proof.
|
||||
* @default false
|
||||
*/
|
||||
webkit?: boolean | undefined;
|
||||
}
|
||||
|
||||
export enum InlineFunctions {
|
||||
Disabled = 0,
|
||||
SimpleFunctions = 1,
|
||||
WithArguments = 2,
|
||||
WithArgumentsAndVariables = 3,
|
||||
}
|
||||
export interface MangleOptions {
|
||||
/** Pass true to mangle names visible in scopes where `eval` or with are used. */
|
||||
eval?: boolean | undefined;
|
||||
/** Pass true to not mangle function names. Useful for code relying on `Function.prototype.name`. */
|
||||
keep_fnames?: boolean | undefined;
|
||||
/** Pass an array of identifiers that should be excluded from mangling. Example: `["foo", "bar"]`. */
|
||||
reserved?: string[] | undefined;
|
||||
/** Pass true to mangle names declared in the top level scope. */
|
||||
toplevel?: boolean | undefined;
|
||||
properties?: boolean | ManglePropertiesOptions | undefined;
|
||||
}
|
||||
|
||||
export interface ManglePropertiesOptions {
|
||||
/** Use true to allow the mangling of builtin DOM properties. Not recommended to override this setting. */
|
||||
builtins?: boolean | undefined;
|
||||
/** Mangle names with the original name still present. Pass an empty string "" to enable, or a non-empty string to set the debug suffix. */
|
||||
debug?: boolean | undefined;
|
||||
/** Only mangle unquoted property names */
|
||||
keep_quoted?: boolean | undefined;
|
||||
/** Pass a RegExp literal to only mangle property names matching the regular expression. */
|
||||
regex?: RegExp | undefined;
|
||||
/** Do not mangle property names listed in the reserved array */
|
||||
reserved?: string[] | undefined;
|
||||
}
|
||||
|
||||
export interface OutputOptions {
|
||||
ascii_only?: boolean | undefined;
|
||||
beautify?: boolean | undefined;
|
||||
braces?: boolean | undefined;
|
||||
comments?: boolean | 'all' | 'some' | RegExp | undefined;
|
||||
indent_level?: number | undefined;
|
||||
indent_start?: boolean | undefined;
|
||||
inline_script?: boolean | undefined;
|
||||
keep_quoted_props?: boolean | undefined;
|
||||
max_line_len?: boolean | number | undefined;
|
||||
preamble?: string | undefined;
|
||||
preserve_line?: boolean | undefined;
|
||||
quote_keys?: boolean | undefined;
|
||||
quote_style?: OutputQuoteStyle | undefined;
|
||||
semicolons?: boolean | undefined;
|
||||
shebang?: boolean | undefined;
|
||||
webkit?: boolean | undefined;
|
||||
width?: number | undefined;
|
||||
wrap_iife?: boolean | undefined;
|
||||
}
|
||||
|
||||
export enum OutputQuoteStyle {
|
||||
PreferDouble = 0,
|
||||
AlwaysSingle = 1,
|
||||
AlwaysDouble = 2,
|
||||
AlwaysOriginal = 3,
|
||||
}
|
||||
|
||||
export interface MinifyOptions {
|
||||
/**
|
||||
* Pass `true` to return compressor warnings in result.warnings.
|
||||
* Use the value `verbose` for more detailed warnings.
|
||||
* @default false
|
||||
*/
|
||||
warnings?: boolean | 'verbose' | undefined;
|
||||
/**
|
||||
* Pass an object if you wish to specify some additional parse options.
|
||||
*/
|
||||
parse?: ParseOptions | undefined;
|
||||
/**
|
||||
* Pass `false` to skip compressing entirely.
|
||||
* Pass an object to specify custom compress options.
|
||||
* @default {}
|
||||
*/
|
||||
compress?: false | CompressOptions | undefined;
|
||||
/**
|
||||
* Parse as a single expression, e.g. JSON.
|
||||
* @default false
|
||||
*/
|
||||
expression?: boolean | undefined;
|
||||
/**
|
||||
* Pass `false` to skip mangling names,
|
||||
* or pass an object to specify mangle options (see below).
|
||||
* @default true
|
||||
*/
|
||||
mangle?: boolean | MangleOptions | undefined;
|
||||
/**
|
||||
* Pass an object if you wish to specify additional output options.
|
||||
* The defaults are optimized for best compression
|
||||
*/
|
||||
output?: OutputOptions | undefined;
|
||||
/**
|
||||
* Pass an object if you wish to specify source map options.
|
||||
* @default false
|
||||
*/
|
||||
sourceMap?: boolean | SourceMapOptions | undefined;
|
||||
/**
|
||||
* Set to `true` if you wish to enable top level variable and function name mangling
|
||||
* and to drop unused variables and functions.
|
||||
* @default false
|
||||
*/
|
||||
toplevel?: boolean | undefined;
|
||||
/**
|
||||
* set to `true` if you wish to process input as ES module,
|
||||
* i.e. implicit `"use strict";` alongside with `toplevel` enabled.
|
||||
* @default false
|
||||
*/
|
||||
module?: boolean | undefined;
|
||||
/**
|
||||
* Pass an empty object {} or a previously used nameCache object
|
||||
* if you wish to cache mangled variable and property names across multiple invocations of minify().
|
||||
* Note: this is a read/write property. `minify()` will read the name cache state of this object
|
||||
* and update it during minification so that it may be reused or externally persisted by the user
|
||||
*/
|
||||
nameCache?: object | undefined;
|
||||
/**
|
||||
* Set to true to support IE8
|
||||
* @default false
|
||||
*/
|
||||
ie8?: boolean | undefined;
|
||||
/**
|
||||
* Pass true to prevent discarding or mangling of function names.
|
||||
* Useful for code relying on Function.prototype.name.
|
||||
* @default false
|
||||
*/
|
||||
keep_fnames?: boolean | undefined;
|
||||
/**
|
||||
* Support non-standard Safari/Webkit.
|
||||
* Equivalent to setting `webkit: true` in `minify()` for `compress`, `mangle` and `output` options.
|
||||
* @default false
|
||||
*/
|
||||
webkit?: boolean | undefined;
|
||||
}
|
||||
|
||||
export interface MinifyOutput {
|
||||
error?: Error | undefined;
|
||||
warnings?: string[] | undefined;
|
||||
code: string;
|
||||
map: string;
|
||||
}
|
||||
|
||||
export interface SourceMapOptions {
|
||||
includeSources?: boolean | undefined;
|
||||
filename?: string | undefined;
|
||||
/**
|
||||
* Include symbol names in the source map
|
||||
* @default true
|
||||
*/
|
||||
names?: boolean | undefined;
|
||||
url?: string | 'inline' | undefined;
|
||||
root?: string | undefined;
|
||||
content?: RawSourceMap | 'inline' | undefined;
|
||||
}
|
||||
|
||||
export function minify(files: string | string[] | { [file: string]: string }, options?: MinifyOptions): MinifyOutput;
|
||||
@@ -0,0 +1,97 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<title>Code coverage report for csv2json/libs</title>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="stylesheet" href="../../prettify.css" />
|
||||
<link rel="stylesheet" href="../../base.css" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<style type='text/css'>
|
||||
.coverage-summary .sorter {
|
||||
background-image: url(../../sort-arrow-sprite.png);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class='wrapper'>
|
||||
<div class='pad1'>
|
||||
<h1>
|
||||
<a href="../../index.html">All files</a> csv2json/libs
|
||||
</h1>
|
||||
<div class='clearfix'>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Statements</span>
|
||||
<span class='fraction'>0/3</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Branches</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">100% </span>
|
||||
<span class="quiet">Functions</span>
|
||||
<span class='fraction'>0/0</span>
|
||||
</div>
|
||||
<div class='fl pad1y space-right2'>
|
||||
<span class="strong">0% </span>
|
||||
<span class="quiet">Lines</span>
|
||||
<span class='fraction'>0/3</span>
|
||||
</div>
|
||||
</div>
|
||||
<p class="quiet">
|
||||
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
|
||||
</p>
|
||||
</div>
|
||||
<div class='status-line low'></div>
|
||||
<div class="pad1">
|
||||
<table class="coverage-summary">
|
||||
<thead>
|
||||
<tr>
|
||||
<th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
|
||||
<th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
|
||||
<th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
|
||||
<th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
|
||||
<th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
|
||||
<th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
<th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
|
||||
<th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody><tr>
|
||||
<td class="file low" data-value="csv2json.js"><a href="csv2json.js.html">csv2json.js</a></td>
|
||||
<td data-value="0" class="pic low"><div class="chart"><div class="cover-fill" style="width: 0%;"></div><div class="cover-empty" style="width:100%;"></div></div></td>
|
||||
<td data-value="0" class="pct low">0%</td>
|
||||
<td data-value="3" class="abs low">0/3</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="100" class="pct high">100%</td>
|
||||
<td data-value="0" class="abs high">0/0</td>
|
||||
<td data-value="0" class="pct low">0%</td>
|
||||
<td data-value="3" class="abs low">0/3</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div><div class='push'></div><!-- for sticky footer -->
|
||||
</div><!-- /wrapper -->
|
||||
<div class='footer quiet pad2 space-top1 center small'>
|
||||
Code coverage
|
||||
generated by <a href="https://istanbul.js.org/" target="_blank">istanbul</a> at Fri May 11 2018 21:36:07 GMT+0100 (IST)
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../prettify.js"></script>
|
||||
<script>
|
||||
window.onload = function () {
|
||||
if (typeof prettyPrint === 'function') {
|
||||
prettyPrint();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<script src="../../sorter.js"></script>
|
||||
<script src="../../block-navigation.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"throwUnobservableError.js","sourceRoot":"","sources":["../../../../src/internal/util/throwUnobservableError.ts"],"names":[],"mappings":"AAIA,MAAM,UAAU,gCAAgC,CAAC,KAAU;IAEzD,OAAO,IAAI,SAAS,CAClB,mBACE,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,MAAI,KAAK,MAAG,8HACwC,CAC3H,CAAC;AACJ,CAAC"}
|
||||
@@ -0,0 +1,62 @@
|
||||
import { scanInternals } from './scanInternals';
|
||||
import { OperatorFunction } from '../types';
|
||||
import { operate } from '../util/lift';
|
||||
|
||||
export function reduce<V, A = V>(accumulator: (acc: A | V, value: V, index: number) => A): OperatorFunction<V, V | A>;
|
||||
export function reduce<V, A>(accumulator: (acc: A, value: V, index: number) => A, seed: A): OperatorFunction<V, A>;
|
||||
export function reduce<V, A, S = A>(accumulator: (acc: A | S, value: V, index: number) => A, seed: S): OperatorFunction<V, A>;
|
||||
|
||||
/**
|
||||
* Applies an accumulator function over the source Observable, and returns the
|
||||
* accumulated result when the source completes, given an optional seed value.
|
||||
*
|
||||
* <span class="informal">Combines together all values emitted on the source,
|
||||
* using an accumulator function that knows how to join a new source value into
|
||||
* the accumulation from the past.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* Like
|
||||
* [Array.prototype.reduce()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce),
|
||||
* `reduce` applies an `accumulator` function against an accumulation and each
|
||||
* value of the source Observable (from the past) to reduce it to a single
|
||||
* value, emitted on the output Observable. Note that `reduce` will only emit
|
||||
* one value, only when the source Observable completes. It is equivalent to
|
||||
* applying operator {@link scan} followed by operator {@link last}.
|
||||
*
|
||||
* Returns an Observable that applies a specified `accumulator` function to each
|
||||
* item emitted by the source Observable. If a `seed` value is specified, then
|
||||
* that value will be used as the initial value for the accumulator. If no seed
|
||||
* value is specified, the first item of the source is used as the seed.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Count the number of click events that happened in 5 seconds
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, takeUntil, interval, map, reduce } from 'rxjs';
|
||||
*
|
||||
* const clicksInFiveSeconds = fromEvent(document, 'click')
|
||||
* .pipe(takeUntil(interval(5000)));
|
||||
*
|
||||
* const ones = clicksInFiveSeconds.pipe(map(() => 1));
|
||||
* const seed = 0;
|
||||
* const count = ones.pipe(reduce((acc, one) => acc + one, seed));
|
||||
*
|
||||
* count.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* @see {@link count}
|
||||
* @see {@link expand}
|
||||
* @see {@link mergeScan}
|
||||
* @see {@link scan}
|
||||
*
|
||||
* @param {function(acc: A, value: V, index: number): A} accumulator The accumulator function
|
||||
* called on each source value.
|
||||
* @param {A} [seed] The initial accumulation value.
|
||||
* @return A function that returns an Observable that emits a single value that
|
||||
* is the result of accumulating the values emitted by the source Observable.
|
||||
*/
|
||||
export function reduce<V, A>(accumulator: (acc: V | A, value: V, index: number) => A, seed?: any): OperatorFunction<V, V | A> {
|
||||
return operate(scanInternals(accumulator, seed, arguments.length >= 2, false, true));
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"name": "once",
|
||||
"version": "1.4.0",
|
||||
"description": "Run a function exactly one time",
|
||||
"main": "once.js",
|
||||
"directories": {
|
||||
"test": "test"
|
||||
},
|
||||
"dependencies": {
|
||||
"wrappy": "1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tap": "^7.0.1"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "tap test/*.js"
|
||||
},
|
||||
"files": [
|
||||
"once.js"
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/isaacs/once"
|
||||
},
|
||||
"keywords": [
|
||||
"once",
|
||||
"function",
|
||||
"one",
|
||||
"single"
|
||||
],
|
||||
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
||||
"license": "ISC"
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
'use strict'
|
||||
|
||||
var test = require('tape')
|
||||
var reusify = require('./')
|
||||
|
||||
test('reuse objects', function (t) {
|
||||
t.plan(6)
|
||||
|
||||
function MyObject () {
|
||||
t.pass('constructor called')
|
||||
this.next = null
|
||||
}
|
||||
|
||||
var instance = reusify(MyObject)
|
||||
var obj = instance.get()
|
||||
|
||||
t.notEqual(obj, instance.get(), 'two instance created')
|
||||
t.notOk(obj.next, 'next must be null')
|
||||
|
||||
instance.release(obj)
|
||||
|
||||
// the internals keeps a hot copy ready for reuse
|
||||
// putting this one back in the queue
|
||||
instance.release(instance.get())
|
||||
|
||||
// comparing the old one with the one we got
|
||||
// never do this in real code, after release you
|
||||
// should never reuse that instance
|
||||
t.equal(obj, instance.get(), 'instance must be reused')
|
||||
})
|
||||
|
||||
test('reuse more than 2 objects', function (t) {
|
||||
function MyObject () {
|
||||
t.pass('constructor called')
|
||||
this.next = null
|
||||
}
|
||||
|
||||
var instance = reusify(MyObject)
|
||||
var obj = instance.get()
|
||||
var obj2 = instance.get()
|
||||
var obj3 = instance.get()
|
||||
|
||||
t.notOk(obj.next, 'next must be null')
|
||||
t.notOk(obj2.next, 'next must be null')
|
||||
t.notOk(obj3.next, 'next must be null')
|
||||
|
||||
t.notEqual(obj, obj2)
|
||||
t.notEqual(obj, obj3)
|
||||
t.notEqual(obj3, obj2)
|
||||
|
||||
instance.release(obj)
|
||||
instance.release(obj2)
|
||||
instance.release(obj3)
|
||||
|
||||
// skip one
|
||||
instance.get()
|
||||
|
||||
var obj4 = instance.get()
|
||||
var obj5 = instance.get()
|
||||
var obj6 = instance.get()
|
||||
|
||||
t.equal(obj4, obj)
|
||||
t.equal(obj5, obj2)
|
||||
t.equal(obj6, obj3)
|
||||
t.end()
|
||||
})
|
||||
@@ -0,0 +1,127 @@
|
||||
'use strict';
|
||||
|
||||
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
||||
|
||||
var codes = {};
|
||||
|
||||
function createErrorType(code, message, Base) {
|
||||
if (!Base) {
|
||||
Base = Error;
|
||||
}
|
||||
|
||||
function getMessage(arg1, arg2, arg3) {
|
||||
if (typeof message === 'string') {
|
||||
return message;
|
||||
} else {
|
||||
return message(arg1, arg2, arg3);
|
||||
}
|
||||
}
|
||||
|
||||
var NodeError =
|
||||
/*#__PURE__*/
|
||||
function (_Base) {
|
||||
_inheritsLoose(NodeError, _Base);
|
||||
|
||||
function NodeError(arg1, arg2, arg3) {
|
||||
return _Base.call(this, getMessage(arg1, arg2, arg3)) || this;
|
||||
}
|
||||
|
||||
return NodeError;
|
||||
}(Base);
|
||||
|
||||
NodeError.prototype.name = Base.name;
|
||||
NodeError.prototype.code = code;
|
||||
codes[code] = NodeError;
|
||||
} // https://github.com/nodejs/node/blob/v10.8.0/lib/internal/errors.js
|
||||
|
||||
|
||||
function oneOf(expected, thing) {
|
||||
if (Array.isArray(expected)) {
|
||||
var len = expected.length;
|
||||
expected = expected.map(function (i) {
|
||||
return String(i);
|
||||
});
|
||||
|
||||
if (len > 2) {
|
||||
return "one of ".concat(thing, " ").concat(expected.slice(0, len - 1).join(', '), ", or ") + expected[len - 1];
|
||||
} else if (len === 2) {
|
||||
return "one of ".concat(thing, " ").concat(expected[0], " or ").concat(expected[1]);
|
||||
} else {
|
||||
return "of ".concat(thing, " ").concat(expected[0]);
|
||||
}
|
||||
} else {
|
||||
return "of ".concat(thing, " ").concat(String(expected));
|
||||
}
|
||||
} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith
|
||||
|
||||
|
||||
function startsWith(str, search, pos) {
|
||||
return str.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;
|
||||
} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith
|
||||
|
||||
|
||||
function endsWith(str, search, this_len) {
|
||||
if (this_len === undefined || this_len > str.length) {
|
||||
this_len = str.length;
|
||||
}
|
||||
|
||||
return str.substring(this_len - search.length, this_len) === search;
|
||||
} // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes
|
||||
|
||||
|
||||
function includes(str, search, start) {
|
||||
if (typeof start !== 'number') {
|
||||
start = 0;
|
||||
}
|
||||
|
||||
if (start + search.length > str.length) {
|
||||
return false;
|
||||
} else {
|
||||
return str.indexOf(search, start) !== -1;
|
||||
}
|
||||
}
|
||||
|
||||
createErrorType('ERR_INVALID_OPT_VALUE', function (name, value) {
|
||||
return 'The value "' + value + '" is invalid for option "' + name + '"';
|
||||
}, TypeError);
|
||||
createErrorType('ERR_INVALID_ARG_TYPE', function (name, expected, actual) {
|
||||
// determiner: 'must be' or 'must not be'
|
||||
var determiner;
|
||||
|
||||
if (typeof expected === 'string' && startsWith(expected, 'not ')) {
|
||||
determiner = 'must not be';
|
||||
expected = expected.replace(/^not /, '');
|
||||
} else {
|
||||
determiner = 'must be';
|
||||
}
|
||||
|
||||
var msg;
|
||||
|
||||
if (endsWith(name, ' argument')) {
|
||||
// For cases like 'first argument'
|
||||
msg = "The ".concat(name, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
|
||||
} else {
|
||||
var type = includes(name, '.') ? 'property' : 'argument';
|
||||
msg = "The \"".concat(name, "\" ").concat(type, " ").concat(determiner, " ").concat(oneOf(expected, 'type'));
|
||||
}
|
||||
|
||||
msg += ". Received type ".concat(typeof actual);
|
||||
return msg;
|
||||
}, TypeError);
|
||||
createErrorType('ERR_STREAM_PUSH_AFTER_EOF', 'stream.push() after EOF');
|
||||
createErrorType('ERR_METHOD_NOT_IMPLEMENTED', function (name) {
|
||||
return 'The ' + name + ' method is not implemented';
|
||||
});
|
||||
createErrorType('ERR_STREAM_PREMATURE_CLOSE', 'Premature close');
|
||||
createErrorType('ERR_STREAM_DESTROYED', function (name) {
|
||||
return 'Cannot call ' + name + ' after a stream was destroyed';
|
||||
});
|
||||
createErrorType('ERR_MULTIPLE_CALLBACK', 'Callback called multiple times');
|
||||
createErrorType('ERR_STREAM_CANNOT_PIPE', 'Cannot pipe, not readable');
|
||||
createErrorType('ERR_STREAM_WRITE_AFTER_END', 'write after end');
|
||||
createErrorType('ERR_STREAM_NULL_VALUES', 'May not write null values to stream', TypeError);
|
||||
createErrorType('ERR_UNKNOWN_ENCODING', function (arg) {
|
||||
return 'Unknown encoding: ' + arg;
|
||||
}, TypeError);
|
||||
createErrorType('ERR_STREAM_UNSHIFT_AFTER_END_EVENT', 'stream.unshift() after end event');
|
||||
module.exports.codes = codes;
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J D E F A B CC"},B:{"2":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"2":"0 1 2 3 4 5 6 7 8 9 DC tB I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB EC FC"},D:{"1":"xB yB GC","2":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},E:{"1":"F A B C K L G LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"I v J D E HC zB IC JC KC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 F B C G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e PC QC RC SC qB AC TC rB"},G:{"1":"ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B","2":"E zB UC BC VC WC XC YC"},H:{"2":"oC"},I:{"2":"tB I f pC qC rC sC BC tC uC"},J:{"2":"D A"},K:{"2":"A B C h qB AC rB"},L:{"2":"H"},M:{"2":"H"},N:{"2":"A B"},O:{"2":"vC"},P:{"2":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"2":"1B"},R:{"2":"9C"},S:{"2":"AD BD"}},B:5,C:"selector list argument of :nth-child and :nth-last-child CSS pseudo-classes"};
|
||||
Reference in New Issue
Block a user