new license file version [CI SKIP]

This commit is contained in:
2023-03-15 12:34:41 +00:00
parent 0a6d92a1f3
commit 61328d20ed
13115 changed files with 1892314 additions and 1 deletions

View File

@@ -0,0 +1,19 @@
module.exports = removeHook;
function removeHook(state, name, method) {
if (!state.registry[name]) {
return;
}
var index = state.registry[name]
.map(function (registered) {
return registered.orig;
})
.indexOf(method);
if (index === -1) {
return;
}
state.registry[name].splice(index, 1);
}

View File

@@ -0,0 +1,27 @@
import { innerFrom } from '../observable/innerFrom';
import { createOperatorSubscriber } from './OperatorSubscriber';
import { operate } from '../util/lift';
export function catchError(selector) {
return operate(function (source, subscriber) {
var innerSub = null;
var syncUnsub = false;
var handledResult;
innerSub = source.subscribe(createOperatorSubscriber(subscriber, undefined, undefined, function (err) {
handledResult = innerFrom(selector(err, catchError(selector)(source)));
if (innerSub) {
innerSub.unsubscribe();
innerSub = null;
handledResult.subscribe(subscriber);
}
else {
syncUnsub = true;
}
}));
if (syncUnsub) {
innerSub.unsubscribe();
innerSub = null;
handledResult.subscribe(subscriber);
}
});
}
//# sourceMappingURL=catchError.js.map

View File

@@ -0,0 +1,24 @@
'use strict';
var callBound = require('call-bind/callBound');
var $PromiseThen = callBound('Promise.prototype.then', true);
var Type = require('./Type');
// https://262.ecma-international.org/6.0/#sec-ispromise
module.exports = function IsPromise(x) {
if (Type(x) !== 'Object') {
return false;
}
if (!$PromiseThen) { // Promises are not supported
return false;
}
try {
$PromiseThen(x); // throws if not a promise
} catch (e) {
return false;
}
return true;
};

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"1":"B","2":"J D E F A CC"},B:{"1":"C K L G M N O P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H"},C:{"1":"0 1 2 3 4 5 6 7 8 9 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","2":"DC tB I v J D E F EC FC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 I v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC"},E:{"1":"I v J D E F A B C K L G IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","2":"HC zB"},F:{"1":"0 1 2 3 4 5 6 7 8 9 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 qB AC TC rB","2":"F PC QC RC SC","16":"B"},G:{"1":"E zB UC BC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC nC 2B 3B 4B 5B sB 6B 7B 8B 9B"},H:{"1":"oC"},I:{"1":"tB I f pC qC rC sC BC tC uC"},J:{"1":"D A"},K:{"1":"h","16":"A B C qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"1":"B","2":"A"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:1,C:"console.time and console.timeEnd"};

View File

@@ -0,0 +1,32 @@
var baseProperty = require('./_baseProperty'),
basePropertyDeep = require('./_basePropertyDeep'),
isKey = require('./_isKey'),
toKey = require('./_toKey');
/**
* Creates a function that returns the value at `path` of a given object.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {Array|string} path The path of the property to get.
* @returns {Function} Returns the new accessor function.
* @example
*
* var objects = [
* { 'a': { 'b': 2 } },
* { 'a': { 'b': 1 } }
* ];
*
* _.map(objects, _.property('a.b'));
* // => [2, 1]
*
* _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');
* // => [1, 2]
*/
function property(path) {
return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);
}
module.exports = property;

View File

@@ -0,0 +1,30 @@
module.exports = function properlyBoxed(method) {
// Check node 0.6.21 bug where third parameter is not boxed
var properlyBoxesNonStrict = true;
var properlyBoxesStrict = true;
var threwException = false;
if (typeof method === 'function') {
try {
// eslint-disable-next-line max-params
method.call('f', function (_, __, O) {
if (typeof O !== 'object') {
properlyBoxesNonStrict = false;
}
});
method.call(
[null],
function () {
'use strict';
properlyBoxesStrict = typeof this === 'string'; // eslint-disable-line no-invalid-this
},
'x'
);
} catch (e) {
threwException = true;
}
return !threwException && properlyBoxesNonStrict && properlyBoxesStrict;
}
return false;
};

View File

@@ -0,0 +1 @@
{"name":"typed-array-length","version":"1.0.4","files":{".nycrc":{"checkedAt":1678883671537,"integrity":"sha512-42sgwWzusJB1Dzhl78jX/Zg65Oi0HDDMOGXS/Uklv1kCYn4fHtRsD/JFPwdu+d40vome9XdUspzRWEQAcTGEeQ==","mode":420,"size":216},"LICENSE":{"checkedAt":1678883671601,"integrity":"sha512-Pg0j9BX+Fmp8mAx1XW2wDVYsnbXuEq5QKBINQE+k1CyfdfAzv0tb/KUpKlAfmNVDddSa6Px43FQXpmTJrbd2Jw==","mode":420,"size":1067},".eslintrc":{"checkedAt":1678883671733,"integrity":"sha512-CnBpot9rH79CKBNtXkVMn+ZZRJHRgaqvmMgWOUrlzPuQsY/10Z3LRFgDCh2WG1IrOq8mk8iW4I6O97WGIOAtbA==","mode":420,"size":174},"index.js":{"checkedAt":1678883671733,"integrity":"sha512-aTW859p4s8bhjb+M7TUFr1LshuEpWn2y9BBYHulM4j71Ho8DjvApI+V1T7v9QbwIzpsAks6m5ajKSAoZQkK+ag==","mode":420,"size":2011},"test/index.js":{"checkedAt":1678883671733,"integrity":"sha512-mga5FqlgC7KIFU8AzE2jUTlxA9RrG3QNqIoJ1j1GETcBBppPc9M5Te4wWCyofRFNt3qvGrbYZk+ySugHtoiYoQ==","mode":420,"size":2753},"package.json":{"checkedAt":1678883671734,"integrity":"sha512-l6TLUycBwaa5t/ZsO9E1MaiN4tYr/fB4e+ZErTqCzpoN5x7WiKCHTtiBQNBVY9em2Xb+pCzWQ/lxCUVMm+xgDA==","mode":420,"size":2308},"README.md":{"checkedAt":1678883671737,"integrity":"sha512-oK2VoehZ4hBW2F6TvRl5rx6my5w0YPChjyW03Z4i3xK3bxfS5Nhu5wJxP53aJFAeMtBX7XremqYmCphA7RRkYg==","mode":420,"size":2805},".github/FUNDING.yml":{"checkedAt":1678883671737,"integrity":"sha512-Aq6+i2ricrTb9hd2KlNwwT2FDjZQny238OoXCg1ZVrYzvW8Tq8No0NsL6X9m15oFrsoUkjovyFCtrcymt9NukQ==","mode":420,"size":589},"CHANGELOG.md":{"checkedAt":1678883671737,"integrity":"sha512-xxCjQEjdnY11boBt6oHGR+AvTDFLnSzpFGqhlOmTG0a0KMIAo+ogIxpx0/hGtcvqbaqCRxBHCiPrziuDpuEIgA==","mode":420,"size":6597}}}

View File

@@ -0,0 +1,27 @@
'use strict';
var test = require('tape');
var inspect = require('object-inspect');
var forEach = require('for-each');
var v = require('es-value-fixtures');
var isSharedArrayBuffer = require('..');
test('isSharedArrayBuffer', function (t) {
t.equal(typeof isSharedArrayBuffer, 'function', 'is a function');
var nonSABs = v.primitives.concat(v.objects);
forEach(nonSABs, function (nonSAB) {
t.equal(isSharedArrayBuffer(nonSAB), false, inspect(nonSAB) + ' is not a SharedArrayBuffer');
});
t.test('actual SharedArrayBuffer instances', { skip: typeof SharedArrayBuffer === 'undefined' }, function (st) {
var sab = new SharedArrayBuffer();
st.equal(isSharedArrayBuffer(sab), true, inspect(sab) + ' is a SharedArrayBuffer');
st.end();
});
t.end();
});

View File

@@ -0,0 +1,71 @@
var basePropertyOf = require('./_basePropertyOf');
/** Used to map Latin Unicode letters to basic Latin letters. */
var deburredLetters = {
// Latin-1 Supplement block.
'\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A',
'\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a',
'\xc7': 'C', '\xe7': 'c',
'\xd0': 'D', '\xf0': 'd',
'\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E',
'\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e',
'\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I',
'\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i',
'\xd1': 'N', '\xf1': 'n',
'\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O',
'\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o',
'\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U',
'\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u',
'\xdd': 'Y', '\xfd': 'y', '\xff': 'y',
'\xc6': 'Ae', '\xe6': 'ae',
'\xde': 'Th', '\xfe': 'th',
'\xdf': 'ss',
// Latin Extended-A block.
'\u0100': 'A', '\u0102': 'A', '\u0104': 'A',
'\u0101': 'a', '\u0103': 'a', '\u0105': 'a',
'\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C',
'\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c',
'\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd',
'\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E',
'\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e',
'\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G',
'\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g',
'\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h',
'\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I',
'\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i',
'\u0134': 'J', '\u0135': 'j',
'\u0136': 'K', '\u0137': 'k', '\u0138': 'k',
'\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L',
'\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l',
'\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N',
'\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n',
'\u014c': 'O', '\u014e': 'O', '\u0150': 'O',
'\u014d': 'o', '\u014f': 'o', '\u0151': 'o',
'\u0154': 'R', '\u0156': 'R', '\u0158': 'R',
'\u0155': 'r', '\u0157': 'r', '\u0159': 'r',
'\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S',
'\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's',
'\u0162': 'T', '\u0164': 'T', '\u0166': 'T',
'\u0163': 't', '\u0165': 't', '\u0167': 't',
'\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U',
'\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u',
'\u0174': 'W', '\u0175': 'w',
'\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y',
'\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z',
'\u017a': 'z', '\u017c': 'z', '\u017e': 'z',
'\u0132': 'IJ', '\u0133': 'ij',
'\u0152': 'Oe', '\u0153': 'oe',
'\u0149': "'n", '\u017f': 's'
};
/**
* Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A
* letters to basic Latin letters.
*
* @private
* @param {string} letter The matched letter to deburr.
* @returns {string} Returns the deburred letter.
*/
var deburrLetter = basePropertyOf(deburredLetters);
module.exports = deburrLetter;

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,kEAAkE;AAClE,mEAAmE;AACnE,kEAAkE;AAClE,kEAAkE;AAClE,0BAA0B;AA+H1B,MAAM,OAAO,YAAa,SAAQ,KAAK;IACtC,YAAY,KAAY;QACvB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;CACD;AACD,MAAM,OAAO,UAAW,SAAQ,KAAK;IACpC,YAAY,KAAY;QACvB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACrB,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;CACD"}

View File

@@ -0,0 +1,2 @@
export { l as findPair, g as parseMap, h as parseSeq, k as stringifyNumber, c as stringifyString, t as toJSON } from './resolveSeq-492ab440.js';
export { T as Type, i as YAMLError, o as YAMLReferenceError, g as YAMLSemanticError, Y as YAMLSyntaxError, f as YAMLWarning } from './PlainValue-b8036b75.js';

