new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"release-it": {
|
||||
"git": {
|
||||
"push": false
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
export declare function mergeDeep(defaults: any, options: any): object;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"parent-module","version":"1.0.1","files":{"license":{"checkedAt":1678883669272,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"package.json":{"checkedAt":1678883670543,"integrity":"sha512-SlJLI/85Xyu6pGAIveCMgmQIs+uZgOTJpgLmR/RxdlESuj1Av07sNN9BcYAQTVxBzZCr9895hcT40R7THt9OxQ==","mode":420,"size":712},"index.js":{"checkedAt":1678883670543,"integrity":"sha512-2wnfCb/sc7WKNctb/fkD83lEshnmODcODe7LTQvEe2/wA2lxOC7hHYbGR3m9moci1nevegf1M+7vTNX5sopNng==","mode":420,"size":641},"readme.md":{"checkedAt":1678883670543,"integrity":"sha512-gnTetT192Dj3r0nw1AA5PouZtHuCsY7Fk0PsXZfkRzSiAMZmU24Lg/w9VYRY7vwDishJv+pszDogU5ExgIwNvQ==","mode":420,"size":1460}}}
|
||||
@@ -0,0 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.WHITE_SPACE_REGEX = exports.SPACE_SEPARATOR_REGEX = void 0;
|
||||
// @generated from regex-gen.ts
|
||||
exports.SPACE_SEPARATOR_REGEX = /[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
||||
exports.WHITE_SPACE_REGEX = /[\t-\r \x85\u200E\u200F\u2028\u2029]/;
|
||||
@@ -0,0 +1,10 @@
|
||||
import process from 'node:process';
|
||||
|
||||
const packageJson = process.env.npm_package_json;
|
||||
const userAgent = process.env.npm_config_user_agent;
|
||||
const isNpm6 = Boolean(userAgent && userAgent.startsWith('npm'));
|
||||
const isNpm7 = Boolean(packageJson && packageJson.endsWith('package.json'));
|
||||
|
||||
export const isNpm = isNpm6 || isNpm7;
|
||||
export const isYarn = Boolean(userAgent && userAgent.startsWith('yarn'));
|
||||
export const isNpmOrYarn = isNpm || isYarn;
|
||||
@@ -0,0 +1,2 @@
|
||||
import { Node } from 'estree';
|
||||
export declare function is_head(node: Node): boolean;
|
||||
@@ -0,0 +1,3 @@
|
||||
date *json*employee.name *json*employee.age *json*employee.number *array*address *array*address *jsonarray*employee.key *jsonarray*employee.key *omit*id
|
||||
2012-02-12 Eric 31 51234 Dunno Street Kilkeny Road key1 key2 2
|
||||
2012-03-06 Ted 28 51289 O FUTEBOL.¿ Tormore key3 key4 4
|
||||
@@ -0,0 +1,102 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { ObservableInput, ObservableInputTuple, SchedulerLike } from '../types';
|
||||
import { mergeAll } from '../operators/mergeAll';
|
||||
import { innerFrom } from './innerFrom';
|
||||
import { EMPTY } from './empty';
|
||||
import { popNumber, popScheduler } from '../util/args';
|
||||
import { from } from './from';
|
||||
|
||||
export function merge<A extends readonly unknown[]>(...sources: [...ObservableInputTuple<A>]): Observable<A[number]>;
|
||||
export function merge<A extends readonly unknown[]>(...sourcesAndConcurrency: [...ObservableInputTuple<A>, number?]): Observable<A[number]>;
|
||||
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled` and `mergeAll`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
||||
export function merge<A extends readonly unknown[]>(
|
||||
...sourcesAndScheduler: [...ObservableInputTuple<A>, SchedulerLike?]
|
||||
): Observable<A[number]>;
|
||||
/** @deprecated The `scheduler` parameter will be removed in v8. Use `scheduled` and `mergeAll`. Details: https://rxjs.dev/deprecations/scheduler-argument */
|
||||
export function merge<A extends readonly unknown[]>(
|
||||
...sourcesAndConcurrencyAndScheduler: [...ObservableInputTuple<A>, number?, SchedulerLike?]
|
||||
): Observable<A[number]>;
|
||||
|
||||
/**
|
||||
* Creates an output Observable which concurrently emits all values from every
|
||||
* given input Observable.
|
||||
*
|
||||
* <span class="informal">Flattens multiple Observables together by blending
|
||||
* their values into one Observable.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `merge` subscribes to each given input Observable (as arguments), and simply
|
||||
* forwards (without doing any transformation) all the values from all the input
|
||||
* Observables to the output Observable. The output Observable only completes
|
||||
* once all input Observables have completed. Any error delivered by an input
|
||||
* Observable will be immediately emitted on the output Observable.
|
||||
*
|
||||
* ## Examples
|
||||
*
|
||||
* Merge together two Observables: 1s interval and clicks
|
||||
*
|
||||
* ```ts
|
||||
* import { merge, fromEvent, interval } from 'rxjs';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const timer = interval(1000);
|
||||
* const clicksOrTimer = merge(clicks, timer);
|
||||
* clicksOrTimer.subscribe(x => console.log(x));
|
||||
*
|
||||
* // Results in the following:
|
||||
* // timer will emit ascending values, one every second(1000ms) to console
|
||||
* // clicks logs MouseEvents to console every time the "document" is clicked
|
||||
* // Since the two streams are merged you see these happening
|
||||
* // as they occur.
|
||||
* ```
|
||||
*
|
||||
* Merge together 3 Observables, but run only 2 concurrently
|
||||
*
|
||||
* ```ts
|
||||
* import { interval, take, merge } from 'rxjs';
|
||||
*
|
||||
* const timer1 = interval(1000).pipe(take(10));
|
||||
* const timer2 = interval(2000).pipe(take(6));
|
||||
* const timer3 = interval(500).pipe(take(10));
|
||||
*
|
||||
* const concurrent = 2; // the argument
|
||||
* const merged = merge(timer1, timer2, timer3, concurrent);
|
||||
* merged.subscribe(x => console.log(x));
|
||||
*
|
||||
* // Results in the following:
|
||||
* // - First timer1 and timer2 will run concurrently
|
||||
* // - timer1 will emit a value every 1000ms for 10 iterations
|
||||
* // - timer2 will emit a value every 2000ms for 6 iterations
|
||||
* // - after timer1 hits its max iteration, timer2 will
|
||||
* // continue, and timer3 will start to run concurrently with timer2
|
||||
* // - when timer2 hits its max iteration it terminates, and
|
||||
* // timer3 will continue to emit a value every 500ms until it is complete
|
||||
* ```
|
||||
*
|
||||
* @see {@link mergeAll}
|
||||
* @see {@link mergeMap}
|
||||
* @see {@link mergeMapTo}
|
||||
* @see {@link mergeScan}
|
||||
*
|
||||
* @param {...ObservableInput} observables Input Observables to merge together.
|
||||
* @param {number} [concurrent=Infinity] Maximum number of input
|
||||
* Observables being subscribed to concurrently.
|
||||
* @param {SchedulerLike} [scheduler=null] The {@link SchedulerLike} to use for managing
|
||||
* concurrency of input Observables.
|
||||
* @return {Observable} an Observable that emits items that are the result of
|
||||
* every input Observable.
|
||||
*/
|
||||
export function merge(...args: (ObservableInput<unknown> | number | SchedulerLike)[]): Observable<unknown> {
|
||||
const scheduler = popScheduler(args);
|
||||
const concurrent = popNumber(args, Infinity);
|
||||
const sources = args as ObservableInput<unknown>[];
|
||||
return !sources.length
|
||||
? // No source provided
|
||||
EMPTY
|
||||
: sources.length === 1
|
||||
? // One source? Just return it.
|
||||
innerFrom(sources[0])
|
||||
: // Merge all sources
|
||||
mergeAll(concurrent)(from(sources, scheduler));
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var IsBigIntElementType = require('./IsBigIntElementType');
|
||||
var IsUnclampedIntegerElementType = require('./IsUnclampedIntegerElementType');
|
||||
var Type = require('./Type');
|
||||
var TypedArrayElementType = require('./TypedArrayElementType');
|
||||
var ValidateTypedArray = require('./ValidateTypedArray');
|
||||
|
||||
var whichTypedArray = require('which-typed-array');
|
||||
|
||||
// https://262.ecma-international.org/13.0/#sec-validateintegertypedarray
|
||||
|
||||
module.exports = function ValidateIntegerTypedArray(typedArray) {
|
||||
var waitable = arguments.length > 1 ? arguments[1] : false; // step 1
|
||||
|
||||
if (Type(waitable) !== 'Boolean') {
|
||||
throw new $TypeError('Assertion failed: `waitable` must be a Boolean');
|
||||
}
|
||||
|
||||
var buffer = ValidateTypedArray(typedArray); // step 2
|
||||
|
||||
if (waitable) { // step 5
|
||||
var typeName = whichTypedArray(typedArray);
|
||||
if (typeName !== 'Int32Array' && typeName !== 'BigInt64Array') {
|
||||
throw new $TypeError('Assertion failed: `typedArray` must be an Int32Array or BigInt64Array when `waitable` is true'); // step 5.a
|
||||
}
|
||||
} else {
|
||||
var type = TypedArrayElementType(typedArray); // step 5.a
|
||||
if (!IsUnclampedIntegerElementType(type) && !IsBigIntElementType(type)) {
|
||||
throw new $TypeError('Assertion failed: `typedArray` must be an integer TypedArray'); // step 5.b
|
||||
}
|
||||
}
|
||||
|
||||
return buffer; // step 6
|
||||
};
|
||||
@@ -0,0 +1,75 @@
|
||||
# Browserslist [![Cult Of Martians][cult-img]][cult]
|
||||
|
||||
<img width="120" height="120" alt="Browserslist logo by Anton Popov"
|
||||
src="https://browsersl.ist/logo.svg" align="right">
|
||||
|
||||
The config to share target browsers and Node.js versions between different
|
||||
front-end tools. It is used in:
|
||||
|
||||
* [Autoprefixer]
|
||||
* [Babel]
|
||||
* [postcss-preset-env]
|
||||
* [eslint-plugin-compat]
|
||||
* [stylelint-no-unsupported-browser-features]
|
||||
* [postcss-normalize]
|
||||
* [obsolete-webpack-plugin]
|
||||
|
||||
All tools will find target browsers automatically,
|
||||
when you add the following to `package.json`:
|
||||
|
||||
```json
|
||||
"browserslist": [
|
||||
"defaults and supports es6-module",
|
||||
"maintained node versions"
|
||||
]
|
||||
```
|
||||
|
||||
Or in `.browserslistrc` config:
|
||||
|
||||
```yaml
|
||||
# Browsers that we support
|
||||
|
||||
defaults and supports es6-module
|
||||
maintained node versions
|
||||
```
|
||||
|
||||
Developers set their version lists using queries like `last 2 versions`
|
||||
to be free from updating versions manually.
|
||||
Browserslist will use [`caniuse-lite`] with [Can I Use] data for this queries.
|
||||
|
||||
You can check how config works at our playground: [`browsersl.ist`](https://browsersl.ist/)
|
||||
|
||||
<a href="https://browsersl.ist/">
|
||||
<img src="/img/screenshot.webp" alt="browsersl.ist website">
|
||||
</a>
|
||||
|
||||
<br>
|
||||
<br>
|
||||
<div align="center">
|
||||
<a href="https://evilmartians.com/?utm_source=browserslist">
|
||||
<img src="https://evilmartians.com/badges/sponsored-by-evil-martians.svg"
|
||||
alt="Sponsored by Evil Martians" width="236" height="54">
|
||||
</a>
|
||||
|
||||
<a href="https://cube.dev/?ref=eco-browserslist-github">
|
||||
<img src="https://user-images.githubusercontent.com/986756/154330861-d79ab8ec-aacb-4af8-9e17-1b28f1eccb01.svg"
|
||||
alt="Supported by Cube" width="227" height="46">
|
||||
</a>
|
||||
</div>
|
||||
|
||||
[stylelint-no-unsupported-browser-features]: https://github.com/ismay/stylelint-no-unsupported-browser-features
|
||||
[obsolete-webpack-plugin]: https://github.com/ElemeFE/obsolete-webpack-plugin
|
||||
[eslint-plugin-compat]: https://github.com/amilajack/eslint-plugin-compat
|
||||
[Browserslist Example]: https://github.com/browserslist/browserslist-example
|
||||
[postcss-preset-env]: https://github.com/csstools/postcss-plugins/tree/main/plugin-packs/postcss-preset-env
|
||||
[postcss-normalize]: https://github.com/csstools/postcss-normalize
|
||||
[`browsersl.ist`]: https://browsersl.ist/
|
||||
[`caniuse-lite`]: https://github.com/ben-eb/caniuse-lite
|
||||
[Autoprefixer]: https://github.com/postcss/autoprefixer
|
||||
[Can I Use]: https://caniuse.com/
|
||||
[Babel]: https://github.com/babel/babel/tree/master/packages/babel-preset-env
|
||||
[cult-img]: https://cultofmartians.com/assets/badges/badge.svg
|
||||
[cult]: https://cultofmartians.com/done.html
|
||||
|
||||
## Docs
|
||||
Read full docs **[here](https://github.com/browserslist/browserslist#readme)**.
|
||||
@@ -0,0 +1,38 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
var callBound = require('call-bind/callBound');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var IsIntegralNumber = require('./IsIntegralNumber');
|
||||
var Type = require('./Type');
|
||||
|
||||
var $charAt = callBound('String.prototype.charAt');
|
||||
|
||||
// https://262.ecma-international.org/12.0/#sec-splitmatch
|
||||
|
||||
module.exports = function SplitMatch(S, q, R) {
|
||||
if (Type(S) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `S` must be a String');
|
||||
}
|
||||
if (!IsIntegralNumber(q)) {
|
||||
throw new $TypeError('Assertion failed: `q` must be an integer');
|
||||
}
|
||||
if (Type(R) !== 'String') {
|
||||
throw new $TypeError('Assertion failed: `R` must be a String');
|
||||
}
|
||||
var r = R.length;
|
||||
var s = S.length;
|
||||
if (q + r > s) {
|
||||
return 'not-matched';
|
||||
}
|
||||
|
||||
for (var i = 0; i < r; i += 1) {
|
||||
if ($charAt(S, q + i) !== $charAt(R, i)) {
|
||||
return 'not-matched';
|
||||
}
|
||||
}
|
||||
|
||||
return q + r;
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
'use strict';
|
||||
|
||||
var test = require('tape');
|
||||
var debug = require('object-inspect');
|
||||
var forEach = require('foreach');
|
||||
var has = require('has');
|
||||
var v = require('es-value-fixtures');
|
||||
|
||||
var getSymbolDescription = require('../');
|
||||
var getInferredName = require('../getInferredName');
|
||||
|
||||
test('getSymbolDescription', function (t) {
|
||||
t.test('no symbols', { skip: v.hasSymbols }, function (st) {
|
||||
st['throws'](
|
||||
getSymbolDescription,
|
||||
SyntaxError,
|
||||
'requires Symbol support'
|
||||
);
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
forEach(v.nonSymbolPrimitives.concat(v.objects), function (nonSymbol) {
|
||||
t['throws'](
|
||||
function () { getSymbolDescription(nonSymbol); },
|
||||
v.hasSymbols ? TypeError : SyntaxError,
|
||||
debug(nonSymbol) + ' is not a Symbol'
|
||||
);
|
||||
});
|
||||
|
||||
t.test('with symbols', { skip: !v.hasSymbols }, function (st) {
|
||||
forEach(
|
||||
[
|
||||
[Symbol(), undefined],
|
||||
[Symbol(undefined), undefined],
|
||||
[Symbol(null), 'null'],
|
||||
[Symbol.iterator, 'Symbol.iterator'],
|
||||
[Symbol('foo'), 'foo']
|
||||
],
|
||||
function (pair) {
|
||||
var sym = pair[0];
|
||||
var desc = pair[1];
|
||||
st.equal(getSymbolDescription(sym), desc, debug(sym) + ' description is ' + debug(desc));
|
||||
}
|
||||
);
|
||||
|
||||
st.test('only possible when inference or native `Symbol.prototype.description` is supported', {
|
||||
skip: !getInferredName && !has(Symbol.prototype, 'description')
|
||||
}, function (s2t) {
|
||||
s2t.equal(getSymbolDescription(Symbol('')), '', 'Symbol("") description is ""');
|
||||
|
||||
s2t.end();
|
||||
});
|
||||
|
||||
st.test('only possible when global symbols are supported', {
|
||||
skip: !has(Symbol, 'for') || !has(Symbol, 'keyFor')
|
||||
}, function (s2t) {
|
||||
// eslint-disable-next-line no-restricted-properties
|
||||
s2t.equal(getSymbolDescription(Symbol['for']('')), '', 'Symbol.for("") description is ""');
|
||||
s2t.end();
|
||||
});
|
||||
|
||||
st.end();
|
||||
});
|
||||
|
||||
t.end();
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
|
||||
var isPlainArray = require("../../is-plain-array")
|
||||
, callable = require("../../../object/valid-callable")
|
||||
, isArray = Array.isArray
|
||||
, map = Array.prototype.map
|
||||
, forEach = Array.prototype.forEach
|
||||
, call = Function.prototype.call;
|
||||
|
||||
module.exports = function (callbackFn /*, thisArg*/) {
|
||||
var result, thisArg;
|
||||
if (!this || !isArray(this) || isPlainArray(this)) {
|
||||
return map.apply(this, arguments);
|
||||
}
|
||||
callable(callbackFn);
|
||||
thisArg = arguments[1];
|
||||
result = new this.constructor(this.length);
|
||||
forEach.call(this, function (val, i, self) {
|
||||
result[i] = call.call(callbackFn, thisArg, val, i, self);
|
||||
});
|
||||
return result;
|
||||
};
|
||||
@@ -0,0 +1,2 @@
|
||||
if(typeof cptable === 'undefined') cptable = {};
|
||||
cptable[437] = (function(){ var d = "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ", D = [], e = {}; for(var i=0;i!=d.length;++i) { if(d.charCodeAt(i) !== 0xFFFD) e[d.charAt(i)] = i; D[i] = d.charAt(i); } return {"enc": e, "dec": D }; })();
|
||||
@@ -0,0 +1,33 @@
|
||||
var isObject = require('./isObject'),
|
||||
isPrototype = require('./_isPrototype'),
|
||||
nativeKeysIn = require('./_nativeKeysIn');
|
||||
|
||||
/** Used for built-in method references. */
|
||||
var objectProto = Object.prototype;
|
||||
|
||||
/** Used to check objects for own properties. */
|
||||
var hasOwnProperty = objectProto.hasOwnProperty;
|
||||
|
||||
/**
|
||||
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
||||
*
|
||||
* @private
|
||||
* @param {Object} object The object to query.
|
||||
* @returns {Array} Returns the array of property names.
|
||||
*/
|
||||
function baseKeysIn(object) {
|
||||
if (!isObject(object)) {
|
||||
return nativeKeysIn(object);
|
||||
}
|
||||
var isProto = isPrototype(object),
|
||||
result = [];
|
||||
|
||||
for (var key in object) {
|
||||
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
||||
result.push(key);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
module.exports = baseKeysIn;
|
||||
@@ -0,0 +1,6 @@
|
||||
import { noop } from './utils';
|
||||
export declare const is_client: boolean;
|
||||
export declare let now: () => number;
|
||||
export declare let raf: typeof noop | ((cb: any) => number);
|
||||
export declare function set_now(fn: any): void;
|
||||
export declare function set_raf(fn: any): void;
|
||||
@@ -0,0 +1,19 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var keys = require('object-keys');
|
||||
|
||||
var Type = require('./Type');
|
||||
|
||||
// https://262.ecma-international.org/6.0/#sec-enumerableownnames
|
||||
|
||||
module.exports = function EnumerableOwnNames(O) {
|
||||
if (Type(O) !== 'Object') {
|
||||
throw new $TypeError('Assertion failed: Type(O) is not Object');
|
||||
}
|
||||
|
||||
return keys(O);
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
var bind = require('function-bind');
|
||||
|
||||
module.exports = bind.call(Function.call, Object.prototype.hasOwnProperty);
|
||||
@@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "levn",
|
||||
"version": "0.3.0",
|
||||
"author": "George Zahariev <z@georgezahariev.com>",
|
||||
"description": "Light ECMAScript (JavaScript) Value Notation - human written, concise, typed, flexible",
|
||||
"homepage": "https://github.com/gkz/levn",
|
||||
"keywords": [
|
||||
"levn",
|
||||
"light",
|
||||
"ecmascript",
|
||||
"value",
|
||||
"notation",
|
||||
"json",
|
||||
"typed",
|
||||
"human",
|
||||
"concise",
|
||||
"typed",
|
||||
"flexible"
|
||||
],
|
||||
"files": [
|
||||
"lib",
|
||||
"README.md",
|
||||
"LICENSE"
|
||||
],
|
||||
"main": "./lib/",
|
||||
"bugs": "https://github.com/gkz/levn/issues",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 0.8.0"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/gkz/levn.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"dependencies": {
|
||||
"prelude-ls": "~1.1.2",
|
||||
"type-check": "~0.3.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"livescript": "~1.4.0",
|
||||
"mocha": "~2.3.4",
|
||||
"istanbul": "~0.4.1"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = require('functions-have-names')();
|
||||
|
||||
// TODO: semver-major, remove
|
||||
@@ -0,0 +1,102 @@
|
||||
'use strict';
|
||||
const {ERR_HTTP2_NO_SOCKET_MANIPULATION} = require('./errors.js');
|
||||
|
||||
/* istanbul ignore file */
|
||||
/* https://github.com/nodejs/node/blob/6eec858f34a40ffa489c1ec54bb24da72a28c781/lib/internal/http2/compat.js#L195-L272 */
|
||||
|
||||
const proxySocketHandler = {
|
||||
has(stream, property) {
|
||||
// Replaced [kSocket] with .socket
|
||||
const reference = stream.session === undefined ? stream : stream.session.socket;
|
||||
return (property in stream) || (property in reference);
|
||||
},
|
||||
|
||||
get(stream, property) {
|
||||
switch (property) {
|
||||
case 'on':
|
||||
case 'once':
|
||||
case 'end':
|
||||
case 'emit':
|
||||
case 'destroy':
|
||||
return stream[property].bind(stream);
|
||||
case 'writable':
|
||||
case 'destroyed':
|
||||
return stream[property];
|
||||
case 'readable':
|
||||
if (stream.destroyed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return stream.readable;
|
||||
case 'setTimeout': {
|
||||
const {session} = stream;
|
||||
if (session !== undefined) {
|
||||
return session.setTimeout.bind(session);
|
||||
}
|
||||
|
||||
return stream.setTimeout.bind(stream);
|
||||
}
|
||||
|
||||
case 'write':
|
||||
case 'read':
|
||||
case 'pause':
|
||||
case 'resume':
|
||||
throw new ERR_HTTP2_NO_SOCKET_MANIPULATION();
|
||||
default: {
|
||||
// Replaced [kSocket] with .socket
|
||||
const reference = stream.session === undefined ? stream : stream.session.socket;
|
||||
const value = reference[property];
|
||||
|
||||
return typeof value === 'function' ? value.bind(reference) : value;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getPrototypeOf(stream) {
|
||||
if (stream.session !== undefined) {
|
||||
// Replaced [kSocket] with .socket
|
||||
return Reflect.getPrototypeOf(stream.session.socket);
|
||||
}
|
||||
|
||||
return Reflect.getPrototypeOf(stream);
|
||||
},
|
||||
|
||||
set(stream, property, value) {
|
||||
switch (property) {
|
||||
case 'writable':
|
||||
case 'readable':
|
||||
case 'destroyed':
|
||||
case 'on':
|
||||
case 'once':
|
||||
case 'end':
|
||||
case 'emit':
|
||||
case 'destroy':
|
||||
stream[property] = value;
|
||||
return true;
|
||||
case 'setTimeout': {
|
||||
const {session} = stream;
|
||||
if (session === undefined) {
|
||||
stream.setTimeout = value;
|
||||
} else {
|
||||
session.setTimeout = value;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
case 'write':
|
||||
case 'read':
|
||||
case 'pause':
|
||||
case 'resume':
|
||||
throw new ERR_HTTP2_NO_SOCKET_MANIPULATION();
|
||||
default: {
|
||||
// Replaced [kSocket] with .socket
|
||||
const reference = stream.session === undefined ? stream : stream.session.socket;
|
||||
reference[property] = value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = proxySocketHandler;
|
||||
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
Extract all optional keys from the given type.
|
||||
|
||||
This is useful when you want to create a new type that contains different type values for the optional keys only.
|
||||
|
||||
@example
|
||||
```
|
||||
import type {OptionalKeysOf, Except} from 'type-fest';
|
||||
|
||||
interface User {
|
||||
name: string;
|
||||
surname: string;
|
||||
|
||||
luckyNumber?: number;
|
||||
}
|
||||
|
||||
const REMOVE_FIELD = Symbol('remove field symbol');
|
||||
type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
|
||||
[Key in OptionalKeysOf<Entity>]?: Entity[Key] | typeof REMOVE_FIELD;
|
||||
};
|
||||
|
||||
const update1: UpdateOperation<User> = {
|
||||
name: 'Alice'
|
||||
};
|
||||
|
||||
const update2: UpdateOperation<User> = {
|
||||
name: 'Bob',
|
||||
luckyNumber: REMOVE_FIELD
|
||||
};
|
||||
```
|
||||
|
||||
@category Utilities
|
||||
*/
|
||||
export type OptionalKeysOf<BaseType extends object> = Exclude<{
|
||||
[Key in keyof BaseType]: BaseType extends Record<Key, BaseType[Key]>
|
||||
? never
|
||||
: Key
|
||||
}[keyof BaseType], undefined>;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = function (x) { return x + 100; };
|
||||
@@ -0,0 +1,39 @@
|
||||
import {
|
||||
appendContextPath,
|
||||
blockParams,
|
||||
createFrame,
|
||||
isEmpty,
|
||||
isFunction
|
||||
} from '../utils';
|
||||
import Exception from '../exception';
|
||||
|
||||
export default function(instance) {
|
||||
instance.registerHelper('with', function(context, options) {
|
||||
if (arguments.length != 2) {
|
||||
throw new Exception('#with requires exactly one argument');
|
||||
}
|
||||
if (isFunction(context)) {
|
||||
context = context.call(this);
|
||||
}
|
||||
|
||||
let fn = options.fn;
|
||||
|
||||
if (!isEmpty(context)) {
|
||||
let data = options.data;
|
||||
if (options.data && options.ids) {
|
||||
data = createFrame(options.data);
|
||||
data.contextPath = appendContextPath(
|
||||
options.data.contextPath,
|
||||
options.ids[0]
|
||||
);
|
||||
}
|
||||
|
||||
return fn(context, {
|
||||
data: data,
|
||||
blockParams: blockParams([context], [data && data.contextPath])
|
||||
});
|
||||
} else {
|
||||
return options.inverse(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"delayWhen.js","sourceRoot":"","sources":["../../../../src/internal/operators/delayWhen.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAoFpD,MAAM,UAAU,SAAS,CACvB,qBAAwE,EACxE,iBAAmC;IAEnC,IAAI,iBAAiB,EAAE;QAErB,OAAO,UAAC,MAAqB;YAC3B,OAAA,MAAM,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC,CAAC;QAAxG,CAAwG,CAAC;KAC5G;IAED,OAAO,QAAQ,CAAC,UAAC,KAAK,EAAE,KAAK,IAAK,OAAA,SAAS,CAAC,qBAAqB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAA1E,CAA0E,CAAC,CAAC;AAChH,CAAC"}
|
||||
@@ -0,0 +1,5 @@
|
||||
var convert = require('./convert'),
|
||||
func = convert('ary', require('../ary'));
|
||||
|
||||
func.placeholder = require('./placeholder');
|
||||
module.exports = func;
|
||||
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
var define = require('define-properties');
|
||||
var getPolyfill = require('./polyfill');
|
||||
|
||||
module.exports = function shimArrayPrototypeMap() {
|
||||
var polyfill = getPolyfill();
|
||||
define(
|
||||
Array.prototype,
|
||||
{ map: polyfill },
|
||||
{ map: function () { return Array.prototype.map !== polyfill; } }
|
||||
);
|
||||
return polyfill;
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.timeoutWith = void 0;
|
||||
var async_1 = require("../scheduler/async");
|
||||
var isDate_1 = require("../util/isDate");
|
||||
var timeout_1 = require("./timeout");
|
||||
function timeoutWith(due, withObservable, scheduler) {
|
||||
var first;
|
||||
var each;
|
||||
var _with;
|
||||
scheduler = scheduler !== null && scheduler !== void 0 ? scheduler : async_1.async;
|
||||
if (isDate_1.isValidDate(due)) {
|
||||
first = due;
|
||||
}
|
||||
else if (typeof due === 'number') {
|
||||
each = due;
|
||||
}
|
||||
if (withObservable) {
|
||||
_with = function () { return withObservable; };
|
||||
}
|
||||
else {
|
||||
throw new TypeError('No observable provided to switch to');
|
||||
}
|
||||
if (first == null && each == null) {
|
||||
throw new TypeError('No timeout provided.');
|
||||
}
|
||||
return timeout_1.timeout({
|
||||
first: first,
|
||||
each: each,
|
||||
scheduler: scheduler,
|
||||
with: _with,
|
||||
});
|
||||
}
|
||||
exports.timeoutWith = timeoutWith;
|
||||
//# sourceMappingURL=timeoutWith.js.map
|
||||
@@ -0,0 +1,19 @@
|
||||
/** Used to match a single whitespace character. */
|
||||
var reWhitespace = /\s/;
|
||||
|
||||
/**
|
||||
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
||||
* character of `string`.
|
||||
*
|
||||
* @private
|
||||
* @param {string} string The string to inspect.
|
||||
* @returns {number} Returns the index of the last non-whitespace character.
|
||||
*/
|
||||
function trimmedEndIndex(string) {
|
||||
var index = string.length;
|
||||
|
||||
while (index-- && reWhitespace.test(string.charAt(index))) {}
|
||||
return index;
|
||||
}
|
||||
|
||||
module.exports = trimmedEndIndex;
|
||||
@@ -0,0 +1,54 @@
|
||||
import { Scheduler } from '../Scheduler';
|
||||
import { Action } from './Action';
|
||||
import { AsyncAction } from './AsyncAction';
|
||||
import { TimerHandle } from './timerHandle';
|
||||
|
||||
export class AsyncScheduler extends Scheduler {
|
||||
public actions: Array<AsyncAction<any>> = [];
|
||||
/**
|
||||
* A flag to indicate whether the Scheduler is currently executing a batch of
|
||||
* queued actions.
|
||||
* @type {boolean}
|
||||
* @internal
|
||||
*/
|
||||
public _active: boolean = false;
|
||||
/**
|
||||
* An internal ID used to track the latest asynchronous task such as those
|
||||
* coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and
|
||||
* others.
|
||||
* @type {any}
|
||||
* @internal
|
||||
*/
|
||||
public _scheduled: TimerHandle | undefined;
|
||||
|
||||
constructor(SchedulerAction: typeof Action, now: () => number = Scheduler.now) {
|
||||
super(SchedulerAction, now);
|
||||
}
|
||||
|
||||
public flush(action: AsyncAction<any>): void {
|
||||
const { actions } = this;
|
||||
|
||||
if (this._active) {
|
||||
actions.push(action);
|
||||
return;
|
||||
}
|
||||
|
||||
let error: any;
|
||||
this._active = true;
|
||||
|
||||
do {
|
||||
if ((error = action.execute(action.state, action.delay))) {
|
||||
break;
|
||||
}
|
||||
} while ((action = actions.shift()!)); // exhaust the scheduler queue
|
||||
|
||||
this._active = false;
|
||||
|
||||
if (error) {
|
||||
while ((action = actions.shift()!)) {
|
||||
action.unsubscribe();
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
var arrayMap = require('./_arrayMap'),
|
||||
baseAt = require('./_baseAt'),
|
||||
basePullAt = require('./_basePullAt'),
|
||||
compareAscending = require('./_compareAscending'),
|
||||
flatRest = require('./_flatRest'),
|
||||
isIndex = require('./_isIndex');
|
||||
|
||||
/**
|
||||
* Removes elements from `array` corresponding to `indexes` and returns an
|
||||
* array of removed elements.
|
||||
*
|
||||
* **Note:** Unlike `_.at`, this method mutates `array`.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @since 3.0.0
|
||||
* @category Array
|
||||
* @param {Array} array The array to modify.
|
||||
* @param {...(number|number[])} [indexes] The indexes of elements to remove.
|
||||
* @returns {Array} Returns the new array of removed elements.
|
||||
* @example
|
||||
*
|
||||
* var array = ['a', 'b', 'c', 'd'];
|
||||
* var pulled = _.pullAt(array, [1, 3]);
|
||||
*
|
||||
* console.log(array);
|
||||
* // => ['a', 'c']
|
||||
*
|
||||
* console.log(pulled);
|
||||
* // => ['b', 'd']
|
||||
*/
|
||||
var pullAt = flatRest(function(array, indexes) {
|
||||
var length = array == null ? 0 : array.length,
|
||||
result = baseAt(array, indexes);
|
||||
|
||||
basePullAt(array, arrayMap(indexes, function(index) {
|
||||
return isIndex(index, length) ? +index : index;
|
||||
}).sort(compareAscending));
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
module.exports = pullAt;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"performanceTimestampProvider.d.ts","sourceRoot":"","sources":["../../../../src/internal/scheduler/performanceTimestampProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,UAAU,4BAA6B,SAAQ,iBAAiB;IAC9D,QAAQ,EAAE,iBAAiB,GAAG,SAAS,CAAC;CACzC;AAED,eAAO,MAAM,4BAA4B,EAAE,4BAO1C,CAAC"}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
Recursively split a string literal into two parts on the first occurence of the given string, returning an array literal of all the separate parts.
|
||||
*/
|
||||
export type Split<S extends string, D extends string> =
|
||||
string extends S ? string[] :
|
||||
S extends '' ? [] :
|
||||
S extends `${infer T}${D}${infer U}` ? [T, ...Split<U, D>] :
|
||||
[S];
|
||||
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var GetIntrinsic = require('get-intrinsic');
|
||||
|
||||
var $TypeError = GetIntrinsic('%TypeError%');
|
||||
|
||||
var Type = require('../Type');
|
||||
|
||||
// https://262.ecma-international.org/11.0/#sec-numeric-types-number-subtract
|
||||
|
||||
module.exports = function NumberSubtract(x, y) {
|
||||
if (Type(x) !== 'Number' || Type(y) !== 'Number') {
|
||||
throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
|
||||
}
|
||||
return x - y;
|
||||
};
|
||||
@@ -0,0 +1,287 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs');
|
||||
const { Readable } = require('stream');
|
||||
const sysPath = require('path');
|
||||
const { promisify } = require('util');
|
||||
const picomatch = require('picomatch');
|
||||
|
||||
const readdir = promisify(fs.readdir);
|
||||
const stat = promisify(fs.stat);
|
||||
const lstat = promisify(fs.lstat);
|
||||
const realpath = promisify(fs.realpath);
|
||||
|
||||
/**
|
||||
* @typedef {Object} EntryInfo
|
||||
* @property {String} path
|
||||
* @property {String} fullPath
|
||||
* @property {fs.Stats=} stats
|
||||
* @property {fs.Dirent=} dirent
|
||||
* @property {String} basename
|
||||
*/
|
||||
|
||||
const BANG = '!';
|
||||
const RECURSIVE_ERROR_CODE = 'READDIRP_RECURSIVE_ERROR';
|
||||
const NORMAL_FLOW_ERRORS = new Set(['ENOENT', 'EPERM', 'EACCES', 'ELOOP', RECURSIVE_ERROR_CODE]);
|
||||
const FILE_TYPE = 'files';
|
||||
const DIR_TYPE = 'directories';
|
||||
const FILE_DIR_TYPE = 'files_directories';
|
||||
const EVERYTHING_TYPE = 'all';
|
||||
const ALL_TYPES = [FILE_TYPE, DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE];
|
||||
|
||||
const isNormalFlowError = error => NORMAL_FLOW_ERRORS.has(error.code);
|
||||
const [maj, min] = process.versions.node.split('.').slice(0, 2).map(n => Number.parseInt(n, 10));
|
||||
const wantBigintFsStats = process.platform === 'win32' && (maj > 10 || (maj === 10 && min >= 5));
|
||||
|
||||
const normalizeFilter = filter => {
|
||||
if (filter === undefined) return;
|
||||
if (typeof filter === 'function') return filter;
|
||||
|
||||
if (typeof filter === 'string') {
|
||||
const glob = picomatch(filter.trim());
|
||||
return entry => glob(entry.basename);
|
||||
}
|
||||
|
||||
if (Array.isArray(filter)) {
|
||||
const positive = [];
|
||||
const negative = [];
|
||||
for (const item of filter) {
|
||||
const trimmed = item.trim();
|
||||
if (trimmed.charAt(0) === BANG) {
|
||||
negative.push(picomatch(trimmed.slice(1)));
|
||||
} else {
|
||||
positive.push(picomatch(trimmed));
|
||||
}
|
||||
}
|
||||
|
||||
if (negative.length > 0) {
|
||||
if (positive.length > 0) {
|
||||
return entry =>
|
||||
positive.some(f => f(entry.basename)) && !negative.some(f => f(entry.basename));
|
||||
}
|
||||
return entry => !negative.some(f => f(entry.basename));
|
||||
}
|
||||
return entry => positive.some(f => f(entry.basename));
|
||||
}
|
||||
};
|
||||
|
||||
class ReaddirpStream extends Readable {
|
||||
static get defaultOptions() {
|
||||
return {
|
||||
root: '.',
|
||||
/* eslint-disable no-unused-vars */
|
||||
fileFilter: (path) => true,
|
||||
directoryFilter: (path) => true,
|
||||
/* eslint-enable no-unused-vars */
|
||||
type: FILE_TYPE,
|
||||
lstat: false,
|
||||
depth: 2147483648,
|
||||
alwaysStat: false
|
||||
};
|
||||
}
|
||||
|
||||
constructor(options = {}) {
|
||||
super({
|
||||
objectMode: true,
|
||||
autoDestroy: true,
|
||||
highWaterMark: options.highWaterMark || 4096
|
||||
});
|
||||
const opts = { ...ReaddirpStream.defaultOptions, ...options };
|
||||
const { root, type } = opts;
|
||||
|
||||
this._fileFilter = normalizeFilter(opts.fileFilter);
|
||||
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
||||
|
||||
const statMethod = opts.lstat ? lstat : stat;
|
||||
// Use bigint stats if it's windows and stat() supports options (node 10+).
|
||||
if (wantBigintFsStats) {
|
||||
this._stat = path => statMethod(path, { bigint: true });
|
||||
} else {
|
||||
this._stat = statMethod;
|
||||
}
|
||||
|
||||
this._maxDepth = opts.depth;
|
||||
this._wantsDir = [DIR_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
|
||||
this._wantsFile = [FILE_TYPE, FILE_DIR_TYPE, EVERYTHING_TYPE].includes(type);
|
||||
this._wantsEverything = type === EVERYTHING_TYPE;
|
||||
this._root = sysPath.resolve(root);
|
||||
this._isDirent = ('Dirent' in fs) && !opts.alwaysStat;
|
||||
this._statsProp = this._isDirent ? 'dirent' : 'stats';
|
||||
this._rdOptions = { encoding: 'utf8', withFileTypes: this._isDirent };
|
||||
|
||||
// Launch stream with one parent, the root dir.
|
||||
this.parents = [this._exploreDir(root, 1)];
|
||||
this.reading = false;
|
||||
this.parent = undefined;
|
||||
}
|
||||
|
||||
async _read(batch) {
|
||||
if (this.reading) return;
|
||||
this.reading = true;
|
||||
|
||||
try {
|
||||
while (!this.destroyed && batch > 0) {
|
||||
const { path, depth, files = [] } = this.parent || {};
|
||||
|
||||
if (files.length > 0) {
|
||||
const slice = files.splice(0, batch).map(dirent => this._formatEntry(dirent, path));
|
||||
for (const entry of await Promise.all(slice)) {
|
||||
if (this.destroyed) return;
|
||||
|
||||
const entryType = await this._getEntryType(entry);
|
||||
if (entryType === 'directory' && this._directoryFilter(entry)) {
|
||||
if (depth <= this._maxDepth) {
|
||||
this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
|
||||
}
|
||||
|
||||
if (this._wantsDir) {
|
||||
this.push(entry);
|
||||
batch--;
|
||||
}
|
||||
} else if ((entryType === 'file' || this._includeAsFile(entry)) && this._fileFilter(entry)) {
|
||||
if (this._wantsFile) {
|
||||
this.push(entry);
|
||||
batch--;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const parent = this.parents.pop();
|
||||
if (!parent) {
|
||||
this.push(null);
|
||||
break;
|
||||
}
|
||||
this.parent = await parent;
|
||||
if (this.destroyed) return;
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
this.destroy(error);
|
||||
} finally {
|
||||
this.reading = false;
|
||||
}
|
||||
}
|
||||
|
||||
async _exploreDir(path, depth) {
|
||||
let files;
|
||||
try {
|
||||
files = await readdir(path, this._rdOptions);
|
||||
} catch (error) {
|
||||
this._onError(error);
|
||||
}
|
||||
return { files, depth, path };
|
||||
}
|
||||
|
||||
async _formatEntry(dirent, path) {
|
||||
let entry;
|
||||
try {
|
||||
const basename = this._isDirent ? dirent.name : dirent;
|
||||
const fullPath = sysPath.resolve(sysPath.join(path, basename));
|
||||
entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename };
|
||||
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
||||
} catch (err) {
|
||||
this._onError(err);
|
||||
}
|
||||
return entry;
|
||||
}
|
||||
|
||||
_onError(err) {
|
||||
if (isNormalFlowError(err) && !this.destroyed) {
|
||||
this.emit('warn', err);
|
||||
} else {
|
||||
this.destroy(err);
|
||||
}
|
||||
}
|
||||
|
||||
async _getEntryType(entry) {
|
||||
// entry may be undefined, because a warning or an error were emitted
|
||||
// and the statsProp is undefined
|
||||
const stats = entry && entry[this._statsProp];
|
||||
if (!stats) {
|
||||
return;
|
||||
}
|
||||
if (stats.isFile()) {
|
||||
return 'file';
|
||||
}
|
||||
if (stats.isDirectory()) {
|
||||
return 'directory';
|
||||
}
|
||||
if (stats && stats.isSymbolicLink()) {
|
||||
const full = entry.fullPath;
|
||||
try {
|
||||
const entryRealPath = await realpath(full);
|
||||
const entryRealPathStats = await lstat(entryRealPath);
|
||||
if (entryRealPathStats.isFile()) {
|
||||
return 'file';
|
||||
}
|
||||
if (entryRealPathStats.isDirectory()) {
|
||||
const len = entryRealPath.length;
|
||||
if (full.startsWith(entryRealPath) && full.substr(len, 1) === sysPath.sep) {
|
||||
const recursiveError = new Error(
|
||||
`Circular symlink detected: "${full}" points to "${entryRealPath}"`
|
||||
);
|
||||
recursiveError.code = RECURSIVE_ERROR_CODE;
|
||||
return this._onError(recursiveError);
|
||||
}
|
||||
return 'directory';
|
||||
}
|
||||
} catch (error) {
|
||||
this._onError(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_includeAsFile(entry) {
|
||||
const stats = entry && entry[this._statsProp];
|
||||
|
||||
return stats && this._wantsEverything && !stats.isDirectory();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} ReaddirpArguments
|
||||
* @property {Function=} fileFilter
|
||||
* @property {Function=} directoryFilter
|
||||
* @property {String=} type
|
||||
* @property {Number=} depth
|
||||
* @property {String=} root
|
||||
* @property {Boolean=} lstat
|
||||
* @property {Boolean=} bigint
|
||||
*/
|
||||
|
||||
/**
|
||||
* Main function which ends up calling readdirRec and reads all files and directories in given root recursively.
|
||||
* @param {String} root Root directory
|
||||
* @param {ReaddirpArguments=} options Options to specify root (start directory), filters and recursion depth
|
||||
*/
|
||||
const readdirp = (root, options = {}) => {
|
||||
let type = options.entryType || options.type;
|
||||
if (type === 'both') type = FILE_DIR_TYPE; // backwards-compatibility
|
||||
if (type) options.type = type;
|
||||
if (!root) {
|
||||
throw new Error('readdirp: root argument is required. Usage: readdirp(root, options)');
|
||||
} else if (typeof root !== 'string') {
|
||||
throw new TypeError('readdirp: root argument must be a string. Usage: readdirp(root, options)');
|
||||
} else if (type && !ALL_TYPES.includes(type)) {
|
||||
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(', ')}`);
|
||||
}
|
||||
|
||||
options.root = root;
|
||||
return new ReaddirpStream(options);
|
||||
};
|
||||
|
||||
const readdirpPromise = (root, options = {}) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const files = [];
|
||||
readdirp(root, options)
|
||||
.on('data', entry => files.push(entry))
|
||||
.on('end', () => resolve(files))
|
||||
.on('error', error => reject(error));
|
||||
});
|
||||
};
|
||||
|
||||
readdirp.promise = readdirpPromise;
|
||||
readdirp.ReaddirpStream = ReaddirpStream;
|
||||
readdirp.default = readdirp;
|
||||
|
||||
module.exports = readdirp;
|
||||
@@ -0,0 +1,7 @@
|
||||
import { EnsureFunction, EnsureBaseOptions, EnsureIsOptional, EnsureDefault } from '../ensure';
|
||||
|
||||
declare function ensureFunction(value: any, options?: EnsureBaseOptions): EnsureFunction;
|
||||
declare function ensureFunction(value: any, options?: EnsureBaseOptions & EnsureIsOptional): EnsureFunction | null;
|
||||
declare function ensureFunction(value: any, options?: EnsureBaseOptions & EnsureIsOptional & EnsureDefault<EnsureFunction>): EnsureFunction;
|
||||
|
||||
export default ensureFunction;
|
||||
@@ -0,0 +1,99 @@
|
||||
"use strict"
|
||||
|
||||
var defaults = require('defaults')
|
||||
var combining = require('./combining')
|
||||
|
||||
var DEFAULTS = {
|
||||
nul: 0,
|
||||
control: 0
|
||||
}
|
||||
|
||||
module.exports = function wcwidth(str) {
|
||||
return wcswidth(str, DEFAULTS)
|
||||
}
|
||||
|
||||
module.exports.config = function(opts) {
|
||||
opts = defaults(opts || {}, DEFAULTS)
|
||||
return function wcwidth(str) {
|
||||
return wcswidth(str, opts)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* The following functions define the column width of an ISO 10646
|
||||
* character as follows:
|
||||
* - The null character (U+0000) has a column width of 0.
|
||||
* - Other C0/C1 control characters and DEL will lead to a return value
|
||||
* of -1.
|
||||
* - Non-spacing and enclosing combining characters (general category
|
||||
* code Mn or Me in the
|
||||
* Unicode database) have a column width of 0.
|
||||
* - SOFT HYPHEN (U+00AD) has a column width of 1.
|
||||
* - Other format characters (general category code Cf in the Unicode
|
||||
* database) and ZERO WIDTH
|
||||
* SPACE (U+200B) have a column width of 0.
|
||||
* - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF)
|
||||
* have a column width of 0.
|
||||
* - Spacing characters in the East Asian Wide (W) or East Asian
|
||||
* Full-width (F) category as
|
||||
* defined in Unicode Technical Report #11 have a column width of 2.
|
||||
* - All remaining characters (including all printable ISO 8859-1 and
|
||||
* WGL4 characters, Unicode control characters, etc.) have a column
|
||||
* width of 1.
|
||||
* This implementation assumes that characters are encoded in ISO 10646.
|
||||
*/
|
||||
|
||||
function wcswidth(str, opts) {
|
||||
if (typeof str !== 'string') return wcwidth(str, opts)
|
||||
|
||||
var s = 0
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
var n = wcwidth(str.charCodeAt(i), opts)
|
||||
if (n < 0) return -1
|
||||
s += n
|
||||
}
|
||||
|
||||
return s
|
||||
}
|
||||
|
||||
function wcwidth(ucs, opts) {
|
||||
// test for 8-bit control characters
|
||||
if (ucs === 0) return opts.nul
|
||||
if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) return opts.control
|
||||
|
||||
// binary search in table of non-spacing characters
|
||||
if (bisearch(ucs)) return 0
|
||||
|
||||
// if we arrive here, ucs is not a combining or C0/C1 control character
|
||||
return 1 +
|
||||
(ucs >= 0x1100 &&
|
||||
(ucs <= 0x115f || // Hangul Jamo init. consonants
|
||||
ucs == 0x2329 || ucs == 0x232a ||
|
||||
(ucs >= 0x2e80 && ucs <= 0xa4cf &&
|
||||
ucs != 0x303f) || // CJK ... Yi
|
||||
(ucs >= 0xac00 && ucs <= 0xd7a3) || // Hangul Syllables
|
||||
(ucs >= 0xf900 && ucs <= 0xfaff) || // CJK Compatibility Ideographs
|
||||
(ucs >= 0xfe10 && ucs <= 0xfe19) || // Vertical forms
|
||||
(ucs >= 0xfe30 && ucs <= 0xfe6f) || // CJK Compatibility Forms
|
||||
(ucs >= 0xff00 && ucs <= 0xff60) || // Fullwidth Forms
|
||||
(ucs >= 0xffe0 && ucs <= 0xffe6) ||
|
||||
(ucs >= 0x20000 && ucs <= 0x2fffd) ||
|
||||
(ucs >= 0x30000 && ucs <= 0x3fffd)));
|
||||
}
|
||||
|
||||
function bisearch(ucs) {
|
||||
var min = 0
|
||||
var max = combining.length - 1
|
||||
var mid
|
||||
|
||||
if (ucs < combining[0][0] || ucs > combining[max][1]) return false
|
||||
|
||||
while (max >= min) {
|
||||
mid = Math.floor((min + max) / 2)
|
||||
if (ucs > combining[mid][1]) min = mid + 1
|
||||
else if (ucs < combining[mid][0]) max = mid - 1
|
||||
else return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
# 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).
|
||||
|
||||
## [v1.0.2](https://github.com/inspect-js/is-shared-array-buffer/compare/v1.0.1...v1.0.2) - 2022-04-01
|
||||
|
||||
### Commits
|
||||
|
||||
- [actions] reuse common workflows [`48d01e6`](https://github.com/inspect-js/is-shared-array-buffer/commit/48d01e690f76c92f5c9072fbcb9b6215402db8a7)
|
||||
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`7b0e12a`](https://github.com/inspect-js/is-shared-array-buffer/commit/7b0e12a4e8f5db8eac586be68c879119a4a12e7a)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `safe-publish-latest`, `tape` [`8d57a8e`](https://github.com/inspect-js/is-shared-array-buffer/commit/8d57a8e1d9ce093f04f83e196ca7c80a02617939)
|
||||
- [readme] update URLs [`dca4d27`](https://github.com/inspect-js/is-shared-array-buffer/commit/dca4d27d35352309da5abb4feb584158004008cf)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`2a7bb99`](https://github.com/inspect-js/is-shared-array-buffer/commit/2a7bb990610d7f6c058bdae7f21c49cc7276848f)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `auto-changelog`, `object-inspect`, `safe-publish-latest`, `tape` [`389c6db`](https://github.com/inspect-js/is-shared-array-buffer/commit/389c6db4311a85a84fd4cb75646f26023b0c1685)
|
||||
- [actions] update codecov uploader [`b9661f9`](https://github.com/inspect-js/is-shared-array-buffer/commit/b9661f9ac2e1e002372b9b1e136faca837a6647f)
|
||||
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `object-inspect` [`f99cd48`](https://github.com/inspect-js/is-shared-array-buffer/commit/f99cd4827e23bc893ed711cbffe28f3e51a4d401)
|
||||
- [readme] add actions and codecov badges [`9515ed2`](https://github.com/inspect-js/is-shared-array-buffer/commit/9515ed2184a3ed1ce913b92b5092884dad5ac794)
|
||||
- [Fix] add missing `call-bind` dependency [`cff5358`](https://github.com/inspect-js/is-shared-array-buffer/commit/cff53582740f9f053ec67e1acbf2bafc83bdb7b5)
|
||||
- [meta] add `safe-publish-latest`; use `prepublishOnly` script for npm 7+ [`ba0b719`](https://github.com/inspect-js/is-shared-array-buffer/commit/ba0b7190a42d4290d31a5fce215e874da573dd77)
|
||||
|
||||
## [v1.0.1](https://github.com/inspect-js/is-shared-array-buffer/compare/v1.0.0...v1.0.1) - 2021-03-04
|
||||
|
||||
### Commits
|
||||
|
||||
- [readme] fix repo URLs [`37c38f3`](https://github.com/inspect-js/is-shared-array-buffer/commit/37c38f347392da177197dd2fd518b61240a56203)
|
||||
|
||||
## v1.0.0 - 2021-03-04
|
||||
|
||||
### Commits
|
||||
|
||||
- [Tests] add tests [`9c7b806`](https://github.com/inspect-js/is-shared-array-buffer/commit/9c7b806ab1528814308a7420f8198644f55c916f)
|
||||
- Initial commit [`4e65c5e`](https://github.com/inspect-js/is-shared-array-buffer/commit/4e65c5ecdaa255162bc6507de4ff98cea2472e3b)
|
||||
- [meta] do not publish github action workflow files [`ac3693d`](https://github.com/inspect-js/is-shared-array-buffer/commit/ac3693db8ec26db5444ef4b46aa38a81e8841d30)
|
||||
- readme [`7a984d0`](https://github.com/inspect-js/is-shared-array-buffer/commit/7a984d0db73b77943f6731098134e3351a36793b)
|
||||
- npm init [`a586c99`](https://github.com/inspect-js/is-shared-array-buffer/commit/a586c99316f3c8ae4fd5125621ea933e97a1bf1b)
|
||||
- [actions] add automatic rebasing / merge commit blocking [`184fe62`](https://github.com/inspect-js/is-shared-array-buffer/commit/184fe622680d523e89ac322fa1a52dbba46a8fc0)
|
||||
- Implementation [`207e26d`](https://github.com/inspect-js/is-shared-array-buffer/commit/207e26d1128930f28384cb213b38d69fd52bbd7c)
|
||||
- [meta] create `FUNDING.yml`; add "funding" field [`3cad3fc`](https://github.com/inspect-js/is-shared-array-buffer/commit/3cad3fc9509f91fbc71e84565529f53a94d538d4)
|
||||
- [meta] add auto-changelog [`31f1f2c`](https://github.com/inspect-js/is-shared-array-buffer/commit/31f1f2cbcd616d6c09089d62198d5cc775053324)
|
||||
- [Tests] add `npm run lint` [`2e5146e`](https://github.com/inspect-js/is-shared-array-buffer/commit/2e5146e18f44533382a781fa09a50d4f47caa0e5)
|
||||
- Only apps should have lockfiles [`7b2adfa`](https://github.com/inspect-js/is-shared-array-buffer/commit/7b2adfad6dcd95271ab6ba34658a9a1a21dbeacf)
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"name": "responselike",
|
||||
"version": "3.0.0",
|
||||
"description": "A response-like object for mocking a Node.js HTTP response stream",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/responselike",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": "Luke Childs <lukechilds123@gmail.com> (https://lukechilds.co.uk)",
|
||||
"type": "module",
|
||||
"exports": "./index.js",
|
||||
"engines": {
|
||||
"node": ">=14.16"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"http",
|
||||
"https",
|
||||
"response",
|
||||
"mock",
|
||||
"test",
|
||||
"request",
|
||||
"responselike"
|
||||
],
|
||||
"dependencies": {
|
||||
"lowercase-keys": "^3.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"ava": "^4.3.1",
|
||||
"get-stream": "^6.0.1",
|
||||
"tsd": "^0.22.0",
|
||||
"xo": "^0.50.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"delay.js","sourceRoot":"","sources":["../../../../src/internal/operators/delay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AA0D5C,MAAM,UAAU,KAAK,CAAI,GAAkB,EAAE,YAA2B,cAAc;IACpF,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IACvC,OAAO,SAAS,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC"}
|
||||
@@ -0,0 +1,19 @@
|
||||
import { __read, __spreadArray } from "tslib";
|
||||
import { Immediate } from '../util/Immediate';
|
||||
var setImmediate = Immediate.setImmediate, clearImmediate = Immediate.clearImmediate;
|
||||
export var immediateProvider = {
|
||||
setImmediate: function () {
|
||||
var args = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
args[_i] = arguments[_i];
|
||||
}
|
||||
var delegate = immediateProvider.delegate;
|
||||
return ((delegate === null || delegate === void 0 ? void 0 : delegate.setImmediate) || setImmediate).apply(void 0, __spreadArray([], __read(args)));
|
||||
},
|
||||
clearImmediate: function (handle) {
|
||||
var delegate = immediateProvider.delegate;
|
||||
return ((delegate === null || delegate === void 0 ? void 0 : delegate.clearImmediate) || clearImmediate)(handle);
|
||||
},
|
||||
delegate: undefined,
|
||||
};
|
||||
//# sourceMappingURL=immediateProvider.js.map
|
||||
Reference in New Issue
Block a user