View File

@@ -0,0 +1,311 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
declare type ConditionFunc<S> = (state: S) => boolean;
declare type IterateFunc<S> = (state: S) => S;
declare type ResultFunc<S, T> = (state: S) => T;
export interface GenerateBaseOptions<S> {
/**
* Initial state.
*/
initialState: S;
/**
* Condition function that accepts state and returns boolean.
* When it returns false, the generator stops.
* If not specified, a generator never stops.
*/
condition?: ConditionFunc<S>;
/**
* Iterate function that accepts state and returns new state.
*/
iterate: IterateFunc<S>;
/**
* SchedulerLike to use for generation process.
* By default, a generator starts immediately.
*/
scheduler?: SchedulerLike;
}
export interface GenerateOptions<T, S> extends GenerateBaseOptions<S> {
/**
* Result selection function that accepts state and returns a value to emit.
*/
resultSelector: ResultFunc<S, T>;
}
/**
* Generates an observable sequence by running a state-driven loop
* producing the sequence's elements, using the specified scheduler
* to send out observer messages.
*
* ![](generate.png)
*
* ## Examples
*
* Produces sequence of numbers
*
* ```ts
* import { generate } from 'rxjs';
*
* const result = generate(0, x => x < 3, x => x + 1, x => x);
*
* result.subscribe(x => console.log(x));
*
* // Logs:
* // 0
* // 1
* // 2
* ```
*
* Use `asapScheduler`
*
* ```ts
* import { generate, asapScheduler } from 'rxjs';
*
* const result = generate(1, x => x < 5, x => x * 2, x => x + 1, asapScheduler);
*
* result.subscribe(x => console.log(x));
*
* // Logs:
* // 2
* // 3
* // 5
* ```
*
* @see {@link from}
* @see {@link Observable}
*
* @param {S} initialState Initial state.
* @param {function (state: S): boolean} condition Condition to terminate generation (upon returning false).
* @param {function (state: S): S} iterate Iteration step function.
* @param {function (state: S): T} resultSelector Selector function for results produced in the sequence. (deprecated)
* @param {SchedulerLike} [scheduler] A {@link SchedulerLike} on which to run the generator loop. If not provided, defaults to emit immediately.
* @returns {Observable<T>} The generated sequence.
* @deprecated Instead of passing separate arguments, use the options argument. Signatures taking separate arguments will be removed in v8.
*/
export declare function generate<T, S>(initialState: S, condition: ConditionFunc<S>, iterate: IterateFunc<S>, resultSelector: ResultFunc<S, T>, scheduler?: SchedulerLike): Observable<T>;
/**
* Generates an Observable by running a state-driven loop
* that emits an element on each iteration.
*
* <span class="informal">Use it instead of nexting values in a for loop.</span>
*
* ![](generate.png)
*
* `generate` allows you to create a stream of values generated with a loop very similar to
* a traditional for loop. The first argument of `generate` is a beginning value. The second argument
* is a function that accepts this value and tests if some condition still holds. If it does,
* then the loop continues, if not, it stops. The third value is a function which takes the
* previously defined value and modifies it in some way on each iteration. Note how these three parameters
* are direct equivalents of three expressions in a traditional for loop: the first expression
* initializes some state (for example, a numeric index), the second tests if the loop can perform the next
* iteration (for example, if the index is lower than 10) and the third states how the defined value
* will be modified on every step (for example, the index will be incremented by one).
*
* Return value of a `generate` operator is an Observable that on each loop iteration
* emits a value. First of all, the condition function is ran. If it returns true, then the Observable
* emits the currently stored value (initial value at the first iteration) and finally updates
* that value with iterate function. If at some point the condition returns false, then the Observable
* completes at that moment.
*
* Optionally you can pass a fourth parameter to `generate` - a result selector function which allows you
* to immediately map the value that would normally be emitted by an Observable.
*
* If you find three anonymous functions in `generate` call hard to read, you can provide
* a single object to the operator instead where the object has the properties: `initialState`,
* `condition`, `iterate` and `resultSelector`, which should have respective values that you
* would normally pass to `generate`. `resultSelector` is still optional, but that form
* of calling `generate` allows you to omit `condition` as well. If you omit it, that means
* condition always holds, or in other words the resulting Observable will never complete.
*
* Both forms of `generate` can optionally accept a scheduler. In case of a multi-parameter call,
* scheduler simply comes as a last argument (no matter if there is a `resultSelector`
* function or not). In case of a single-parameter call, you can provide it as a
* `scheduler` property on the object passed to the operator. In both cases, a scheduler decides when
* the next iteration of the loop will happen and therefore when the next value will be emitted
* by the Observable. For example, to ensure that each value is pushed to the Observer
* on a separate task in the event loop, you could use the `async` scheduler. Note that
* by default (when no scheduler is passed) values are simply emitted synchronously.
*
*
* ## Examples
*
* Use with condition and iterate functions
*
* ```ts
* import { generate } from 'rxjs';
*
* const result = generate(0, x => x < 3, x => x + 1);
*
* result.subscribe({
* next: value => console.log(value),
* complete: () => console.log('Complete!')
* });
*
* // Logs:
* // 0
* // 1
* // 2
* // 'Complete!'
* ```
*
* Use with condition, iterate and resultSelector functions
*
* ```ts
* import { generate } from 'rxjs';
*
* const result = generate(0, x => x < 3, x => x + 1, x => x * 1000);
*
* result.subscribe({
* next: value => console.log(value),
* complete: () => console.log('Complete!')
* });
*
* // Logs:
* // 0
* // 1000
* // 2000
* // 'Complete!'
* ```
*
* Use with options object
*
* ```ts
* import { generate } from 'rxjs';
*
* const result = generate({
* initialState: 0,
* condition(value) { return value < 3; },
* iterate(value) { return value + 1; },
* resultSelector(value) { return value * 1000; }
* });
*
* result.subscribe({
* next: value => console.log(value),
* complete: () => console.log('Complete!')
* });
*
* // Logs:
* // 0
* // 1000
* // 2000
* // 'Complete!'
* ```
*
* Use options object without condition function
*
* ```ts
* import { generate } from 'rxjs';
*
* const result = generate({
* initialState: 0,
* iterate(value) { return value + 1; },
* resultSelector(value) { return value * 1000; }
* });
*
* result.subscribe({
* next: value => console.log(value),
* complete: () => console.log('Complete!') // This will never run
* });
*
* // Logs:
* // 0
* // 1000
* // 2000
* // 3000
* // ...and never stops.
* ```
*
* @see {@link from}
*
* @param {S} initialState Initial state.
* @param {function (state: S): boolean} condition Condition to terminate generation (upon returning false).
* @param {function (state: S): S} iterate Iteration step function.
* @param {function (state: S): T} [resultSelector] Selector function for results produced in the sequence.
* @param {Scheduler} [scheduler] A {@link Scheduler} on which to run the generator loop. If not provided, defaults to emitting immediately.
* @return {Observable<T>} The generated sequence.
* @deprecated Instead of passing separate arguments, use the options argument. Signatures taking separate arguments will be removed in v8.
*/
export declare function generate<S>(initialState: S, condition: ConditionFunc<S>, iterate: IterateFunc<S>, scheduler?: SchedulerLike): Observable<S>;
/**
* Generates an observable sequence by running a state-driven loop
* producing the sequence's elements, using the specified scheduler
* to send out observer messages.
* The overload accepts options object that might contain initial state, iterate,
* condition and scheduler.
*
* ![](generate.png)
*
* ## Examples
*
* Use options object with condition function
*
* ```ts
* import { generate } from 'rxjs';
*
* const result = generate({
* initialState: 0,
* condition: x => x < 3,
* iterate: x => x + 1
* });
*
* result.subscribe({
* next: value => console.log(value),
* complete: () => console.log('Complete!')
* });
*
* // Logs:
* // 0
* // 1
* // 2
* // 'Complete!'
* ```
*
* @see {@link from}
* @see {@link Observable}
*
* @param {GenerateBaseOptions<S>} options Object that must contain initialState, iterate and might contain condition and scheduler.
* @returns {Observable<S>} The generated sequence.
*/
export declare function generate<S>(options: GenerateBaseOptions<S>): Observable<S>;
/**
* Generates an observable sequence by running a state-driven loop
* producing the sequence's elements, using the specified scheduler
* to send out observer messages.
* The overload accepts options object that might contain initial state, iterate,
* condition, result selector and scheduler.
*
* ![](generate.png)
*
* ## Examples
*
* Use options object with condition and iterate function
*
* ```ts
* import { generate } from 'rxjs';
*
* const result = generate({
* initialState: 0,
* condition: x => x < 3,
* iterate: x => x + 1,
* resultSelector: x => x
* });
*
* result.subscribe({
* next: value => console.log(value),
* complete: () => console.log('Complete!')
* });
*
* // Logs:
* // 0
* // 1
* // 2
* // 'Complete!'
* ```
*
* @see {@link from}
* @see {@link Observable}
*
* @param {GenerateOptions<T, S>} options Object that must contain initialState, iterate, resultSelector and might contain condition and scheduler.
* @returns {Observable<T>} The generated sequence.
*/
export declare function generate<T, S>(options: GenerateOptions<T, S>): Observable<T>;
export {};
//# sourceMappingURL=generate.d.ts.map

View File

@@ -0,0 +1,62 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $SyntaxError = GetIntrinsic('%SyntaxError%');
var $TypeError = GetIntrinsic('%TypeError%');
var $Promise = GetIntrinsic('%Promise%', true);
var Call = require('./Call');
var CompletionRecord = require('./CompletionRecord');
var GetMethod = require('./GetMethod');
var Type = require('./Type');
var assertRecord = require('../helpers/assertRecord');
var callBound = require('call-bind/callBound');
var $then = callBound('Promise.prototype.then', true);
// https://262.ecma-international.org/9.0/#sec-asynciteratorclose
module.exports = function AsyncIteratorClose(iteratorRecord, completion) {
assertRecord(Type, 'Iterator Record', 'iteratorRecord', iteratorRecord); // step 1
if (!(completion instanceof CompletionRecord)) {
throw new $TypeError('Assertion failed: completion is not a Completion Record instance'); // step 2
}
if (!$then) {
throw new $SyntaxError('This environment does not support Promises.');
}
var iterator = iteratorRecord['[[Iterator]]']; // step 3
return new $Promise(function (resolve) {
var ret = GetMethod(iterator, 'return'); // step 4
if (typeof ret === 'undefined') {
resolve(completion); // step 5
} else {
resolve($then(
new $Promise(function (resolve2) {
// process.exit(42);
resolve2(Call(ret, iterator, [])); // step 6
}),
function (innerResult) {
if (Type(innerResult) !== 'Object') {
throw new $TypeError('`innerResult` must be an Object'); // step 10
}
return completion;
},
function (e) {
if (completion.type() === 'throw') {
completion['?'](); // step 8
} else {
throw e; // step 9
}
}
));
}
});
};

View File

@@ -0,0 +1,2 @@
if(typeof cptable === 'undefined') cptable = {};
cptable[10004] = (function(){ var d = "ےے\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 }; })();

View File

@@ -0,0 +1,16 @@
import { map } from './map';
import { innerFrom } from '../observable/innerFrom';
import { operate } from '../util/lift';
import { mergeInternals } from './mergeInternals';
import { isFunction } from '../util/isFunction';
export function mergeMap(project, resultSelector, concurrent) {
if (concurrent === void 0) { concurrent = Infinity; }
if (isFunction(resultSelector)) {
return mergeMap(function (a, i) { return map(function (b, ii) { return resultSelector(a, b, i, ii); })(innerFrom(project(a, i))); }, concurrent);
}
else if (typeof resultSelector === 'number') {
concurrent = resultSelector;
}
return operate(function (source, subscriber) { return mergeInternals(source, subscriber, project, concurrent); });
}
//# sourceMappingURL=mergeMap.js.map

View File

@@ -0,0 +1,115 @@
/*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
/* vim: set ts=2: */
/*exported CRC32C */
var CRC32C;
(function (factory) {
/*jshint ignore:start */
/*eslint-disable */
if(typeof DO_NOT_EXPORT_CRC === 'undefined') {
if('object' === typeof exports) {
factory(exports);
} else if ('function' === typeof define && define.amd) {
define(function () {
var module = {};
factory(module);
return module;
});
} else {
factory(CRC32C = {});
}
} else {
factory(CRC32C = {});
}
/*eslint-enable */
/*jshint ignore:end */
}(function(CRC32C) {
CRC32C.version = '1.2.2';
/*global Int32Array */
function signed_crc_table() {
var c = 0, table = new Array(256);
for(var n =0; n != 256; ++n){
c = n;
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
c = ((c&1) ? (-2097792136 ^ (c >>> 1)) : (c >>> 1));
table[n] = c;
}
return typeof Int32Array !== 'undefined' ? new Int32Array(table) : table;
}
var T0 = signed_crc_table();
function slice_by_16_tables(T) {
var c = 0, v = 0, n = 0, table = typeof Int32Array !== 'undefined' ? new Int32Array(4096) : new Array(4096) ;
for(n = 0; n != 256; ++n) table[n] = T[n];
for(n = 0; n != 256; ++n) {
v = T[n];
for(c = 256 + n; c < 4096; c += 256) v = table[c] = (v >>> 8) ^ T[v & 0xFF];
}
var out = [];
for(n = 1; n != 16; ++n) out[n - 1] = typeof Int32Array !== 'undefined' ? table.subarray(n * 256, n * 256 + 256) : table.slice(n * 256, n * 256 + 256);
return out;
}
var TT = slice_by_16_tables(T0);
var T1 = TT[0], T2 = TT[1], T3 = TT[2], T4 = TT[3], T5 = TT[4];
var T6 = TT[5], T7 = TT[6], T8 = TT[7], T9 = TT[8], Ta = TT[9];
var Tb = TT[10], Tc = TT[11], Td = TT[12], Te = TT[13], Tf = TT[14];
function crc32_bstr(bstr, seed) {
var C = seed ^ -1;
for(var i = 0, L = bstr.length; i < L;) C = (C>>>8) ^ T0[(C^bstr.charCodeAt(i++))&0xFF];
return ~C;
}
function crc32_buf(B, seed) {
var C = seed ^ -1, L = B.length - 15, i = 0;
for(; i < L;) C =
Tf[B[i++] ^ (C & 255)] ^
Te[B[i++] ^ ((C >> 8) & 255)] ^
Td[B[i++] ^ ((C >> 16) & 255)] ^
Tc[B[i++] ^ (C >>> 24)] ^
Tb[B[i++]] ^ Ta[B[i++]] ^ T9[B[i++]] ^ T8[B[i++]] ^
T7[B[i++]] ^ T6[B[i++]] ^ T5[B[i++]] ^ T4[B[i++]] ^
T3[B[i++]] ^ T2[B[i++]] ^ T1[B[i++]] ^ T0[B[i++]];
L += 15;
while(i < L) C = (C>>>8) ^ T0[(C^B[i++])&0xFF];
return ~C;
}
function crc32_str(str, seed) {
var C = seed ^ -1;
for(var i = 0, L = str.length, c = 0, d = 0; i < L;) {
c = str.charCodeAt(i++);
if(c < 0x80) {
C = (C>>>8) ^ T0[(C^c)&0xFF];
} else if(c < 0x800) {
C = (C>>>8) ^ T0[(C ^ (192|((c>>6)&31)))&0xFF];
C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];
} else if(c >= 0xD800 && c < 0xE000) {
c = (c&1023)+64; d = str.charCodeAt(i++)&1023;
C = (C>>>8) ^ T0[(C ^ (240|((c>>8)&7)))&0xFF];
C = (C>>>8) ^ T0[(C ^ (128|((c>>2)&63)))&0xFF];
C = (C>>>8) ^ T0[(C ^ (128|((d>>6)&15)|((c&3)<<4)))&0xFF];
C = (C>>>8) ^ T0[(C ^ (128|(d&63)))&0xFF];
} else {
C = (C>>>8) ^ T0[(C ^ (224|((c>>12)&15)))&0xFF];
C = (C>>>8) ^ T0[(C ^ (128|((c>>6)&63)))&0xFF];
C = (C>>>8) ^ T0[(C ^ (128|(c&63)))&0xFF];
}
}
return ~C;
}
CRC32C.table = T0;
// $FlowIgnore
CRC32C.bstr = crc32_bstr;
// $FlowIgnore
CRC32C.buf = crc32_buf;
// $FlowIgnore
CRC32C.str = crc32_str;
}));

View File

@@ -0,0 +1,8 @@
'use strict';
var Type = require('../type');
module.exports = new Type('tag:yaml.org,2002:str', {
kind: 'scalar',
construct: function (data) { return data !== null ? data : ''; }
});

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"CC","8":"J D E F A B"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","8":"C K L G M N O"},C:{"1":"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 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","8":"DC tB EC FC"},D:{"1":"0 1 2 3 4 5 6 7 8 9 v J D E F A B C K L G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H xB yB GC","4":"I"},E:{"1":"J D E F A B C K L G JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC","8":"HC zB","132":"I v IC"},F:{"1":"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":"E 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","132":"zB UC BC VC"},H:{"2":"oC"},I:{"1":"tB I f sC BC tC uC","2":"pC qC rC"},J:{"1":"D A"},K:{"1":"A B C h qB AC rB"},L:{"1":"H"},M:{"1":"H"},N:{"8":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"1":"AD BD"}},B:2,C:"SVG SMIL animation"};

View File

@@ -0,0 +1,10 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmptyError = void 0;
var createErrorClass_1 = require("./createErrorClass");
exports.EmptyError = createErrorClass_1.createErrorClass(function (_super) { return function EmptyErrorImpl() {
_super(this);
this.name = 'EmptyError';
this.message = 'no elements in sequence';
}; });
//# sourceMappingURL=EmptyError.js.map

View File

@@ -0,0 +1,39 @@
'use strict';
var functionsHaveConfigurableNames = require('functions-have-names').functionsHaveConfigurableNames();
var $Object = Object;
var $TypeError = TypeError;
module.exports = function flags() {
if (this != null && this !== $Object(this)) {
throw new $TypeError('RegExp.prototype.flags getter called on non-object');
}
var result = '';
if (this.hasIndices) {
result += 'd';
}
if (this.global) {
result += 'g';
}
if (this.ignoreCase) {
result += 'i';
}
if (this.multiline) {
result += 'm';
}
if (this.dotAll) {
result += 's';
}
if (this.unicode) {
result += 'u';
}
if (this.sticky) {
result += 'y';
}
return result;
};
if (functionsHaveConfigurableNames && Object.defineProperty) {
Object.defineProperty(module.exports, 'name', { value: 'get flags' });
}

View File

@@ -0,0 +1,36 @@
import type {CamelCase, CamelCaseOptions} from './camel-case';
/**
Convert object properties to camel case but not recursively.
This can be useful when, for example, converting some API types from a different style.
@see CamelCasedPropertiesDeep
@see CamelCase
@example
```
import type {CamelCasedProperties} from 'type-fest';
interface User {
UserId: number;
UserName: string;
}
const result: CamelCasedProperties<User> = {
userId: 1,
userName: 'Tom',
};
```
@category Change case
@category Template literal
@category Object
*/
export type CamelCasedProperties<Value, Options extends CamelCaseOptions = {preserveConsecutiveUppercase: true}> = Value extends Function
? Value
: Value extends Array<infer U>
? Value
: {
[K in keyof Value as CamelCase<K, Options>]: Value[K];
};

View File

@@ -0,0 +1,64 @@
# lie
<a href="http://promises-aplus.github.com/promises-spec">
<img src="http://promises-aplus.github.com/promises-spec/assets/logo-small.png"
alt="Promises/A+ logo" title="Promises/A+ 1.1 compliant" align="right" />
</a> [![Build Status](https://travis-ci.org/calvinmetcalf/lie.svg)](https://travis-ci.org/calvinmetcalf/lie)
lie a small, performant, promise library implementing the [Promises/A+ spec Version 1.1](http://promises-aplus.github.com/promises-spec/).
A originally a fork of [Ruben Verborgh's](https://github.com/RubenVerborgh) library called [promiscuous](https://github.com/RubenVerborgh/promiscuous), version 2.6 and above are forked from [ayepromise](https://github.com/cburgmer/ayepromise) by [Chris Burgmer](https://github.com/cburgmer).
```bash
npm install lie
```
```javascript
var Promise = require('lie');
// or use the pollyfill
require('lie/polyfill');
```
## Usage
Either use it with [browserify](http://browserify.org/) (recommended) or grab one of the files from the dist folder
- lie.js/lie.min.js makes 'Promise' available in global scope (or since it's a UMD `Promise` will be available through a CJS or AMD loader if it's available instead)
- lie.polyfill.js/lie.polyfill.min.js adds 'Promise' to the global scope only if it's not already defined (not a UMD).
## API
Implements the standard ES6 api,
```js
new Promise(function(resolve, reject){
doSomething(function(err, result) {
if (err) {
reject(err);
} else {
resolve(result);
}
});
}).then(function (value) {
//on success
}, function (reason) {
//on error
}).catch(function (reason) {
//shortcut for error handling
});
Promise.all([
//array of promises or values
]).then(function ([/* array of results */]));
Promise.race([
//array of promises or values
]);
// either resolves or rejects depending on the first value to do so
```
## Unhandled Rejections
In node lie emits `unhandledRejection` events when promises are not handled in
line with how [iojs does so](https://iojs.org/api/process.html#process_event_unhandledrejection)
meaning it can act as promise shim in node as well as the browser.

View File

@@ -0,0 +1,61 @@
{
"name": "@sveltejs/vite-plugin-svelte",
"version": "1.0.0-next.6",
"license": "MIT",
"author": "dominikg",
"files": [
"dist"
],
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"dev": "tsc -p . -w --incremental",
"build": "rimraf dist && run-s build-bundle build-types",
"build-bundle": "node scripts/build-bundle.js",
"build-types": "tsc -p . --emitDeclarationOnly --outDir temp && api-extractor run && rimraf temp"
},
"engines": {
"node": ">=12.0.0"
},
"repository": {
"type": "git",
"url": "git+https://github.com/sveltejs/vite-plugin-svelte.git"
},
"keywords": [
"vite-plugin",
"vite plugin",
"vite",
"svelte"
],
"bugs": {
"url": "https://github.com/sveltejs/vite-plugin-svelte/issues"
},
"homepage": "https://github.com/sveltejs/vite-plugin-svelte/tree/main/packages/vite-plugin-svelte#readme",
"dependencies": {
"@rollup/pluginutils": "^4.1.0",
"chalk": "^4.1.0",
"debug": "^4.3.2",
"hash-sum": "^2.0.0",
"require-relative": "^0.8.7",
"slash": "^3.0.0",
"source-map": "^0.7.3",
"svelte-hmr": "^0.14.0"
},
"peerDependencies": {
"svelte": "^3.37.0",
"vite": "^2.1.5"
},
"devDependencies": {
"@types/debug": "^4.1.5",
"@types/es-module-lexer": "^0.3.0",
"@types/estree": "^0.0.47",
"@types/hash-sum": "^1.0.0",
"@windicss/plugin-utils": "^0.12.2",
"esbuild": "~0.9.7",
"locate-character": "^2.0.5",
"magic-string": "^0.25.7",
"rollup": "^2.44.0",
"svelte": "^3.37.0",
"vite": "^2.1.5"
}
}

View File

@@ -0,0 +1,15 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [ "es5" ],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": ".",
"paths": { "adler-32": ["."] },
"types": [],
"noEmit": true,
"strictFunctionTypes": true,
"forceConsistentCasingInFileNames": true
}
}

View File

@@ -0,0 +1,3 @@
const SemVer = require('../classes/semver')
const minor = (a, loose) => new SemVer(a, loose).minor
module.exports = minor

View File

@@ -0,0 +1,54 @@
var test = require('tape');
var resolve = require('../');
var path = require('path');
test('shadowed core modules still return core module', function (t) {
t.plan(2);
resolve('util', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) {
t.ifError(err);
t.equal(res, 'util');
});
});
test('shadowed core modules still return core module [sync]', function (t) {
t.plan(1);
var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core') });
t.equal(res, 'util');
});
test('shadowed core modules return shadow when appending `/`', function (t) {
t.plan(2);
resolve('util/', { basedir: path.join(__dirname, 'shadowed_core') }, function (err, res) {
t.ifError(err);
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
});
});
test('shadowed core modules return shadow when appending `/` [sync]', function (t) {
t.plan(1);
var res = resolve.sync('util/', { basedir: path.join(__dirname, 'shadowed_core') });
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
});
test('shadowed core modules return shadow with `includeCoreModules: false`', function (t) {
t.plan(2);
resolve('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false }, function (err, res) {
t.ifError(err);
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
});
});
test('shadowed core modules return shadow with `includeCoreModules: false` [sync]', function (t) {
t.plan(1);
var res = resolve.sync('util', { basedir: path.join(__dirname, 'shadowed_core'), includeCoreModules: false });
t.equal(res, path.join(__dirname, 'shadowed_core/node_modules/util/index.js'));
});

View File

@@ -0,0 +1 @@
{"name":"lru-cache","version":"5.1.1","files":{"index.js":{"checkedAt":1678883670201,"integrity":"sha512-9xK3IVCUhbh6gQgCpI7vHE69BidtDijNTwBnHnbjwPn6G7+HLaLJP7WzvPgUYmTAy8jQmv2OO5qkqS+QHfEeeg==","mode":420,"size":8186},"LICENSE":{"checkedAt":1678883670198,"integrity":"sha512-P6dI5Z+zrwxSk1MIRPqpYG2ScYNkidLIATQXd50QzBgBh/XmcEd/nsd9NB4O9k6rfc+4dsY5DwJ7xvhpoS0PRg==","mode":420,"size":765},"README.md":{"checkedAt":1678883670201,"integrity":"sha512-IM3wLlYJEzSNb50qW2EswRH6qpzUSjn5Mzh52nfqHHbFGRaFVge5c7q7Eb6vtUmbuLM7VVPGdPQJsClsQx6nOA==","mode":420,"size":5987},"package.json":{"checkedAt":1678883671995,"integrity":"sha512-AWGEHoRNt0yEBc8gjP6U2muF981GUesY7gCv5D6+iMba4pUBKG8h5Tn0wXMQ1dO1Dauq/oDSgKZfJVEF7M0Buw==","mode":420,"size":776}}}

View File

@@ -0,0 +1 @@
{"version":3,"file":"timestamp.js","sourceRoot":"","sources":["../../../../src/internal/operators/timestamp.ts"],"names":[],"mappings":";;;AACA,4EAA2E;AAC3E,6BAA4B;AAkC5B,SAAgB,SAAS,CAAI,iBAA4D;IAA5D,kCAAA,EAAA,oBAAuC,6CAAqB;IACvF,OAAO,SAAG,CAAC,UAAC,KAAQ,IAAK,OAAA,CAAC,EAAE,KAAK,OAAA,EAAE,SAAS,EAAE,iBAAiB,CAAC,GAAG,EAAE,EAAE,CAAC,EAA/C,CAA+C,CAAC,CAAC;AAC5E,CAAC;AAFD,8BAEC"}

View File

@@ -0,0 +1,119 @@
import { SchedulerLike } from '../types';
import { isScheduler } from '../util/isScheduler';
import { Observable } from '../Observable';
import { subscribeOn } from '../operators/subscribeOn';
import { mapOneOrManyArgs } from '../util/mapOneOrManyArgs';
import { observeOn } from '../operators/observeOn';
import { AsyncSubject } from '../AsyncSubject';
export function bindCallbackInternals(
isNodeStyle: boolean,
callbackFunc: any,
resultSelector?: any,
scheduler?: SchedulerLike
): (...args: any[]) => Observable<unknown> {
if (resultSelector) {
if (isScheduler(resultSelector)) {
scheduler = resultSelector;
} else {
// The user provided a result selector.
return function (this: any, ...args: any[]) {
return (bindCallbackInternals(isNodeStyle, callbackFunc, scheduler) as any)
.apply(this, args)
.pipe(mapOneOrManyArgs(resultSelector as any));
};
}
}
// If a scheduler was passed, use our `subscribeOn` and `observeOn` operators
// to compose that behavior for the user.
if (scheduler) {
return function (this: any, ...args: any[]) {
return (bindCallbackInternals(isNodeStyle, callbackFunc) as any)
.apply(this, args)
.pipe(subscribeOn(scheduler!), observeOn(scheduler!));
};
}
return function (this: any, ...args: any[]): Observable<any> {
// We're using AsyncSubject, because it emits when it completes,
// and it will play the value to all late-arriving subscribers.
const subject = new AsyncSubject<any>();
// If this is true, then we haven't called our function yet.
let uninitialized = true;
return new Observable((subscriber) => {
// Add our subscriber to the subject.
const subs = subject.subscribe(subscriber);
if (uninitialized) {
uninitialized = false;
// We're going to execute the bound function
// This bit is to signal that we are hitting the callback asynchronously.
// Because we don't have any anti-"Zalgo" guarantees with whatever
// function we are handed, we use this bit to figure out whether or not
// we are getting hit in a callback synchronously during our call.
let isAsync = false;
// This is used to signal that the callback completed synchronously.
let isComplete = false;
// Call our function that has a callback. If at any time during this
// call, an error is thrown, it will be caught by the Observable
// subscription process and sent to the consumer.
callbackFunc.apply(
// Pass the appropriate `this` context.
this,
[
// Pass the arguments.
...args,
// And our callback handler.
(...results: any[]) => {
if (isNodeStyle) {
// If this is a node callback, shift the first value off of the
// results and check it, as it is the error argument. By shifting,
// we leave only the argument(s) we want to pass to the consumer.
const err = results.shift();
if (err != null) {
subject.error(err);
// If we've errored, we can stop processing this function
// as there's nothing else to do. Just return to escape.
return;
}
}
// If we have one argument, notify the consumer
// of it as a single value, otherwise, if there's more than one, pass
// them as an array. Note that if there are no arguments, `undefined`
// will be emitted.
subject.next(1 < results.length ? results : results[0]);
// Flip this flag, so we know we can complete it in the synchronous
// case below.
isComplete = true;
// If we're not asynchronous, we need to defer the `complete` call
// until after the call to the function is over. This is because an
// error could be thrown in the function after it calls our callback,
// and if that is the case, if we complete here, we are unable to notify
// the consumer than an error occurred.
if (isAsync) {
subject.complete();
}
},
]
);
// If we flipped `isComplete` during the call, we resolved synchronously,
// notify complete, because we skipped it in the callback to wait
// to make sure there were no errors during the call.
if (isComplete) {
subject.complete();
}
// We're no longer synchronous. If the callback is called at this point
// we can notify complete on the spot.
isAsync = true;
}
// Return the subscription from adding our subscriber to the subject.
return subs;
});
};
}

View File

@@ -0,0 +1,102 @@
<!doctype html>
<html lang="en">
<head>
<title>Code coverage report for csv2json/testNew/testCSVConverter3.ts</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> / <a href="index.html">csv2json/testNew</a> testCSVConverter3.ts
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>4/4</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">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>4/4</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 high'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
<a name='L2'></a><a href='#L2'>2</a>
<a name='L3'></a><a href='#L3'>3</a>
<a name='L4'></a><a href='#L4'>4</a>
<a name='L5'></a><a href='#L5'>5</a>
<a name='L6'></a><a href='#L6'>6</a>
<a name='L7'></a><a href='#L7'>7</a>
<a name='L8'></a><a href='#L8'>8</a>
<a name='L9'></a><a href='#L9'>9</a>
<a name='L10'></a><a href='#L10'>10</a>
<a name='L11'></a><a href='#L11'>11</a>
<a name='L12'></a><a href='#L12'>12</a></td><td class="line-coverage quiet"><span class="cline-any cline-no">0</span>
<span class="cline-any cline-no">0</span>
<span class="cline-any cline-no">0</span>
<span class="cline-any cline-no">0</span>
<span class="cline-any cline-no">0</span>
<span class="cline-any cline-no">0</span>
<span class="cline-any cline-no">0</span>
<span class="cline-any cline-no">0</span>
<span class="cline-any cline-no">0</span>
<span class="cline-any cline-no">0</span>
<span class="cline-any cline-no">0</span>
<span class="cline-any cline-no">0</span></td><td class="text"><pre class="prettyprint lang-js">Unable to lookup source: /Users/kxiang/work/projects/csv2json/testNew/testCSVConverter3.ts(ENOENT: no such file or directory, open '/Users/kxiang/work/projects/csv2json/testNew/testCSVConverter3.ts')
Error: Unable to lookup source: /Users/kxiang/work/projects/csv2json/testNew/testCSVConverter3.ts(ENOENT: no such file or directory, open '/Users/kxiang/work/projects/csv2json/testNew/testCSVConverter3.ts')
at Context.defaultSourceLookup [as sourceFinder] (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/context.js:15:15)
at Context.getSource (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/context.js:74:17)
at Object.annotateSourceCode (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-reports/lib/html/annotator.js:172:38)
at HtmlReport.onDetail (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-reports/lib/html/index.js:237:39)
at LcovReport.(anonymous function) [as onDetail] (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-reports/lib/lcov/index.js:24:24)
at Visitor.(anonymous function) [as onDetail] (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:34:30)
at ReportNode.Node.visit (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:123:17)
at /Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:116:23
at Array.forEach (native)
at visitChildren (/Users/kxiang/work/projects/csv2json/node_modules/nyc/node_modules/istanbul-lib-report/lib/tree.js:115:32)</pre></td></tr>
</table></pre>
<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:20:20 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>

View File

@@ -0,0 +1,3 @@
import { InteropObservable, SchedulerLike } from '../types';
export declare function scheduleObservable<T>(input: InteropObservable<T>, scheduler: SchedulerLike): import("../Observable").Observable<T>;
//# sourceMappingURL=scheduleObservable.d.ts.map

View File

@@ -0,0 +1,59 @@
"use strict";
var eq = require("./eq")
, isPlainObject = require("./is-plain-object")
, value = require("./valid-value");
var isArray = Array.isArray
, keys = Object.keys
, objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable
, objHasOwnProperty = Object.prototype.hasOwnProperty
, eqArr
, eqVal
, eqObj;
eqArr = function (arr1, arr2, recMap) {
var i, length = arr1.length;
if (length !== arr2.length) return false;
for (i = 0; i < length; ++i) {
if (objHasOwnProperty.call(arr1, i) !== objHasOwnProperty.call(arr2, i)) return false;
if (!eqVal(arr1[i], arr2[i], recMap)) return false;
}
return true;
};
eqObj = function (obj1, obj2, recMap) {
var k1 = keys(obj1), k2 = keys(obj2);
if (k1.length !== k2.length) return false;
return k1.every(function (key) {
if (!objPropertyIsEnumerable.call(obj2, key)) return false;
return eqVal(obj1[key], obj2[key], recMap);
});
};
eqVal = function (val1, val2, recMap) {
var i, eqX, c1, c2;
if (eq(val1, val2)) return true;
if (isPlainObject(val1)) {
if (!isPlainObject(val2)) return false;
eqX = eqObj;
} else if (isArray(val1) && isArray(val2)) {
eqX = eqArr;
} else {
return false;
}
c1 = recMap[0];
c2 = recMap[1];
i = c1.indexOf(val1);
if (i === -1) {
i = c1.push(val1) - 1;
c2[i] = [];
} else if (c2[i].indexOf(val2) !== -1) return true;
c2[i].push(val2);
return eqX(val1, val2, recMap);
};
module.exports = function (val1, val2) {
if (eq(value(val1), value(val2))) return true;
return eqVal(Object(val1), Object(val2), [[], []]);
};

View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
require("./cli/index");

View File

@@ -0,0 +1,26 @@
export function getXHRResponse(xhr) {
switch (xhr.responseType) {
case 'json': {
if ('response' in xhr) {
return xhr.response;
}
else {
const ieXHR = xhr;
return JSON.parse(ieXHR.responseText);
}
}
case 'document':
return xhr.responseXML;
case 'text':
default: {
if ('response' in xhr) {
return xhr.response;
}
else {
const ieXHR = xhr;
return ieXHR.responseText;
}
}
}
}
//# sourceMappingURL=getXHRResponse.js.map

View File

@@ -0,0 +1,14 @@
var baseRest = require('./_baseRest');
/**
* A `baseRest` alias which can be replaced with `identity` by module
* replacement plugins.
*
* @private
* @type {Function}
* @param {Function} func The function to apply a rest parameter to.
* @returns {Function} Returns the new function.
*/
var castRest = baseRest;
module.exports = castRest;

View File

@@ -0,0 +1,53 @@
import { BLAKE2, BlakeOpts } from './_blake2.js';
declare class BLAKE2b extends BLAKE2<BLAKE2b> {
private v0l;
private v0h;
private v1l;
private v1h;
private v2l;
private v2h;
private v3l;
private v3h;
private v4l;
private v4h;
private v5l;
private v5h;
private v6l;
private v6h;
private v7l;
private v7h;
constructor(opts?: BlakeOpts);
protected get(): [
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number,
number
];
protected set(v0l: number, v0h: number, v1l: number, v1h: number, v2l: number, v2h: number, v3l: number, v3h: number, v4l: number, v4h: number, v5l: number, v5h: number, v6l: number, v6h: number, v7l: number, v7h: number): void;
protected compress(msg: Uint32Array, offset: number, isLast: boolean): void;
destroy(): void;
}
/**
* BLAKE2b - optimized for 64-bit platforms. JS doesn't have uint64, so it's slower than BLAKE2s.
* @param msg - message that would be hashed
* @param opts - dkLen, key, salt, personalization
*/
export declare const blake2b: {
(msg: import("./utils.js").Input, opts?: BlakeOpts | undefined): Uint8Array;
outputLen: number;
blockLen: number;
create(opts: BlakeOpts): import("./utils.js").Hash<BLAKE2b>;
};
export {};

View File

@@ -0,0 +1,453 @@
'use strict';
var crypto = require('crypto');
/**
* Exported function
*
* Options:
*
* - `algorithm` hash algo to be used by this instance: *'sha1', 'md5'
* - `excludeValues` {true|*false} hash object keys, values ignored
* - `encoding` hash encoding, supports 'buffer', '*hex', 'binary', 'base64'
* - `ignoreUnknown` {true|*false} ignore unknown object types
* - `replacer` optional function that replaces values before hashing
* - `respectFunctionProperties` {*true|false} consider function properties when hashing
* - `respectFunctionNames` {*true|false} consider 'name' property of functions for hashing
* - `respectType` {*true|false} Respect special properties (prototype, constructor)
* when hashing to distinguish between types
* - `unorderedArrays` {true|*false} Sort all arrays before hashing
* - `unorderedSets` {*true|false} Sort `Set` and `Map` instances before hashing
* * = default
*
* @param {object} object value to hash
* @param {object} options hashing options
* @return {string} hash value
* @api public
*/
exports = module.exports = objectHash;
function objectHash(object, options){
options = applyDefaults(object, options);
return hash(object, options);
}
/**
* Exported sugar methods
*
* @param {object} object value to hash
* @return {string} hash value
* @api public
*/
exports.sha1 = function(object){
return objectHash(object);
};
exports.keys = function(object){
return objectHash(object, {excludeValues: true, algorithm: 'sha1', encoding: 'hex'});
};
exports.MD5 = function(object){
return objectHash(object, {algorithm: 'md5', encoding: 'hex'});
};
exports.keysMD5 = function(object){
return objectHash(object, {algorithm: 'md5', encoding: 'hex', excludeValues: true});
};
// Internals
var hashes = crypto.getHashes ? crypto.getHashes().slice() : ['sha1', 'md5'];
hashes.push('passthrough');
var encodings = ['buffer', 'hex', 'binary', 'base64'];
function applyDefaults(object, sourceOptions){
sourceOptions = sourceOptions || {};
// create a copy rather than mutating
var options = {};
options.algorithm = sourceOptions.algorithm || 'sha1';
options.encoding = sourceOptions.encoding || 'hex';
options.excludeValues = sourceOptions.excludeValues ? true : false;
options.algorithm = options.algorithm.toLowerCase();
options.encoding = options.encoding.toLowerCase();
options.ignoreUnknown = sourceOptions.ignoreUnknown !== true ? false : true; // default to false
options.respectType = sourceOptions.respectType === false ? false : true; // default to true
options.respectFunctionNames = sourceOptions.respectFunctionNames === false ? false : true;
options.respectFunctionProperties = sourceOptions.respectFunctionProperties === false ? false : true;
options.unorderedArrays = sourceOptions.unorderedArrays !== true ? false : true; // default to false
options.unorderedSets = sourceOptions.unorderedSets === false ? false : true; // default to false
options.unorderedObjects = sourceOptions.unorderedObjects === false ? false : true; // default to true
options.replacer = sourceOptions.replacer || undefined;
options.excludeKeys = sourceOptions.excludeKeys || undefined;
if(typeof object === 'undefined') {
throw new Error('Object argument required.');
}
// if there is a case-insensitive match in the hashes list, accept it
// (i.e. SHA256 for sha256)
for (var i = 0; i < hashes.length; ++i) {
if (hashes[i].toLowerCase() === options.algorithm.toLowerCase()) {
options.algorithm = hashes[i];
}
}
if(hashes.indexOf(options.algorithm) === -1){
throw new Error('Algorithm "' + options.algorithm + '" not supported. ' +
'supported values: ' + hashes.join(', '));
}
if(encodings.indexOf(options.encoding) === -1 &&
options.algorithm !== 'passthrough'){
throw new Error('Encoding "' + options.encoding + '" not supported. ' +
'supported values: ' + encodings.join(', '));
}
return options;
}
/** Check if the given function is a native function */
function isNativeFunction(f) {
if ((typeof f) !== 'function') {
return false;
}
var exp = /^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;
return exp.exec(Function.prototype.toString.call(f)) != null;
}
function hash(object, options) {
var hashingStream;
if (options.algorithm !== 'passthrough') {
hashingStream = crypto.createHash(options.algorithm);
} else {
hashingStream = new PassThrough();
}
if (typeof hashingStream.write === 'undefined') {
hashingStream.write = hashingStream.update;
hashingStream.end = hashingStream.update;
}
var hasher = typeHasher(options, hashingStream);
hasher.dispatch(object);
if (!hashingStream.update) {
hashingStream.end('');
}
if (hashingStream.digest) {
return hashingStream.digest(options.encoding === 'buffer' ? undefined : options.encoding);
}
var buf = hashingStream.read();
if (options.encoding === 'buffer') {
return buf;
}
return buf.toString(options.encoding);
}
/**
* Expose streaming API
*
* @param {object} object Value to serialize
* @param {object} options Options, as for hash()
* @param {object} stream A stream to write the serializiation to
* @api public
*/
exports.writeToStream = function(object, options, stream) {
if (typeof stream === 'undefined') {
stream = options;
options = {};
}
options = applyDefaults(object, options);
return typeHasher(options, stream).dispatch(object);
};
function typeHasher(options, writeTo, context){
context = context || [];
var write = function(str) {
if (writeTo.update) {
return writeTo.update(str, 'utf8');
} else {
return writeTo.write(str, 'utf8');
}
};
return {
dispatch: function(value){
if (options.replacer) {
value = options.replacer(value);
}
var type = typeof value;
if (value === null) {
type = 'null';
}
//console.log("[DEBUG] Dispatch: ", value, "->", type, " -> ", "_" + type);
return this['_' + type](value);
},
_object: function(object) {
var pattern = (/\[object (.*)\]/i);
var objString = Object.prototype.toString.call(object);
var objType = pattern.exec(objString);
if (!objType) { // object type did not match [object ...]
objType = 'unknown:[' + objString + ']';
} else {
objType = objType[1]; // take only the class name
}
objType = objType.toLowerCase();
var objectNumber = null;
if ((objectNumber = context.indexOf(object)) >= 0) {
return this.dispatch('[CIRCULAR:' + objectNumber + ']');
} else {
context.push(object);
}
if (typeof Buffer !== 'undefined' && Buffer.isBuffer && Buffer.isBuffer(object)) {
write('buffer:');
return write(object);
}
if(objType !== 'object' && objType !== 'function' && objType !== 'asyncfunction') {
if(this['_' + objType]) {
this['_' + objType](object);
} else if (options.ignoreUnknown) {
return write('[' + objType + ']');
} else {
throw new Error('Unknown object type "' + objType + '"');
}
}else{
var keys = Object.keys(object);
if (options.unorderedObjects) {
keys = keys.sort();
}
// Make sure to incorporate special properties, so
// Types with different prototypes will produce
// a different hash and objects derived from
// different functions (`new Foo`, `new Bar`) will
// produce different hashes.
// We never do this for native functions since some
// seem to break because of that.
if (options.respectType !== false && !isNativeFunction(object)) {
keys.splice(0, 0, 'prototype', '__proto__', 'constructor');
}
if (options.excludeKeys) {
keys = keys.filter(function(key) { return !options.excludeKeys(key); });
}
write('object:' + keys.length + ':');
var self = this;
return keys.forEach(function(key){
self.dispatch(key);
write(':');
if(!options.excludeValues) {
self.dispatch(object[key]);
}
write(',');
});
}
},
_array: function(arr, unordered){
unordered = typeof unordered !== 'undefined' ? unordered :
options.unorderedArrays !== false; // default to options.unorderedArrays
var self = this;
write('array:' + arr.length + ':');
if (!unordered || arr.length <= 1) {
return arr.forEach(function(entry) {
return self.dispatch(entry);
});
}
// the unordered case is a little more complicated:
// since there is no canonical ordering on objects,
// i.e. {a:1} < {a:2} and {a:1} > {a:2} are both false,
// we first serialize each entry using a PassThrough stream
// before sorting.
// also: we cant use the same context array for all entries
// since the order of hashing should *not* matter. instead,
// we keep track of the additions to a copy of the context array
// and add all of them to the global context array when were done
var contextAdditions = [];
var entries = arr.map(function(entry) {
var strm = new PassThrough();
var localContext = context.slice(); // make copy
var hasher = typeHasher(options, strm, localContext);
hasher.dispatch(entry);
// take only what was added to localContext and append it to contextAdditions
contextAdditions = contextAdditions.concat(localContext.slice(context.length));
return strm.read().toString();
});
context = context.concat(contextAdditions);
entries.sort();
return this._array(entries, false);
},
_date: function(date){
return write('date:' + date.toJSON());
},
_symbol: function(sym){
return write('symbol:' + sym.toString());
},
_error: function(err){
return write('error:' + err.toString());
},
_boolean: function(bool){
return write('bool:' + bool.toString());
},
_string: function(string){
write('string:' + string.length + ':');
write(string.toString());
},
_function: function(fn){
write('fn:');
if (isNativeFunction(fn)) {
this.dispatch('[native]');
} else {
this.dispatch(fn.toString());
}
if (options.respectFunctionNames !== false) {
// Make sure we can still distinguish native functions
// by their name, otherwise String and Function will
// have the same hash
this.dispatch("function-name:" + String(fn.name));
}
if (options.respectFunctionProperties) {
this._object(fn);
}
},
_number: function(number){
return write('number:' + number.toString());
},
_xml: function(xml){
return write('xml:' + xml.toString());
},
_null: function() {
return write('Null');
},
_undefined: function() {
return write('Undefined');
},
_regexp: function(regex){
return write('regex:' + regex.toString());
},
_uint8array: function(arr){
write('uint8array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_uint8clampedarray: function(arr){
write('uint8clampedarray:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_int8array: function(arr){
write('int8array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_uint16array: function(arr){
write('uint16array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_int16array: function(arr){
write('int16array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_uint32array: function(arr){
write('uint32array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_int32array: function(arr){
write('int32array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_float32array: function(arr){
write('float32array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_float64array: function(arr){
write('float64array:');
return this.dispatch(Array.prototype.slice.call(arr));
},
_arraybuffer: function(arr){
write('arraybuffer:');
return this.dispatch(new Uint8Array(arr));
},
_url: function(url) {
return write('url:' + url.toString(), 'utf8');
},
_map: function(map) {
write('map:');
var arr = Array.from(map);
return this._array(arr, options.unorderedSets !== false);
},
_set: function(set) {
write('set:');
var arr = Array.from(set);
return this._array(arr, options.unorderedSets !== false);
},
_file: function(file) {
write('file:');
return this.dispatch([file.name, file.size, file.type, file.lastModfied]);
},
_blob: function() {
if (options.ignoreUnknown) {
return write('[blob]');
}
throw Error('Hashing Blob objects is currently not supported\n' +
'(see https://github.com/puleos/object-hash/issues/26)\n' +
'Use "options.replacer" or "options.ignoreUnknown"\n');
},
_domwindow: function() { return write('domwindow'); },
_bigint: function(number){
return write('bigint:' + number.toString());
},
/* Node.js standard native objects */
_process: function() { return write('process'); },
_timer: function() { return write('timer'); },
_pipe: function() { return write('pipe'); },
_tcp: function() { return write('tcp'); },
_udp: function() { return write('udp'); },
_tty: function() { return write('tty'); },
_statwatcher: function() { return write('statwatcher'); },
_securecontext: function() { return write('securecontext'); },
_connection: function() { return write('connection'); },
_zlib: function() { return write('zlib'); },
_context: function() { return write('context'); },
_nodescript: function() { return write('nodescript'); },
_httpparser: function() { return write('httpparser'); },
_dataview: function() { return write('dataview'); },
_signal: function() { return write('signal'); },
_fsevent: function() { return write('fsevent'); },
_tlswrap: function() { return write('tlswrap'); },
};
}
// Mini-implementation of stream.PassThrough
// We are far from having need for the full implementation, and we can
// make assumptions like "many writes, then only one final read"
// and we can ignore encoding specifics
function PassThrough() {
return {
buf: '',
write: function(b) {
this.buf += b;
},
end: function(b) {
this.buf += b;
},
read: function() {
return this.buf;
}
};
}

View File

@@ -0,0 +1,10 @@
"use strict";
module.exports = {
copy: require("./copy"),
daysInMonth: require("./days-in-month"),
floorDay: require("./floor-day"),
floorMonth: require("./floor-month"),
floorYear: require("./floor-year"),
format: require("./format")
};

View File

@@ -0,0 +1,44 @@
'use strict';
var Type = require('../type');
var _hasOwnProperty = Object.prototype.hasOwnProperty;
var _toString = Object.prototype.toString;
function resolveYamlOmap(data) {
if (data === null) return true;
var objectKeys = [], index, length, pair, pairKey, pairHasKey,
object = data;
for (index = 0, length = object.length; index < length; index += 1) {
pair = object[index];
pairHasKey = false;
if (_toString.call(pair) !== '[object Object]') return false;
for (pairKey in pair) {
if (_hasOwnProperty.call(pair, pairKey)) {
if (!pairHasKey) pairHasKey = true;
else return false;
}
}
if (!pairHasKey) return false;
if (objectKeys.indexOf(pairKey) === -1) objectKeys.push(pairKey);
else return false;
}
return true;
}
function constructYamlOmap(data) {
return data !== null ? data : [];
}
module.exports = new Type('tag:yaml.org,2002:omap', {
kind: 'sequence',
resolve: resolveYamlOmap,
construct: constructYamlOmap
});

View File

@@ -0,0 +1,47 @@
{
"name": "get-stream",
"version": "6.0.1",
"description": "Get a stream as a string, buffer, or array",
"license": "MIT",
"repository": "sindresorhus/get-stream",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts",
"buffer-stream.js"
],
"keywords": [
"get",
"stream",
"promise",
"concat",
"string",
"text",
"buffer",
"read",
"data",
"consume",
"readable",
"readablestream",
"array",
"object"
],
"devDependencies": {
"@types/node": "^14.0.27",
"ava": "^2.4.0",
"into-stream": "^5.0.0",
"tsd": "^0.13.1",
"xo": "^0.24.0"
}
}

View File

@@ -0,0 +1,304 @@
// @ts-check
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "Offsets", {
enumerable: true,
get: ()=>Offsets
});
const _bigSign = /*#__PURE__*/ _interopRequireDefault(require("../util/bigSign"));
const _remapBitfieldJs = require("./remap-bitfield.js");
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {
default: obj
};
}
class Offsets {
constructor(){
/**
* Offsets for the next rule in a given layer
*
* @type {Record<Layer, bigint>}
*/ this.offsets = {
defaults: 0n,
base: 0n,
components: 0n,
utilities: 0n,
variants: 0n,
user: 0n
};
/**
* Positions for a given layer
*
* @type {Record<Layer, bigint>}
*/ this.layerPositions = {
defaults: 0n,
base: 1n,
components: 2n,
utilities: 3n,
// There isn't technically a "user" layer, but we need to give it a position
// Because it's used for ordering user-css from @apply
user: 4n,
variants: 5n
};
/**
* The total number of functions currently registered across all variants (including arbitrary variants)
*
* @type {bigint}
*/ this.reservedVariantBits = 0n;
/**
* Positions for a given variant
*
* @type {Map<string, bigint>}
*/ this.variantOffsets = new Map();
}
/**
* @param {Layer} layer
* @returns {RuleOffset}
*/ create(layer) {
return {
layer,
parentLayer: layer,
arbitrary: 0n,
variants: 0n,
parallelIndex: 0n,
index: this.offsets[layer]++,
options: []
};
}
/**
* @returns {RuleOffset}
*/ arbitraryProperty() {
return {
...this.create("utilities"),
arbitrary: 1n
};
}
/**
* Get the offset for a variant
*
* @param {string} variant
* @param {number} index
* @returns {RuleOffset}
*/ forVariant(variant, index = 0) {
let offset = this.variantOffsets.get(variant);
if (offset === undefined) {
throw new Error(`Cannot find offset for unknown variant ${variant}`);
}
return {
...this.create("variants"),
variants: offset << BigInt(index)
};
}
/**
* @param {RuleOffset} rule
* @param {RuleOffset} variant
* @param {VariantOption} options
* @returns {RuleOffset}
*/ applyVariantOffset(rule, variant, options) {
options.variant = variant.variants;
return {
...rule,
layer: "variants",
parentLayer: rule.layer === "variants" ? rule.parentLayer : rule.layer,
variants: rule.variants | variant.variants,
options: options.sort ? [].concat(options, rule.options) : rule.options,
// TODO: Technically this is wrong. We should be handling parallel index on a per variant basis.
// We'll take the max of all the parallel indexes for now.
// @ts-ignore
parallelIndex: max([
rule.parallelIndex,
variant.parallelIndex
])
};
}
/**
* @param {RuleOffset} offset
* @param {number} parallelIndex
* @returns {RuleOffset}
*/ applyParallelOffset(offset, parallelIndex) {
return {
...offset,
parallelIndex: BigInt(parallelIndex)
};
}
/**
* Each variant gets 1 bit per function / rule registered.
* This is because multiple variants can be applied to a single rule and we need to know which ones are present and which ones are not.
* Additionally, every unique group of variants is grouped together in the stylesheet.
*
* This grouping is order-independent. For instance, we do not differentiate between `hover:focus` and `focus:hover`.
*
* @param {string[]} variants
* @param {(name: string) => number} getLength
*/ recordVariants(variants, getLength) {
for (let variant of variants){
this.recordVariant(variant, getLength(variant));
}
}
/**
* The same as `recordVariants` but for a single arbitrary variant at runtime.
* @param {string} variant
* @param {number} fnCount
*
* @returns {RuleOffset} The highest offset for this variant
*/ recordVariant(variant, fnCount = 1) {
this.variantOffsets.set(variant, 1n << this.reservedVariantBits);
// Ensure space is reserved for each "function" in the parallel variant
// by offsetting the next variant by the number of parallel variants
// in the one we just added.
// Single functions that return parallel variants are NOT handled separately here
// They're offset by 1 (or the number of functions) as usual
// And each rule returned is tracked separately since the functions are evaluated lazily.
// @see `RuleOffset.parallelIndex`
this.reservedVariantBits += BigInt(fnCount);
return {
...this.create("variants"),
variants: this.variantOffsets.get(variant)
};
}
/**
* @param {RuleOffset} a
* @param {RuleOffset} b
* @returns {bigint}
*/ compare(a, b) {
// Sort layers together
if (a.layer !== b.layer) {
return this.layerPositions[a.layer] - this.layerPositions[b.layer];
}
// When sorting the `variants` layer, we need to sort based on the parent layer as well within
// this variants layer.
if (a.parentLayer !== b.parentLayer) {
return this.layerPositions[a.parentLayer] - this.layerPositions[b.parentLayer];
}
// Sort based on the sorting function
for (let aOptions of a.options){
for (let bOptions of b.options){
if (aOptions.id !== bOptions.id) continue;
if (!aOptions.sort || !bOptions.sort) continue;
var _max;
let maxFnVariant = (_max = max([
aOptions.variant,
bOptions.variant
])) !== null && _max !== void 0 ? _max : 0n;
// Create a mask of 0s from bits 1..N where N represents the mask of the Nth bit
let mask = ~(maxFnVariant | maxFnVariant - 1n);
let aVariantsAfterFn = a.variants & mask;
let bVariantsAfterFn = b.variants & mask;
// If the variants the same, we _can_ sort them
if (aVariantsAfterFn !== bVariantsAfterFn) {
continue;
}
let result = aOptions.sort({
value: aOptions.value,
modifier: aOptions.modifier
}, {
value: bOptions.value,
modifier: bOptions.modifier
});
if (result !== 0) return result;
}
}
// Sort variants in the order they were registered
if (a.variants !== b.variants) {
return a.variants - b.variants;
}
// Make sure each rule returned by a parallel variant is sorted in ascending order
if (a.parallelIndex !== b.parallelIndex) {
return a.parallelIndex - b.parallelIndex;
}
// Always sort arbitrary properties after other utilities
if (a.arbitrary !== b.arbitrary) {
return a.arbitrary - b.arbitrary;
}
// Sort utilities, components, etc… in the order they were registered
return a.index - b.index;
}
/**
* Arbitrary variants are recorded in the order they're encountered.
* This means that the order is not stable between environments and sets of content files.
*
* In order to make the order stable, we need to remap the arbitrary variant offsets to
* be in alphabetical order starting from the offset of the first arbitrary variant.
*/ recalculateVariantOffsets() {
// Sort the variants by their name
let variants = Array.from(this.variantOffsets.entries()).filter(([v])=>v.startsWith("[")).sort(([a], [z])=>fastCompare(a, z));
// Sort the list of offsets
// This is not necessarily a discrete range of numbers which is why
// we're using sort instead of creating a range from min/max
let newOffsets = variants.map(([, offset])=>offset).sort((a, z)=>(0, _bigSign.default)(a - z));
// Create a map from the old offsets to the new offsets in the new sort order
/** @type {[bigint, bigint][]} */ let mapping = variants.map(([, oldOffset], i)=>[
oldOffset,
newOffsets[i]
]);
// Remove any variants that will not move letting us skip
// remapping if everything happens to be in order
return mapping.filter(([a, z])=>a !== z);
}
/**
* @template T
* @param {[RuleOffset, T][]} list
* @returns {[RuleOffset, T][]}
*/ remapArbitraryVariantOffsets(list) {
let mapping = this.recalculateVariantOffsets();
// No arbitrary variants? Nothing to do.
// Everyhing already in order? Nothing to do.
if (mapping.length === 0) {
return list;
}
// Remap every variant offset in the list
return list.map((item)=>{
let [offset, rule] = item;
offset = {
...offset,
variants: (0, _remapBitfieldJs.remapBitfield)(offset.variants, mapping)
};
return [
offset,
rule
];
});
}
/**
* @template T
* @param {[RuleOffset, T][]} list
* @returns {[RuleOffset, T][]}
*/ sort(list) {
list = this.remapArbitraryVariantOffsets(list);
return list.sort(([a], [b])=>(0, _bigSign.default)(this.compare(a, b)));
}
}
/**
*
* @param {bigint[]} nums
* @returns {bigint|null}
*/ function max(nums) {
let max = null;
for (const num of nums){
max = max !== null && max !== void 0 ? max : num;
max = max > num ? max : num;
}
return max;
}
/**
* A fast ASCII order string comparison function.
*
* Using `.sort()` without a custom compare function is faster
* But you can only use that if you're sorting an array of
* only strings. If you're sorting strings inside objects
* or arrays, you need must use a custom compare function.
*
* @param {string} a
* @param {string} b
*/ function fastCompare(a, b) {
let aLen = a.length;
let bLen = b.length;
let minLen = aLen < bLen ? aLen : bLen;
for(let i = 0; i < minLen; i++){
let cmp = a.charCodeAt(i) - b.charCodeAt(i);
if (cmp !== 0) return cmp;
}
return aLen - bLen;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"timeoutProvider.d.ts","sourceRoot":"","sources":["../../../../src/internal/scheduler/timeoutProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,aAAK,kBAAkB,GAAG,CAAC,OAAO,EAAE,MAAM,IAAI,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,WAAW,CAAC;AACjG,aAAK,oBAAoB,GAAG,CAAC,MAAM,EAAE,WAAW,KAAK,IAAI,CAAC;AAE1D,UAAU,eAAe;IACvB,UAAU,EAAE,kBAAkB,CAAC;IAC/B,YAAY,EAAE,oBAAoB,CAAC;IACnC,QAAQ,EACJ;QACE,UAAU,EAAE,kBAAkB,CAAC;QAC/B,YAAY,EAAE,oBAAoB,CAAC;KACpC,GACD,SAAS,CAAC;CACf;AAED,eAAO,MAAM,eAAe,EAAE,eAe7B,CAAC"}

View File

@@ -0,0 +1,13 @@
var getEol = require("./getEol");
/**
* convert data chunk to file lines array
* @param {string} data data chunk as utf8 string
* @param {object} param Converter param object
* @return {Object} {lines:[line1,line2...],partial:String}
*/
module.exports = function(data, param) {
var eol = getEol(data,param);
var lines = data.split(eol);
var partial = lines.pop();
return {lines: lines, partial: partial};
};

View File

@@ -0,0 +1,30 @@
var nativeCreate = require('./_nativeCreate');
/** Used to stand-in for `undefined` hash values. */
var HASH_UNDEFINED = '__lodash_hash_undefined__';
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Gets the hash value for `key`.
*
* @private
* @name get
* @memberOf Hash
* @param {string} key The key of the value to get.
* @returns {*} Returns the entry value.
*/
function hashGet(key) {
var data = this.__data__;
if (nativeCreate) {
var result = data[key];
return result === HASH_UNDEFINED ? undefined : result;
}
return hasOwnProperty.call(data, key) ? data[key] : undefined;
}
module.exports = hashGet;

View File

@@ -0,0 +1,225 @@
import ansiStyles from '#ansi-styles';
import supportsColor from '#supports-color';
import { // eslint-disable-line import/order
stringReplaceAll,
stringEncaseCRLFWithFirstIndex,
} from './utilities.js';
const {stdout: stdoutColor, stderr: stderrColor} = supportsColor;
const GENERATOR = Symbol('GENERATOR');
const STYLER = Symbol('STYLER');
const IS_EMPTY = Symbol('IS_EMPTY');
// `supportsColor.level` → `ansiStyles.color[name]` mapping
const levelMapping = [
'ansi',
'ansi',
'ansi256',
'ansi16m',
];
const styles = Object.create(null);
const applyOptions = (object, options = {}) => {
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
throw new Error('The `level` option should be an integer from 0 to 3');
}
// Detect level if not set manually
const colorLevel = stdoutColor ? stdoutColor.level : 0;
object.level = options.level === undefined ? colorLevel : options.level;
};
export class Chalk {
constructor(options) {
// eslint-disable-next-line no-constructor-return
return chalkFactory(options);
}
}
const chalkFactory = options => {
const chalk = (...strings) => strings.join(' ');
applyOptions(chalk, options);
Object.setPrototypeOf(chalk, createChalk.prototype);
return chalk;
};
function createChalk(options) {
return chalkFactory(options);
}
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
for (const [styleName, style] of Object.entries(ansiStyles)) {
styles[styleName] = {
get() {
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
Object.defineProperty(this, styleName, {value: builder});
return builder;
},
};
}
styles.visible = {
get() {
const builder = createBuilder(this, this[STYLER], true);
Object.defineProperty(this, 'visible', {value: builder});
return builder;
},
};
const getModelAnsi = (model, level, type, ...arguments_) => {
if (model === 'rgb') {
if (level === 'ansi16m') {
return ansiStyles[type].ansi16m(...arguments_);
}
if (level === 'ansi256') {
return ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));
}
return ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));
}
if (model === 'hex') {
return getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));
}
return ansiStyles[type][model](...arguments_);
};
const usedModels = ['rgb', 'hex', 'ansi256'];
for (const model of usedModels) {
styles[model] = {
get() {
const {level} = this;
return function (...arguments_) {
const styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);
return createBuilder(this, styler, this[IS_EMPTY]);
};
},
};
const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
styles[bgModel] = {
get() {
const {level} = this;
return function (...arguments_) {
const styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);
return createBuilder(this, styler, this[IS_EMPTY]);
};
},
};
}
const proto = Object.defineProperties(() => {}, {
...styles,
level: {
enumerable: true,
get() {
return this[GENERATOR].level;
},
set(level) {
this[GENERATOR].level = level;
},
},
});
const createStyler = (open, close, parent) => {
let openAll;
let closeAll;
if (parent === undefined) {
openAll = open;
closeAll = close;
} else {
openAll = parent.openAll + open;
closeAll = close + parent.closeAll;
}
return {
open,
close,
openAll,
closeAll,
parent,
};
};
const createBuilder = (self, _styler, _isEmpty) => {
// Single argument is hot path, implicit coercion is faster than anything
// eslint-disable-next-line no-implicit-coercion
const builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));
// We alter the prototype because we must return a function, but there is
// no way to create a function with a different prototype
Object.setPrototypeOf(builder, proto);
builder[GENERATOR] = self;
builder[STYLER] = _styler;
builder[IS_EMPTY] = _isEmpty;
return builder;
};
const applyStyle = (self, string) => {
if (self.level <= 0 || !string) {
return self[IS_EMPTY] ? '' : string;
}
let styler = self[STYLER];
if (styler === undefined) {
return string;
}
const {openAll, closeAll} = styler;
if (string.includes('\u001B')) {
while (styler !== undefined) {
// Replace any instances already present with a re-opening code
// otherwise only the part of the string until said closing code
// will be colored, and the rest will simply be 'plain'.
string = stringReplaceAll(string, styler.close, styler.open);
styler = styler.parent;
}
}
// We can move both next actions out of loop, because remaining actions in loop won't have
// any/visible effect on parts we add here. Close the styling before a linebreak and reopen
// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92
const lfIndex = string.indexOf('\n');
if (lfIndex !== -1) {
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
}
return openAll + string + closeAll;
};
Object.defineProperties(createChalk.prototype, styles);
const chalk = createChalk();
export const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});
export {
modifierNames,
foregroundColorNames,
backgroundColorNames,
colorNames,
// TODO: Remove these aliases in the next major version
modifierNames as modifiers,
foregroundColorNames as foregroundColors,
backgroundColorNames as backgroundColors,
colorNames as colors,
} from './vendor/ansi-styles/index.js';
export {
stdoutColor as supportsColor,
stderrColor as supportsColorStderr,
};
export default chalk;

View File

@@ -0,0 +1 @@
{"name":"latest-version","version":"7.0.0","files":{"license":{"checkedAt":1678883669302,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"index.js":{"checkedAt":1678883672616,"integrity":"sha512-6cywHkotjx6lRCgmbOiIdTXGq52OcE17Vq02Zbhl/3eylis6WN8G0hb4oJEHa2sOrTHCyciwIJtLQa/wEH2edQ==","mode":420,"size":202},"package.json":{"checkedAt":1678883672616,"integrity":"sha512-Zv32I5p4kU9ZTxo6Ow7CSUe87UasGzquObu2k3uoPn3NhLTa1+FYAnDK7Lj4IEIpkcE0qpq+yq+vRuN82p9z9w==","mode":420,"size":850},"readme.md":{"checkedAt":1678883672616,"integrity":"sha512-ThezsXv/0Oo0PpwzRTpCCQqYZ99RONd1bb1fI4sVTepttHtH0IiES2nKdMFVmU8FnyHoK3INY7ILuXv3TqIbMA==","mode":420,"size":1367},"index.d.ts":{"checkedAt":1678883672616,"integrity":"sha512-Z9/leW3SNrzLn8Qe77iMjBS8vLwldd5J2ExwVmiuExiuxpWja4xZY9AQ3alHOnZVNuWiYvIDjiPGmZ4d1xUlGg==","mode":420,"size":591}}}

View File

@@ -0,0 +1 @@
{"version":3,"file":"forkJoin.d.ts","sourceRoot":"","sources":["../../../../src/internal/observable/forkJoin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAOlF,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAQ3C;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC;AAG5E,wBAAgB,QAAQ,CAAC,SAAS,EAAE,IAAI,GAAG,SAAS,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAGzE,wBAAgB,QAAQ,CAAC,OAAO,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAClE,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,EAAE,OAAO,EAAE,SAAS,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AACtH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,EAAE,CAAC,EACtD,OAAO,EAAE,SAAS,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,EAC9C,cAAc,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,GAClC,UAAU,CAAC,CAAC,CAAC,CAAC;AAGjB,+JAA+J;AAC/J,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AAChH,+JAA+J;AAC/J,wBAAgB,QAAQ,CAAC,CAAC,SAAS,SAAS,OAAO,EAAE,EAAE,CAAC,EACtD,GAAG,wBAAwB,EAAE,CAAC,GAAG,oBAAoB,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC,GAC7E,UAAU,CAAC,CAAC,CAAC,CAAC;AAGjB,wBAAgB,QAAQ,CAAC,aAAa,EAAE;KAAG,CAAC,IAAI,GAAG,GAAG,KAAK;CAAE,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;AAClF,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,EACrE,aAAa,EAAE,CAAC,GACf,UAAU,CAAC;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,CAAC,CAAC"}

View File

@@ -0,0 +1,121 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var AsyncFromSyncIteratorContinuation = require('./AsyncFromSyncIteratorContinuation');
var Call = require('./Call');
var CreateIterResultObject = require('./CreateIterResultObject');
var Get = require('./Get');
var GetMethod = require('./GetMethod');
var IteratorNext = require('./IteratorNext');
var OrdinaryObjectCreate = require('./OrdinaryObjectCreate');
var Type = require('./Type');
var SLOT = require('internal-slot');
var assertRecord = require('../helpers/assertRecord');
var $AsyncFromSyncIteratorPrototype = GetIntrinsic('%AsyncFromSyncIteratorPrototype%', true) || {
next: function next(value) {
var O = this; // step 1
SLOT.assert(O, '[[SyncIteratorRecord]]'); // step 2
var argsLength = arguments.length;
return new Promise(function (resolve) { // step 3
var syncIteratorRecord = SLOT.get(O, '[[SyncIteratorRecord]]'); // step 4
var result;
if (argsLength > 0) {
result = IteratorNext(syncIteratorRecord['[[Iterator]]'], value); // step 5.a
} else { // step 6
result = IteratorNext(syncIteratorRecord['[[Iterator]]']);// step 6.a
}
resolve(AsyncFromSyncIteratorContinuation(result)); // step 8
});
},
'return': function () {
var O = this; // step 1
SLOT.assert(O, '[[SyncIteratorRecord]]'); // step 2
var valueIsPresent = arguments.length > 0;
var value = valueIsPresent ? arguments[0] : void undefined;
return new Promise(function (resolve, reject) { // step 3
var syncIterator = SLOT.get(O, '[[SyncIteratorRecord]]')['[[Iterator]]']; // step 4
var iteratorReturn = GetMethod(syncIterator, 'return'); // step 5
if (typeof iteratorReturn === 'undefined') { // step 7
var iterResult = CreateIterResultObject(value, true); // step 7.a
Call(resolve, undefined, [iterResult]); // step 7.b
return;
}
var result;
if (valueIsPresent) { // step 8
result = Call(iteratorReturn, syncIterator, [value]); // step 8.a
} else { // step 9
result = Call(iteratorReturn, syncIterator); // step 9.a
}
if (Type(result) !== 'Object') { // step 11
Call(reject, undefined, [new $TypeError('Iterator `return` method returned a non-object value.')]); // step 11.a
return;
}
resolve(AsyncFromSyncIteratorContinuation(result)); // step 12
});
},
'throw': function () {
var O = this; // step 1
SLOT.assert(O, '[[SyncIteratorRecord]]'); // step 2
var valueIsPresent = arguments.length > 0;
var value = valueIsPresent ? arguments[0] : void undefined;
return new Promise(function (resolve, reject) { // step 3
var syncIterator = SLOT.get(O, '[[SyncIteratorRecord]]')['[[Iterator]]']; // step 4
var throwMethod = GetMethod(syncIterator, 'throw'); // step 5
if (typeof throwMethod === 'undefined') { // step 7
Call(reject, undefined, [value]); // step 7.a
return;
}
var result;
if (valueIsPresent) { // step 8
result = Call(throwMethod, syncIterator, [value]); // step 8.a
} else { // step 9
result = Call(throwMethod, syncIterator); // step 9.a
}
if (Type(result) !== 'Object') { // step 11
Call(reject, undefined, [new $TypeError('Iterator `throw` method returned a non-object value.')]); // step 11.a
return;
}
resolve(AsyncFromSyncIteratorContinuation(result/* , promiseCapability */)); // step 12
});
}
};
// https://262.ecma-international.org/11.0/#sec-createasyncfromsynciterator
module.exports = function CreateAsyncFromSyncIterator(syncIteratorRecord) {
assertRecord(Type, 'Iterator Record', 'syncIteratorRecord', syncIteratorRecord);
// var asyncIterator = OrdinaryObjectCreate(%AsyncFromSyncIteratorPrototype%, « [[SyncIteratorRecord]] »); // step 1
var asyncIterator = OrdinaryObjectCreate($AsyncFromSyncIteratorPrototype);
SLOT.set(asyncIterator, '[[SyncIteratorRecord]]', syncIteratorRecord); // step 2
var nextMethod = Get(asyncIterator, 'next'); // step 3
return { // steps 3-4
'[[Iterator]]': asyncIterator,
'[[NextMethod]]': nextMethod,
'[[Done]]': false
};
};

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J D CC","132":"E F A B"},B:{"1":"P Q R S T U V W X Y Z a b c d e i j k l m n o p q r s t u f H","132":"C K L G M N O"},C:{"2":"DC tB I v J D E F A B C K L G M N O EC FC","132":"0 1 2 3 4 5 6 7 8 9 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"},D:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB 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","16":"I v J D E F A B C K L"},E:{"2":"I v J D E F A B C K L G HC zB IC JC KC LC 0B qB rB 1B MC NC 2B 3B 4B 5B sB 6B 7B 8B 9B OC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G M N O w g x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB h lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d e","132":"F B C PC QC RC SC qB AC TC rB"},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:{"16":"oC"},I:{"16":"tB I f pC qC rC sC BC tC uC"},J:{"16":"D A"},K:{"1":"h","16":"A B C qB AC rB"},L:{"1":"H"},M:{"132":"H"},N:{"258":"A B"},O:{"1":"vC"},P:{"1":"I g wC xC yC zC 0C 0B 1C 2C 3C 4C 5C sB 6C 7C 8C"},Q:{"1":"1B"},R:{"1":"9C"},S:{"132":"AD BD"}},B:5,C:"CSS Paged Media (@page)"};