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,101 @@
# 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.6](https://github.com/es-shims/String.prototype.trimStart/compare/v1.0.5...v1.0.6) - 2022-11-07
### Commits
- [meta] use `npmignore` to autogenerate an npmignore file [`0838ae4`](https://github.com/es-shims/String.prototype.trimStart/commit/0838ae4ed948df470185afbeea4296f5c5ecd759)
- [actions] update rebase action to use reusable workflow [`d6bb784`](https://github.com/es-shims/String.prototype.trimStart/commit/d6bb78400a00459e9ab0b28f433c45804a65184d)
- [Dev Deps] update `aud`, `tape` [`8734d9a`](https://github.com/es-shims/String.prototype.trimStart/commit/8734d9a616c6aca9ec7f0c8819e66c2496deb32e)
- [Deps] update `es-abstract` [`30f593f`](https://github.com/es-shims/String.prototype.trimStart/commit/30f593f3febf6d8d9b3d5605174b437fed9cbb3a)
## [v1.0.5](https://github.com/es-shims/String.prototype.trimStart/compare/v1.0.4...v1.0.5) - 2022-05-02
### Commits
- [actions] reuse common workflows [`61d4009`](https://github.com/es-shims/String.prototype.trimStart/commit/61d40098a96b3dcc6cf963c9d03dd1b23b6eb13d)
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`bfe39c4`](https://github.com/es-shims/String.prototype.trimStart/commit/bfe39c498e26a4ad75c64cce27ff3df9bfef2cc1)
- [Fix] ensure main entry point properly checks the receiver in ES3 engines [`36e3730`](https://github.com/es-shims/String.prototype.trimStart/commit/36e37307bb06fb5dc34d861a4bf6f7db931340d9)
- [Fix] as of unicode v6, the mongolian vowel separator is no longer whitespace [`4f77eed`](https://github.com/es-shims/String.prototype.trimStart/commit/4f77eed5aa64e6f781310847d7831563fce90f5c)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `safe-publish-latest`, `tape` [`59fcb99`](https://github.com/es-shims/String.prototype.trimStart/commit/59fcb995ef8d4723a83e28d46dbe41a14253b681)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `functions-have-names`, `tape` [`486ffcf`](https://github.com/es-shims/String.prototype.trimStart/commit/486ffcfa93c75516601169a3973b81fdfeb7de8b)
- [actions] update codecov uploader [`b33ac48`](https://github.com/es-shims/String.prototype.trimStart/commit/b33ac48ccc86f6b894d8fde5162bd1c806904972)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `aud`, `auto-changelog`, `tape` [`3c89fa5`](https://github.com/es-shims/String.prototype.trimStart/commit/3c89fa571d1c4b8894230d93caaf3b3d9885534d)
- [readme] add github actions/codecov badges [`00be6b3`](https://github.com/es-shims/String.prototype.trimStart/commit/00be6b34fdd989950b934b4471087362b78d4b0c)
- [Dev Deps] update `eslint`, `tape` [`13a08f5`](https://github.com/es-shims/String.prototype.trimStart/commit/13a08f578c53cf5f129fb6ebe486e8bbcc40c14e)
- [actions] update workflows [`6ac576d`](https://github.com/es-shims/String.prototype.trimStart/commit/6ac576dde99f73d19492777efed29ec069e89bf1)
- [meta] use `prepublishOnly` script for npm 7+ [`fa382ca`](https://github.com/es-shims/String.prototype.trimStart/commit/fa382caa5c8e9a868572605ce215a3db1dc9ef21)
- [Deps] update `define-properties` [`d57bffe`](https://github.com/es-shims/String.prototype.trimStart/commit/d57bffef7d89384c8888627c5ee33b80e24d54e0)
## [v1.0.4](https://github.com/es-shims/String.prototype.trimStart/compare/v1.0.3...v1.0.4) - 2021-02-23
### Commits
- [meta] do not publish github action workflow files [`9c434ec`](https://github.com/es-shims/String.prototype.trimStart/commit/9c434eceb50141cf36e8e65f514226b0b547b568)
- [readme] remove travis badge [`7843160`](https://github.com/es-shims/String.prototype.trimStart/commit/7843160a3e8feaa2213feb0da9c5ad7d9bf21b59)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `functions-have-names`, `has-strict-mode`, `tape` [`8b52646`](https://github.com/es-shims/String.prototype.trimStart/commit/8b52646510aea20473da5491fe0876117a2251b1)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `tape` [`badeda2`](https://github.com/es-shims/String.prototype.trimStart/commit/badeda2b01d2e266e4d1c2e7dc0e4fca0f066f3e)
- [Tests] increase coverage [`bf8777d`](https://github.com/es-shims/String.prototype.trimStart/commit/bf8777d54c4b05c093559021cfaf0670306120f8)
- [actions] update workflows [`61be1c6`](https://github.com/es-shims/String.prototype.trimStart/commit/61be1c649ae859faa40286e57fa22cef65ae1229)
- [meta] gitignore coverage output [`c9c98d7`](https://github.com/es-shims/String.prototype.trimStart/commit/c9c98d75d7708e8906a39b55a0ad7a0ed6a9e4b0)
- [Deps] update `call-bind` [`c8645e8`](https://github.com/es-shims/String.prototype.trimStart/commit/c8645e89f9ace7681660ba66c724cf00c798f3d4)
## [v1.0.3](https://github.com/es-shims/String.prototype.trimStart/compare/v1.0.2...v1.0.3) - 2020-11-21
### Commits
- [Tests] migrate tests to Github Actions [`fbc7519`](https://github.com/es-shims/String.prototype.trimStart/commit/fbc7519cce2b5bfff9fe28dea96fb5f6f82e19fd)
- [Tests] add `implementation` test; run `es-shim-api` in postlint; use `tape` runner [`3c9330b`](https://github.com/es-shims/String.prototype.trimStart/commit/3c9330be9ad02497f78ff0fd94b7c918c3a4bc21)
- [Tests] run `nyc` on all tests [`52229ca`](https://github.com/es-shims/String.prototype.trimStart/commit/52229ca28426be516c3826743e417be85144673e)
- [Deps] replace `es-abstract` with `call-bind` [`5e5068d`](https://github.com/es-shims/String.prototype.trimStart/commit/5e5068d2cc85d0a6f2a441ea984521ee70470537)
- [Dev Deps] update `eslint`, `aud`; add `safe-publish-latest` [`42a853e`](https://github.com/es-shims/String.prototype.trimStart/commit/42a853e2cb419378085098cb66e421ee94eed3ab)
## [v1.0.2](https://github.com/es-shims/String.prototype.trimStart/compare/v1.0.1...v1.0.2) - 2020-10-20
### Commits
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`d032b38`](https://github.com/es-shims/String.prototype.trimStart/commit/d032b38aac7e9ebae7bf5c4195492c508af2815a)
- [actions] add "Allow Edits" workflow [`83e30ba`](https://github.com/es-shims/String.prototype.trimStart/commit/83e30bac01572b6dba6358fec6e339c55dc431c9)
- [Deps] update `es-abstract` [`707d85d`](https://github.com/es-shims/String.prototype.trimStart/commit/707d85d827d9c537a144f199fdecc47edaade1cd)
- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`096c6d9`](https://github.com/es-shims/String.prototype.trimStart/commit/096c6d9dc142286c750da7024e7a88ed698a4953)
## [v1.0.1](https://github.com/es-shims/String.prototype.trimStart/compare/v1.0.0...v1.0.1) - 2020-04-09
### Commits
- [meta] add some missing repo metadata [`3385da3`](https://github.com/es-shims/String.prototype.trimStart/commit/3385da3bbb87819de11a869981ca954887a6a092)
- [Dev Deps] update `auto-changelog` [`879377d`](https://github.com/es-shims/String.prototype.trimStart/commit/879377df9c1ff97d8f0b3eac800683f1d68a304c)
## [v1.0.0](https://github.com/es-shims/String.prototype.trimStart/compare/v0.1.0...v1.0.0) - 2020-03-30
### Commits
- [Breaking] convert to es-shim API [`970922c`](https://github.com/es-shims/String.prototype.trimStart/commit/970922c494c78b033c351c77f61a8aefd49c30d9)
- [meta] add `auto-changelog` [`ff30c09`](https://github.com/es-shims/String.prototype.trimStart/commit/ff30c0996289113d2c3dbbfca7e280ff151bf36d)
- [meta] update readme [`816291d`](https://github.com/es-shims/String.prototype.trimStart/commit/816291d01e0eaf85da9b732c179cfb2454bd282e)
- [Tests] add `npm run lint` [`3341104`](https://github.com/es-shims/String.prototype.trimStart/commit/3341104450bc6ac84f3b70a6d6c0fbeb4df5131e)
- Only apps should have lockfiles [`f008df7`](https://github.com/es-shims/String.prototype.trimStart/commit/f008df73fbf3dcf8dfad6d5cad86de7050d0ae09)
- [actions] add automatic rebasing / merge commit blocking [`e5ba35c`](https://github.com/es-shims/String.prototype.trimStart/commit/e5ba35c1a14fcf652336cc9c4be49d232981161e)
- [Tests] use shared travis-ci configs [`46516b1`](https://github.com/es-shims/String.prototype.trimStart/commit/46516b137a8c07ed5807d751bd61199688ef9baa)
- [meta] add `funding` field [`34ae856`](https://github.com/es-shims/String.prototype.trimStart/commit/34ae8563f115bd4a5e5f5d2d786c0fa0a420fa2a)
- [meta] fix non-updated version number [`3b0e262`](https://github.com/es-shims/String.prototype.trimStart/commit/3b0e262e2f4eeee2e1b99fe890f8ca17bed8f2fd)
## [v0.1.0](https://github.com/es-shims/String.prototype.trimStart/compare/v0.0.1...v0.1.0) - 2017-12-19
### Commits
- updated README [`ab2f6ac`](https://github.com/es-shims/String.prototype.trimStart/commit/ab2f6ac8813ed336a0f2dc3aa8cdb52f4d52814b)
## v0.0.1 - 2017-12-19
### Commits
- finished polyfill [`1c7ca20`](https://github.com/es-shims/String.prototype.trimStart/commit/1c7ca2043e3383b6e743870bc622ad4a38477147)
- created README file: [`192ecad`](https://github.com/es-shims/String.prototype.trimStart/commit/192ecaded4e0d5baaa65cd41e590b8d837520d44)
- Initial commit [`14044f8`](https://github.com/es-shims/String.prototype.trimStart/commit/14044f8a0fe1d155fe7403a8327bdbaf135da2d6)
- updated README [`d4fb6be`](https://github.com/es-shims/String.prototype.trimStart/commit/d4fb6be15455dd68fc4b306bee1d30dd4afc96e7)

View File

@@ -0,0 +1,5 @@
import { isFunction } from './isFunction';
export function isAsyncIterable(obj) {
return Symbol.asyncIterator && isFunction(obj === null || obj === void 0 ? void 0 : obj[Symbol.asyncIterator]);
}
//# sourceMappingURL=isAsyncIterable.js.map

View File

@@ -0,0 +1,693 @@
import { Observable } from '../Observable';
import { ColdObservable } from './ColdObservable';
import { HotObservable } from './HotObservable';
import { TestMessage } from './TestMessage';
import { SubscriptionLog } from './SubscriptionLog';
import { Subscription } from '../Subscription';
import { VirtualTimeScheduler, VirtualAction } from '../scheduler/VirtualTimeScheduler';
import { ObservableNotification } from '../types';
import { COMPLETE_NOTIFICATION, errorNotification, nextNotification } from '../NotificationFactories';
import { dateTimestampProvider } from '../scheduler/dateTimestampProvider';
import { performanceTimestampProvider } from '../scheduler/performanceTimestampProvider';
import { animationFrameProvider } from '../scheduler/animationFrameProvider';
import type { TimerHandle } from '../scheduler/timerHandle';
import { immediateProvider } from '../scheduler/immediateProvider';
import { intervalProvider } from '../scheduler/intervalProvider';
import { timeoutProvider } from '../scheduler/timeoutProvider';
const defaultMaxFrame: number = 750;
export interface RunHelpers {
cold: typeof TestScheduler.prototype.createColdObservable;
hot: typeof TestScheduler.prototype.createHotObservable;
flush: typeof TestScheduler.prototype.flush;
time: typeof TestScheduler.prototype.createTime;
expectObservable: typeof TestScheduler.prototype.expectObservable;
expectSubscriptions: typeof TestScheduler.prototype.expectSubscriptions;
animate: (marbles: string) => void;
}
interface FlushableTest {
ready: boolean;
actual?: any[];
expected?: any[];
}
export type observableToBeFn = (marbles: string, values?: any, errorValue?: any) => void;
export type subscriptionLogsToBeFn = (marbles: string | string[]) => void;
export class TestScheduler extends VirtualTimeScheduler {
/**
* The number of virtual time units each character in a marble diagram represents. If
* the test scheduler is being used in "run mode", via the `run` method, this is temporarily
* set to `1` for the duration of the `run` block, then set back to whatever value it was.
* @nocollapse
*/
static frameTimeFactor = 10;
/**
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
*/
public readonly hotObservables: HotObservable<any>[] = [];
/**
* @deprecated Internal implementation detail, do not use directly. Will be made internal in v8.
*/
public readonly coldObservables: ColdObservable<any>[] = [];
/**
* Test meta data to be processed during `flush()`
*/
private flushTests: FlushableTest[] = [];
/**
* Indicates whether the TestScheduler instance is operating in "run mode",
* meaning it's processing a call to `run()`
*/
private runMode = false;
/**
*
* @param assertDeepEqual A function to set up your assertion for your test harness
*/
constructor(public assertDeepEqual: (actual: any, expected: any) => boolean | void) {
super(VirtualAction, defaultMaxFrame);
}
createTime(marbles: string): number {
const indexOf = this.runMode ? marbles.trim().indexOf('|') : marbles.indexOf('|');
if (indexOf === -1) {
throw new Error('marble diagram for time should have a completion marker "|"');
}
return indexOf * TestScheduler.frameTimeFactor;
}
/**
* @param marbles A diagram in the marble DSL. Letters map to keys in `values` if provided.
* @param values Values to use for the letters in `marbles`. If omitted, the letters themselves are used.
* @param error The error to use for the `#` marble (if present).
*/
createColdObservable<T = string>(marbles: string, values?: { [marble: string]: T }, error?: any): ColdObservable<T> {
if (marbles.indexOf('^') !== -1) {
throw new Error('cold observable cannot have subscription offset "^"');
}
if (marbles.indexOf('!') !== -1) {
throw new Error('cold observable cannot have unsubscription marker "!"');
}
const messages = TestScheduler.parseMarbles(marbles, values, error, undefined, this.runMode);
const cold = new ColdObservable<T>(messages, this);
this.coldObservables.push(cold);
return cold;
}
/**
* @param marbles A diagram in the marble DSL. Letters map to keys in `values` if provided.
* @param values Values to use for the letters in `marbles`. If omitted, the letters themselves are used.
* @param error The error to use for the `#` marble (if present).
*/
createHotObservable<T = string>(marbles: string, values?: { [marble: string]: T }, error?: any): HotObservable<T> {
if (marbles.indexOf('!') !== -1) {
throw new Error('hot observable cannot have unsubscription marker "!"');
}
const messages = TestScheduler.parseMarbles(marbles, values, error, undefined, this.runMode);
const subject = new HotObservable<T>(messages, this);
this.hotObservables.push(subject);
return subject;
}
private materializeInnerObservable(observable: Observable<any>, outerFrame: number): TestMessage[] {
const messages: TestMessage[] = [];
observable.subscribe({
next: (value) => {
messages.push({ frame: this.frame - outerFrame, notification: nextNotification(value) });
},
error: (error) => {
messages.push({ frame: this.frame - outerFrame, notification: errorNotification(error) });
},
complete: () => {
messages.push({ frame: this.frame - outerFrame, notification: COMPLETE_NOTIFICATION });
},
});
return messages;
}
expectObservable<T>(observable: Observable<T>, subscriptionMarbles: string | null = null) {
const actual: TestMessage[] = [];
const flushTest: FlushableTest = { actual, ready: false };
const subscriptionParsed = TestScheduler.parseMarblesAsSubscriptions(subscriptionMarbles, this.runMode);
const subscriptionFrame = subscriptionParsed.subscribedFrame === Infinity ? 0 : subscriptionParsed.subscribedFrame;
const unsubscriptionFrame = subscriptionParsed.unsubscribedFrame;
let subscription: Subscription;
this.schedule(() => {
subscription = observable.subscribe({
next: (x) => {
// Support Observable-of-Observables
const value = x instanceof Observable ? this.materializeInnerObservable(x, this.frame) : x;
actual.push({ frame: this.frame, notification: nextNotification(value) });
},
error: (error) => {
actual.push({ frame: this.frame, notification: errorNotification(error) });
},
complete: () => {
actual.push({ frame: this.frame, notification: COMPLETE_NOTIFICATION });
},
});
}, subscriptionFrame);
if (unsubscriptionFrame !== Infinity) {
this.schedule(() => subscription.unsubscribe(), unsubscriptionFrame);
}
this.flushTests.push(flushTest);
const { runMode } = this;
return {
toBe(marbles: string, values?: any, errorValue?: any) {
flushTest.ready = true;
flushTest.expected = TestScheduler.parseMarbles(marbles, values, errorValue, true, runMode);
},
toEqual: (other: Observable<T>) => {
flushTest.ready = true;
flushTest.expected = [];
this.schedule(() => {
subscription = other.subscribe({
next: (x) => {
// Support Observable-of-Observables
const value = x instanceof Observable ? this.materializeInnerObservable(x, this.frame) : x;
flushTest.expected!.push({ frame: this.frame, notification: nextNotification(value) });
},
error: (error) => {
flushTest.expected!.push({ frame: this.frame, notification: errorNotification(error) });
},
complete: () => {
flushTest.expected!.push({ frame: this.frame, notification: COMPLETE_NOTIFICATION });
},
});
}, subscriptionFrame);
},
};
}
expectSubscriptions(actualSubscriptionLogs: SubscriptionLog[]): { toBe: subscriptionLogsToBeFn } {
const flushTest: FlushableTest = { actual: actualSubscriptionLogs, ready: false };
this.flushTests.push(flushTest);
const { runMode } = this;
return {
toBe(marblesOrMarblesArray: string | string[]) {
const marblesArray: string[] = typeof marblesOrMarblesArray === 'string' ? [marblesOrMarblesArray] : marblesOrMarblesArray;
flushTest.ready = true;
flushTest.expected = marblesArray
.map((marbles) => TestScheduler.parseMarblesAsSubscriptions(marbles, runMode))
.filter((marbles) => marbles.subscribedFrame !== Infinity);
},
};
}
flush() {
const hotObservables = this.hotObservables;
while (hotObservables.length > 0) {
hotObservables.shift()!.setup();
}
super.flush();
this.flushTests = this.flushTests.filter((test) => {
if (test.ready) {
this.assertDeepEqual(test.actual, test.expected);
return false;
}
return true;
});
}
/** @nocollapse */
static parseMarblesAsSubscriptions(marbles: string | null, runMode = false): SubscriptionLog {
if (typeof marbles !== 'string') {
return new SubscriptionLog(Infinity);
}
// Spreading the marbles into an array leverages ES2015's support for emoji
// characters when iterating strings.
const characters = [...marbles];
const len = characters.length;
let groupStart = -1;
let subscriptionFrame = Infinity;
let unsubscriptionFrame = Infinity;
let frame = 0;
for (let i = 0; i < len; i++) {
let nextFrame = frame;
const advanceFrameBy = (count: number) => {
nextFrame += count * this.frameTimeFactor;
};
const c = characters[i];
switch (c) {
case ' ':
// Whitespace no longer advances time
if (!runMode) {
advanceFrameBy(1);
}
break;
case '-':
advanceFrameBy(1);
break;
case '(':
groupStart = frame;
advanceFrameBy(1);
break;
case ')':
groupStart = -1;
advanceFrameBy(1);
break;
case '^':
if (subscriptionFrame !== Infinity) {
throw new Error("found a second subscription point '^' in a " + 'subscription marble diagram. There can only be one.');
}
subscriptionFrame = groupStart > -1 ? groupStart : frame;
advanceFrameBy(1);
break;
case '!':
if (unsubscriptionFrame !== Infinity) {
throw new Error("found a second unsubscription point '!' in a " + 'subscription marble diagram. There can only be one.');
}
unsubscriptionFrame = groupStart > -1 ? groupStart : frame;
break;
default:
// time progression syntax
if (runMode && c.match(/^[0-9]$/)) {
// Time progression must be preceded by at least one space
// if it's not at the beginning of the diagram
if (i === 0 || characters[i - 1] === ' ') {
const buffer = characters.slice(i).join('');
const match = buffer.match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);
if (match) {
i += match[0].length - 1;
const duration = parseFloat(match[1]);
const unit = match[2];
let durationInMs: number;
switch (unit) {
case 'ms':
durationInMs = duration;
break;
case 's':
durationInMs = duration * 1000;
break;
case 'm':
durationInMs = duration * 1000 * 60;
break;
default:
break;
}
advanceFrameBy(durationInMs! / this.frameTimeFactor);
break;
}
}
}
throw new Error("there can only be '^' and '!' markers in a " + "subscription marble diagram. Found instead '" + c + "'.");
}
frame = nextFrame;
}
if (unsubscriptionFrame < 0) {
return new SubscriptionLog(subscriptionFrame);
} else {
return new SubscriptionLog(subscriptionFrame, unsubscriptionFrame);
}
}
/** @nocollapse */
static parseMarbles(
marbles: string,
values?: any,
errorValue?: any,
materializeInnerObservables: boolean = false,
runMode = false
): TestMessage[] {
if (marbles.indexOf('!') !== -1) {
throw new Error('conventional marble diagrams cannot have the ' + 'unsubscription marker "!"');
}
// Spreading the marbles into an array leverages ES2015's support for emoji
// characters when iterating strings.
const characters = [...marbles];
const len = characters.length;
const testMessages: TestMessage[] = [];
const subIndex = runMode ? marbles.replace(/^[ ]+/, '').indexOf('^') : marbles.indexOf('^');
let frame = subIndex === -1 ? 0 : subIndex * -this.frameTimeFactor;
const getValue =
typeof values !== 'object'
? (x: any) => x
: (x: any) => {
// Support Observable-of-Observables
if (materializeInnerObservables && values[x] instanceof ColdObservable) {
return values[x].messages;
}
return values[x];
};
let groupStart = -1;
for (let i = 0; i < len; i++) {
let nextFrame = frame;
const advanceFrameBy = (count: number) => {
nextFrame += count * this.frameTimeFactor;
};
let notification: ObservableNotification<any> | undefined;
const c = characters[i];
switch (c) {
case ' ':
// Whitespace no longer advances time
if (!runMode) {
advanceFrameBy(1);
}
break;
case '-':
advanceFrameBy(1);
break;
case '(':
groupStart = frame;
advanceFrameBy(1);
break;
case ')':
groupStart = -1;
advanceFrameBy(1);
break;
case '|':
notification = COMPLETE_NOTIFICATION;
advanceFrameBy(1);
break;
case '^':
advanceFrameBy(1);
break;
case '#':
notification = errorNotification(errorValue || 'error');
advanceFrameBy(1);
break;
default:
// Might be time progression syntax, or a value literal
if (runMode && c.match(/^[0-9]$/)) {
// Time progression must be preceded by at least one space
// if it's not at the beginning of the diagram
if (i === 0 || characters[i - 1] === ' ') {
const buffer = characters.slice(i).join('');
const match = buffer.match(/^([0-9]+(?:\.[0-9]+)?)(ms|s|m) /);
if (match) {
i += match[0].length - 1;
const duration = parseFloat(match[1]);
const unit = match[2];
let durationInMs: number;
switch (unit) {
case 'ms':
durationInMs = duration;
break;
case 's':
durationInMs = duration * 1000;
break;
case 'm':
durationInMs = duration * 1000 * 60;
break;
default:
break;
}
advanceFrameBy(durationInMs! / this.frameTimeFactor);
break;
}
}
}
notification = nextNotification(getValue(c));
advanceFrameBy(1);
break;
}
if (notification) {
testMessages.push({ frame: groupStart > -1 ? groupStart : frame, notification });
}
frame = nextFrame;
}
return testMessages;
}
private createAnimator() {
if (!this.runMode) {
throw new Error('animate() must only be used in run mode');
}
// The TestScheduler assigns a delegate to the provider that's used for
// requestAnimationFrame (rAF). The delegate works in conjunction with the
// animate run helper to coordinate the invocation of any rAF callbacks,
// that are effected within tests, with the animation frames specified by
// the test's author - in the marbles that are passed to the animate run
// helper. This allows the test's author to write deterministic tests and
// gives the author full control over when - or if - animation frames are
// 'painted'.
let lastHandle = 0;
let map: Map<number, FrameRequestCallback> | undefined;
const delegate = {
requestAnimationFrame(callback: FrameRequestCallback) {
if (!map) {
throw new Error('animate() was not called within run()');
}
const handle = ++lastHandle;
map.set(handle, callback);
return handle;
},
cancelAnimationFrame(handle: number) {
if (!map) {
throw new Error('animate() was not called within run()');
}
map.delete(handle);
},
};
const animate = (marbles: string) => {
if (map) {
throw new Error('animate() must not be called more than once within run()');
}
if (/[|#]/.test(marbles)) {
throw new Error('animate() must not complete or error');
}
map = new Map<number, FrameRequestCallback>();
const messages = TestScheduler.parseMarbles(marbles, undefined, undefined, undefined, true);
for (const message of messages) {
this.schedule(() => {
const now = this.now();
// Capture the callbacks within the queue and clear the queue
// before enumerating the callbacks, as callbacks might
// reschedule themselves. (And, yeah, we're using a Map to represent
// the queue, but the values are guaranteed to be returned in
// insertion order, so it's all good. Trust me, I've read the docs.)
const callbacks = Array.from(map!.values());
map!.clear();
for (const callback of callbacks) {
callback(now);
}
}, message.frame);
}
};
return { animate, delegate };
}
private createDelegates() {
// When in run mode, the TestScheduler provides alternate implementations
// of set/clearImmediate and set/clearInterval. These implementations are
// consumed by the scheduler implementations via the providers. This is
// done to effect deterministic asap and async scheduler behavior so that
// all of the schedulers are testable in 'run mode'. Prior to v7,
// delegation occurred at the scheduler level. That is, the asap and
// animation frame schedulers were identical in behavior to the async
// scheduler. Now, when in run mode, asap actions are prioritized over
// async actions and animation frame actions are coordinated using the
// animate run helper.
let lastHandle = 0;
const scheduleLookup = new Map<
TimerHandle,
{
due: number;
duration: number;
handle: TimerHandle;
handler: () => void;
subscription: Subscription;
type: 'immediate' | 'interval' | 'timeout';
}
>();
const run = () => {
// Whenever a scheduled run is executed, it must run a single immediate
// or interval action - with immediate actions being prioritized over
// interval and timeout actions.
const now = this.now();
const scheduledRecords = Array.from(scheduleLookup.values());
const scheduledRecordsDue = scheduledRecords.filter(({ due }) => due <= now);
const dueImmediates = scheduledRecordsDue.filter(({ type }) => type === 'immediate');
if (dueImmediates.length > 0) {
const { handle, handler } = dueImmediates[0];
scheduleLookup.delete(handle);
handler();
return;
}
const dueIntervals = scheduledRecordsDue.filter(({ type }) => type === 'interval');
if (dueIntervals.length > 0) {
const firstDueInterval = dueIntervals[0];
const { duration, handler } = firstDueInterval;
firstDueInterval.due = now + duration;
// The interval delegate must behave like setInterval, so run needs to
// be rescheduled. This will continue until the clearInterval delegate
// unsubscribes and deletes the handle from the map.
firstDueInterval.subscription = this.schedule(run, duration);
handler();
return;
}
const dueTimeouts = scheduledRecordsDue.filter(({ type }) => type === 'timeout');
if (dueTimeouts.length > 0) {
const { handle, handler } = dueTimeouts[0];
scheduleLookup.delete(handle);
handler();
return;
}
throw new Error('Expected a due immediate or interval');
};
// The following objects are the delegates that replace conventional
// runtime implementations with TestScheduler implementations.
//
// The immediate delegate is depended upon by the asapScheduler.
//
// The interval delegate is depended upon by the asyncScheduler.
//
// The timeout delegate is not depended upon by any scheduler, but it's
// included here because the onUnhandledError and onStoppedNotification
// configuration points use setTimeout to avoid producer interference. It's
// inclusion allows for the testing of these configuration points.
const immediate = {
setImmediate: (handler: () => void) => {
const handle = ++lastHandle;
scheduleLookup.set(handle, {
due: this.now(),
duration: 0,
handle,
handler,
subscription: this.schedule(run, 0),
type: 'immediate',
});
return handle;
},
clearImmediate: (handle: TimerHandle) => {
const value = scheduleLookup.get(handle);
if (value) {
value.subscription.unsubscribe();
scheduleLookup.delete(handle);
}
},
};
const interval = {
setInterval: (handler: () => void, duration = 0) => {
const handle = ++lastHandle;
scheduleLookup.set(handle, {
due: this.now() + duration,
duration,
handle,
handler,
subscription: this.schedule(run, duration),
type: 'interval',
});
return handle;
},
clearInterval: (handle: TimerHandle) => {
const value = scheduleLookup.get(handle);
if (value) {
value.subscription.unsubscribe();
scheduleLookup.delete(handle);
}
},
};
const timeout = {
setTimeout: (handler: () => void, duration = 0) => {
const handle = ++lastHandle;
scheduleLookup.set(handle, {
due: this.now() + duration,
duration,
handle,
handler,
subscription: this.schedule(run, duration),
type: 'timeout',
});
return handle;
},
clearTimeout: (handle: TimerHandle) => {
const value = scheduleLookup.get(handle);
if (value) {
value.subscription.unsubscribe();
scheduleLookup.delete(handle);
}
},
};
return { immediate, interval, timeout };
}
/**
* The `run` method performs the test in 'run mode' - in which schedulers
* used within the test automatically delegate to the `TestScheduler`. That
* is, in 'run mode' there is no need to explicitly pass a `TestScheduler`
* instance to observable creators or operators.
*
* @see {@link /guide/testing/marble-testing}
*/
run<T>(callback: (helpers: RunHelpers) => T): T {
const prevFrameTimeFactor = TestScheduler.frameTimeFactor;
const prevMaxFrames = this.maxFrames;
TestScheduler.frameTimeFactor = 1;
this.maxFrames = Infinity;
this.runMode = true;
const animator = this.createAnimator();
const delegates = this.createDelegates();
animationFrameProvider.delegate = animator.delegate;
dateTimestampProvider.delegate = this;
immediateProvider.delegate = delegates.immediate;
intervalProvider.delegate = delegates.interval;
timeoutProvider.delegate = delegates.timeout;
performanceTimestampProvider.delegate = this;
const helpers: RunHelpers = {
cold: this.createColdObservable.bind(this),
hot: this.createHotObservable.bind(this),
flush: this.flush.bind(this),
time: this.createTime.bind(this),
expectObservable: this.expectObservable.bind(this),
expectSubscriptions: this.expectSubscriptions.bind(this),
animate: animator.animate,
};
try {
const ret = callback(helpers);
this.flush();
return ret;
} finally {
TestScheduler.frameTimeFactor = prevFrameTimeFactor;
this.maxFrames = prevMaxFrames;
this.runMode = false;
animationFrameProvider.delegate = undefined;
dateTimestampProvider.delegate = undefined;
immediateProvider.delegate = undefined;
intervalProvider.delegate = undefined;
timeoutProvider.delegate = undefined;
performanceTimestampProvider.delegate = undefined;
}
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"pairwise.js","sourceRoot":"","sources":["../../../../src/internal/operators/pairwise.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AA6ChE,MAAM,UAAU,QAAQ;IACtB,OAAO,OAAO,CAAC,UAAC,MAAM,EAAE,UAAU;QAChC,IAAI,IAAO,CAAC;QACZ,IAAI,OAAO,GAAG,KAAK,CAAC;QACpB,MAAM,CAAC,SAAS,CACd,wBAAwB,CAAC,UAAU,EAAE,UAAC,KAAK;YACzC,IAAM,CAAC,GAAG,IAAI,CAAC;YACf,IAAI,GAAG,KAAK,CAAC;YACb,OAAO,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;YACvC,OAAO,GAAG,IAAI,CAAC;QACjB,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"shExpMatch.js","sourceRoot":"","sources":["../src/shExpMatch.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;;AAEH,SAAwB,UAAU,CAAC,GAAW,EAAE,KAAa;IAC5D,MAAM,EAAE,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC3B,OAAO,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACrB,CAAC;AAHD,6BAGC;AAED;;;;GAIG;AAEH,SAAS,QAAQ,CAAC,GAAW;IAC5B,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;SACf,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACvB,OAAO,IAAI,MAAM,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;AAC/B,CAAC"}

View File

@@ -0,0 +1 @@
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0.01292,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0.01722,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0.00861,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0.00861,"79":0,"80":0,"81":0,"82":0.00431,"83":0,"84":0.03014,"85":0,"86":0,"87":0,"88":0.00431,"89":0,"90":0,"91":0.01292,"92":0,"93":0,"94":0,"95":0.00431,"96":0,"97":0,"98":0,"99":0.00861,"100":0.00431,"101":0,"102":0.03444,"103":0.01292,"104":0.07749,"105":0.00431,"106":0.00861,"107":0.01292,"108":0.01292,"109":0.52521,"110":0.50799,"111":0,"112":0,"3.5":0,"3.6":0},D:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0.02153,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0.00431,"66":0,"67":0.00431,"68":0.00431,"69":0,"70":0.00431,"71":0,"72":0,"73":0,"74":0.00861,"75":0.00431,"76":0.00861,"77":0,"78":0,"79":0.04305,"80":0.01292,"81":0.00861,"83":0,"84":0.00861,"85":0.00431,"86":0.00431,"87":0.01722,"88":0.00861,"89":0.00431,"90":0.00431,"91":0.06458,"92":0.02153,"93":0.03014,"94":0.00861,"95":0.00431,"96":0.01292,"97":0.01722,"98":0.00431,"99":0.00861,"100":0.02583,"101":0.03875,"102":0.03444,"103":0.06027,"104":0.02583,"105":0.03014,"106":0.04305,"107":0.06458,"108":0.26261,"109":6.65123,"110":5.46735,"111":0.00431,"112":0,"113":0},F:{"9":0,"11":0,"12":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0.00431,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"60":0,"62":0.00431,"63":0,"64":0,"65":0,"66":0.00431,"67":0.03014,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.04736,"94":0.46925,"95":0.21525,"9.5-9.6":0,"10.0-10.1":0,"10.5":0,"10.6":0,"11.1":0,"11.5":0,"11.6":0,"12.1":0},B:{"12":0,"13":0,"14":0.00431,"15":0.00861,"16":0,"17":0,"18":0.01292,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0.00431,"91":0,"92":0.00861,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0.00431,"99":0,"100":0.00431,"101":0.00431,"102":0.00431,"103":0.00431,"104":0.00431,"105":0.00861,"106":0.01292,"107":0.02153,"108":0.04305,"109":0.58979,"110":1.0289},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0.00861,"15":0.00431,_:"0","3.1":0,"3.2":0,"5.1":0.00431,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0.00431,"13.1":0.01722,"14.1":0.03444,"15.1":0.00431,"15.2-15.3":0.00431,"15.4":0.01292,"15.5":0.01292,"15.6":0.0861,"16.0":0.01292,"16.1":0.04736,"16.2":0.0861,"16.3":0.06888,"16.4":0},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0.00325,"6.0-6.1":0.03796,"7.0-7.1":0.00759,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.02928,"10.0-10.2":0,"10.3":0.0282,"11.0-11.2":0.01193,"11.3-11.4":0.00108,"12.0-12.1":0.00217,"12.2-12.5":0.26136,"13.0-13.1":0.00542,"13.2":0.00542,"13.3":0.01084,"13.4-13.7":0.04121,"14.0-14.4":0.15616,"14.5-14.8":0.27003,"15.0-15.1":0.05422,"15.2-15.3":0.07917,"15.4":0.07591,"15.5":0.20605,"15.6":0.80468,"16.0":1.07145,"16.1":2.29473,"16.2":2.86408,"16.3":1.61803,"16.4":0.01301},P:{"4":0.09186,"20":0.888,"5.0-5.4":0.01021,"6.2-6.4":0,"7.2-7.4":0.13269,"8.2":0,"9.2":0.01021,"10.1":0,"11.1-11.2":0.05103,"12.0":0.01021,"13.0":0.11228,"14.0":0.05103,"15.0":0.03062,"16.0":0.1531,"17.0":0.05103,"18.0":0.06124,"19.0":1.24524},I:{"0":0,"3":0,"4":0.01381,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.01381,"4.4":0,"4.4.3-4.4.4":0.20722},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.01292,"5.5":0},N:{"10":0,"11":0},S:{"2.5":0.0057,_:"3.0-3.1"},J:{"7":0,"10":0},O:{"0":0.1196},H:{"0":0.32889},L:{"0":67.23856},R:{_:"0"},M:{"0":0.23919},Q:{"13.1":0}};

View File

@@ -0,0 +1,66 @@
'use strict'
const max = 1000000
const fastqueue = require('./')(worker, 1)
const { promisify } = require('util')
const immediate = promisify(setImmediate)
const qPromise = require('./').promise(immediate, 1)
const async = require('async')
const neo = require('neo-async')
const asyncqueue = async.queue(worker, 1)
const neoqueue = neo.queue(worker, 1)
function bench (func, done) {
const key = max + '*' + func.name
let count = -1
console.time(key)
end()
function end () {
if (++count < max) {
func(end)
} else {
console.timeEnd(key)
if (done) {
done()
}
}
}
}
function benchFastQ (done) {
fastqueue.push(42, done)
}
function benchAsyncQueue (done) {
asyncqueue.push(42, done)
}
function benchNeoQueue (done) {
neoqueue.push(42, done)
}
function worker (arg, cb) {
setImmediate(cb)
}
function benchSetImmediate (cb) {
worker(42, cb)
}
function benchFastQPromise (done) {
qPromise.push(42).then(function () { done() }, done)
}
function runBench (done) {
async.eachSeries([
benchSetImmediate,
benchFastQ,
benchNeoQueue,
benchAsyncQueue,
benchFastQPromise
], bench, done)
}
runBench(runBench)

View File

@@ -0,0 +1,27 @@
import { Subject } from '../Subject';
import { Observable } from '../Observable';
import { defer } from './defer';
var DEFAULT_CONFIG = {
connector: function () { return new Subject(); },
resetOnDisconnect: true,
};
export function connectable(source, config) {
if (config === void 0) { config = DEFAULT_CONFIG; }
var connection = null;
var connector = config.connector, _a = config.resetOnDisconnect, resetOnDisconnect = _a === void 0 ? true : _a;
var subject = connector();
var result = new Observable(function (subscriber) {
return subject.subscribe(subscriber);
});
result.connect = function () {
if (!connection || connection.closed) {
connection = defer(function () { return source; }).subscribe(subject);
if (resetOnDisconnect) {
connection.add(function () { return (subject = connector()); });
}
}
return connection;
};
return result;
}
//# sourceMappingURL=connectable.js.map

View File

@@ -0,0 +1 @@
export default function get_name_from_filename(filename: string): string;

View File

@@ -0,0 +1 @@
{"name":"ssf","version":"0.11.2","files":{"LICENSE":{"checkedAt":1678883669142,"integrity":"sha512-/VFeII/+5npz5G1kUs+MtAHbKz20rL6aUK7WlNbjOzKDhRKB64Z+JLkI7TqiQQcuHrrwQi9nsxpXnTsCpIBloA==","mode":420,"size":11355},"ssf.flow.js":{"checkedAt":1678883669213,"integrity":"sha512-QqtcTt4e0uv+N3S5b20kxYKHA5EYVEr/6AX3sD253B2XUwnrYXxcts+ZcnfLD6hfK0IbMbWAnLe2wlWVhZP0aA==","mode":420,"size":40770},"ssf.js":{"checkedAt":1678883669217,"integrity":"sha512-NdV4XbtqRYftdGfR4SAR5vauT/9AEu2ncpFGk6JrjZYDDMFVKKk07gkZ53B9KhTr8NnCdxoo+b8HAOtyaHYodA==","mode":420,"size":38297},"package.json":{"checkedAt":1678883669217,"integrity":"sha512-eUrWy8T1rIiDWEW6mhHg98ZfWioZYtlsYtiyMfEXRjHYdeqxZSnEU4WEFktnz9ONs2cXMt4kTpxt91RTGRXQ0A==","mode":420,"size":969},"types/tsconfig.json":{"checkedAt":1678883669217,"integrity":"sha512-aE5Ta7h/0jttn2H1d5IhTgUWjUArshxcmLFaVSBvE/3VvAKG628v1s9WtmpTGF5wtZOvcA1GeJgZcvY2cdiVDw==","mode":420,"size":379},"types/index.d.ts":{"checkedAt":1678883669218,"integrity":"sha512-LponPdezMQWFkDykSyLzzicrNv6VeK/RsDL7rsKiHlreMsf2Qumeu/HtaYwobJWQRUVHoEFuLlfAGdomK2csQQ==","mode":420,"size":1532},"README.md":{"checkedAt":1678883669219,"integrity":"sha512-vcBi7YkbpTgQSQXJ3mvC6MUyZybCKyXpIBiIlHkboA5CQOCDIlrPr8yBWi9Av/M7lF74NySDCp5baZ77jCU94A==","mode":420,"size":4425}}}

View File

@@ -0,0 +1,5 @@
import { AsyncAction } from './AsyncAction';
import { AsyncScheduler } from './AsyncScheduler';
export const asyncScheduler = new AsyncScheduler(AsyncAction);
export const async = asyncScheduler;
//# sourceMappingURL=async.js.map

View File

@@ -0,0 +1,6 @@
'use strict';
const cliBoxes = require('./boxes.json');
module.exports = cliBoxes;
// TODO: Remove this for the next major release
module.exports.default = cliBoxes;

View File

@@ -0,0 +1,2 @@
declare function coerceToArrayLength(value: any): number | null;
export default coerceToArrayLength;

View File

@@ -0,0 +1,16 @@
var assocIndexOf = require('./_assocIndexOf');
/**
* Checks if a list cache value for `key` exists.
*
* @private
* @name has
* @memberOf ListCache
* @param {string} key The key of the entry to check.
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
*/
function listCacheHas(key) {
return assocIndexOf(this.__data__, key) > -1;
}
module.exports = listCacheHas;

View File

@@ -0,0 +1,34 @@
import { operate } from '../util/lift';
import { noop } from '../util/noop';
import { createOperatorSubscriber } from './OperatorSubscriber';
import { innerFrom } from '../observable/innerFrom';
export function debounce(durationSelector) {
return operate(function (source, subscriber) {
var hasValue = false;
var lastValue = null;
var durationSubscriber = null;
var emit = function () {
durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
durationSubscriber = null;
if (hasValue) {
hasValue = false;
var value = lastValue;
lastValue = null;
subscriber.next(value);
}
};
source.subscribe(createOperatorSubscriber(subscriber, function (value) {
durationSubscriber === null || durationSubscriber === void 0 ? void 0 : durationSubscriber.unsubscribe();
hasValue = true;
lastValue = value;
durationSubscriber = createOperatorSubscriber(subscriber, emit, noop);
innerFrom(durationSelector(value)).subscribe(durationSubscriber);
}, function () {
emit();
subscriber.complete();
}, undefined, function () {
lastValue = durationSubscriber = null;
}));
});
}
//# sourceMappingURL=debounce.js.map

View File

@@ -0,0 +1,18 @@
import { Observable } from '../Observable';
export function scheduleArray(input, scheduler) {
return new Observable(function (subscriber) {
var i = 0;
return scheduler.schedule(function () {
if (i === input.length) {
subscriber.complete();
}
else {
subscriber.next(input[i++]);
if (!subscriber.closed) {
this.schedule();
}
}
});
});
}
//# sourceMappingURL=scheduleArray.js.map

View File

@@ -0,0 +1,940 @@
export const VERSION: string;
export interface RollupError extends RollupLogProps {
parserError?: Error;
stack?: string;
watchFiles?: string[];
}
export interface RollupWarning extends RollupLogProps {
chunkName?: string;
cycle?: string[];
exportName?: string;
exporter?: string;
guess?: string;
importer?: string;
missing?: string;
modules?: string[];
names?: string[];
reexporter?: string;
source?: string;
sources?: string[];
}
export interface RollupLogProps {
code?: string;
frame?: string;
hook?: string;
id?: string;
loc?: {
column: number;
file?: string;
line: number;
};
message: string;
name?: string;
plugin?: string;
pluginCode?: string;
pos?: number;
url?: string;
}
export type SourceMapSegment =
| [number]
| [number, number, number, number]
| [number, number, number, number, number];
export interface ExistingDecodedSourceMap {
file?: string;
mappings: SourceMapSegment[][];
names: string[];
sourceRoot?: string;
sources: string[];
sourcesContent?: string[];
version: number;
}
export interface ExistingRawSourceMap {
file?: string;
mappings: string;
names: string[];
sourceRoot?: string;
sources: string[];
sourcesContent?: string[];
version: number;
}
export type DecodedSourceMapOrMissing =
| {
mappings?: never;
missing: true;
plugin: string;
}
| ExistingDecodedSourceMap;
export interface SourceMap {
file: string;
mappings: string;
names: string[];
sources: string[];
sourcesContent: string[];
version: number;
toString(): string;
toUrl(): string;
}
export type SourceMapInput = ExistingRawSourceMap | string | null | { mappings: '' };
type PartialNull<T> = {
[P in keyof T]: T[P] | null;
};
interface ModuleOptions {
meta: CustomPluginOptions;
moduleSideEffects: boolean | 'no-treeshake';
syntheticNamedExports: boolean | string;
}
export interface SourceDescription extends Partial<PartialNull<ModuleOptions>> {
ast?: AcornNode;
code: string;
map?: SourceMapInput;
}
export interface TransformModuleJSON {
ast?: AcornNode;
code: string;
// note if plugins use new this.cache to opt-out auto transform cache
customTransformCache: boolean;
originalCode: string;
originalSourcemap: ExistingDecodedSourceMap | null;
sourcemapChain: DecodedSourceMapOrMissing[];
transformDependencies: string[];
}
export interface ModuleJSON extends TransformModuleJSON, ModuleOptions {
ast: AcornNode;
dependencies: string[];
id: string;
resolvedIds: ResolvedIdMap;
transformFiles: EmittedFile[] | undefined;
}
export interface PluginCache {
delete(id: string): boolean;
get<T = any>(id: string): T;
has(id: string): boolean;
set<T = any>(id: string, value: T): void;
}
export interface MinimalPluginContext {
meta: PluginContextMeta;
}
export interface EmittedAsset {
fileName?: string;
name?: string;
source?: string | Uint8Array;
type: 'asset';
}
export interface EmittedChunk {
fileName?: string;
id: string;
implicitlyLoadedAfterOneOf?: string[];
importer?: string;
name?: string;
preserveSignature?: PreserveEntrySignaturesOption;
type: 'chunk';
}
export type EmittedFile = EmittedAsset | EmittedChunk;
export type EmitAsset = (name: string, source?: string | Uint8Array) => string;
export type EmitChunk = (id: string, options?: { name?: string }) => string;
export type EmitFile = (emittedFile: EmittedFile) => string;
interface ModuleInfo extends ModuleOptions {
ast: AcornNode | null;
code: string | null;
dynamicImporters: readonly string[];
dynamicallyImportedIdResolutions: readonly ResolvedId[];
dynamicallyImportedIds: readonly string[];
hasDefaultExport: boolean | null;
/** @deprecated Use `moduleSideEffects` instead */
hasModuleSideEffects: boolean | 'no-treeshake';
id: string;
implicitlyLoadedAfterOneOf: readonly string[];
implicitlyLoadedBefore: readonly string[];
importedIdResolutions: readonly ResolvedId[];
importedIds: readonly string[];
importers: readonly string[];
isEntry: boolean;
isExternal: boolean;
isIncluded: boolean | null;
}
export type GetModuleInfo = (moduleId: string) => ModuleInfo | null;
export interface CustomPluginOptions {
[plugin: string]: any;
}
export interface PluginContext extends MinimalPluginContext {
addWatchFile: (id: string) => void;
cache: PluginCache;
/** @deprecated Use `this.emitFile` instead */
emitAsset: EmitAsset;
/** @deprecated Use `this.emitFile` instead */
emitChunk: EmitChunk;
emitFile: EmitFile;
error: (err: RollupError | string, pos?: number | { column: number; line: number }) => never;
/** @deprecated Use `this.getFileName` instead */
getAssetFileName: (assetReferenceId: string) => string;
/** @deprecated Use `this.getFileName` instead */
getChunkFileName: (chunkReferenceId: string) => string;
getFileName: (fileReferenceId: string) => string;
getModuleIds: () => IterableIterator<string>;
getModuleInfo: GetModuleInfo;
getWatchFiles: () => string[];
/** @deprecated Use `this.resolve` instead */
isExternal: IsExternal;
load: (
options: { id: string; resolveDependencies?: boolean } & Partial<PartialNull<ModuleOptions>>
) => Promise<ModuleInfo>;
/** @deprecated Use `this.getModuleIds` instead */
moduleIds: IterableIterator<string>;
parse: (input: string, options?: any) => AcornNode;
resolve: (
source: string,
importer?: string,
options?: { custom?: CustomPluginOptions; isEntry?: boolean; skipSelf?: boolean }
) => Promise<ResolvedId | null>;
/** @deprecated Use `this.resolve` instead */
resolveId: (source: string, importer?: string) => Promise<string | null>;
setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
warn: (warning: RollupWarning | string, pos?: number | { column: number; line: number }) => void;
}
export interface PluginContextMeta {
rollupVersion: string;
watchMode: boolean;
}
export interface ResolvedId extends ModuleOptions {
external: boolean | 'absolute';
id: string;
}
export interface ResolvedIdMap {
[key: string]: ResolvedId;
}
interface PartialResolvedId extends Partial<PartialNull<ModuleOptions>> {
external?: boolean | 'absolute' | 'relative';
id: string;
}
export type ResolveIdResult = string | false | null | void | PartialResolvedId;
export type ResolveIdHook = (
this: PluginContext,
source: string,
importer: string | undefined,
options: { custom?: CustomPluginOptions; isEntry: boolean }
) => ResolveIdResult;
export type ShouldTransformCachedModuleHook = (
this: PluginContext,
options: {
ast: AcornNode;
code: string;
id: string;
meta: CustomPluginOptions;
moduleSideEffects: boolean | 'no-treeshake';
resolvedSources: ResolvedIdMap;
syntheticNamedExports: boolean | string;
}
) => boolean;
export type IsExternal = (
source: string,
importer: string | undefined,
isResolved: boolean
) => boolean;
export type IsPureModule = (id: string) => boolean | null | void;
export type HasModuleSideEffects = (id: string, external: boolean) => boolean;
export type LoadResult = SourceDescription | string | null | void;
export type LoadHook = (this: PluginContext, id: string) => LoadResult;
export interface TransformPluginContext extends PluginContext {
getCombinedSourcemap: () => SourceMap;
}
export type TransformResult = string | null | void | Partial<SourceDescription>;
export type TransformHook = (
this: TransformPluginContext,
code: string,
id: string
) => TransformResult;
export type ModuleParsedHook = (this: PluginContext, info: ModuleInfo) => void;
export type RenderChunkHook = (
this: PluginContext,
code: string,
chunk: RenderedChunk,
options: NormalizedOutputOptions
) => { code: string; map?: SourceMapInput } | string | null | undefined;
export type ResolveDynamicImportHook = (
this: PluginContext,
specifier: string | AcornNode,
importer: string
) => ResolveIdResult;
export type ResolveImportMetaHook = (
this: PluginContext,
prop: string | null,
options: { chunkId: string; format: InternalModuleFormat; moduleId: string }
) => string | null | void;
export type ResolveAssetUrlHook = (
this: PluginContext,
options: {
assetFileName: string;
chunkId: string;
format: InternalModuleFormat;
moduleId: string;
relativeAssetPath: string;
}
) => string | null | void;
export type ResolveFileUrlHook = (
this: PluginContext,
options: {
assetReferenceId: string | null;
chunkId: string;
chunkReferenceId: string | null;
fileName: string;
format: InternalModuleFormat;
moduleId: string;
referenceId: string;
relativePath: string;
}
) => string | null | void;
export type AddonHookFunction = (this: PluginContext) => string | Promise<string>;
export type AddonHook = string | AddonHookFunction;
export type ChangeEvent = 'create' | 'update' | 'delete';
export type WatchChangeHook = (
this: PluginContext,
id: string,
change: { event: ChangeEvent }
) => void;
/**
* use this type for plugin annotation
* @example
* ```ts
* interface Options {
* ...
* }
* const myPlugin: PluginImpl<Options> = (options = {}) => { ... }
* ```
*/
// eslint-disable-next-line @typescript-eslint/ban-types
export type PluginImpl<O extends object = object> = (options?: O) => Plugin;
export interface OutputBundle {
[fileName: string]: OutputAsset | OutputChunk;
}
export interface FunctionPluginHooks {
augmentChunkHash: (this: PluginContext, chunk: PreRenderedChunk) => string | void;
buildEnd: (this: PluginContext, err?: Error) => void;
buildStart: (this: PluginContext, options: NormalizedInputOptions) => void;
closeBundle: (this: PluginContext) => void;
closeWatcher: (this: PluginContext) => void;
generateBundle: (
this: PluginContext,
options: NormalizedOutputOptions,
bundle: OutputBundle,
isWrite: boolean
) => void;
load: LoadHook;
moduleParsed: ModuleParsedHook;
options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | null | void;
outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | null | void;
renderChunk: RenderChunkHook;
renderDynamicImport: (
this: PluginContext,
options: {
customResolution: string | null;
format: InternalModuleFormat;
moduleId: string;
targetModuleId: string | null;
}
) => { left: string; right: string } | null | void;
renderError: (this: PluginContext, err?: Error) => void;
renderStart: (
this: PluginContext,
outputOptions: NormalizedOutputOptions,
inputOptions: NormalizedInputOptions
) => void;
/** @deprecated Use `resolveFileUrl` instead */
resolveAssetUrl: ResolveAssetUrlHook;
resolveDynamicImport: ResolveDynamicImportHook;
resolveFileUrl: ResolveFileUrlHook;
resolveId: ResolveIdHook;
resolveImportMeta: ResolveImportMetaHook;
shouldTransformCachedModule: ShouldTransformCachedModuleHook;
transform: TransformHook;
watchChange: WatchChangeHook;
writeBundle: (
this: PluginContext,
options: NormalizedOutputOptions,
bundle: OutputBundle
) => void;
}
export type OutputPluginHooks =
| 'augmentChunkHash'
| 'generateBundle'
| 'outputOptions'
| 'renderChunk'
| 'renderDynamicImport'
| 'renderError'
| 'renderStart'
| 'resolveAssetUrl'
| 'resolveFileUrl'
| 'resolveImportMeta'
| 'writeBundle';
export type InputPluginHooks = Exclude<keyof FunctionPluginHooks, OutputPluginHooks>;
export type SyncPluginHooks =
| 'augmentChunkHash'
| 'outputOptions'
| 'renderDynamicImport'
| 'resolveAssetUrl'
| 'resolveFileUrl'
| 'resolveImportMeta';
export type AsyncPluginHooks = Exclude<keyof FunctionPluginHooks, SyncPluginHooks>;
export type FirstPluginHooks =
| 'load'
| 'renderDynamicImport'
| 'resolveAssetUrl'
| 'resolveDynamicImport'
| 'resolveFileUrl'
| 'resolveId'
| 'resolveImportMeta'
| 'shouldTransformCachedModule';
export type SequentialPluginHooks =
| 'augmentChunkHash'
| 'generateBundle'
| 'options'
| 'outputOptions'
| 'renderChunk'
| 'transform';
export type ParallelPluginHooks = Exclude<
keyof FunctionPluginHooks | AddonHooks,
FirstPluginHooks | SequentialPluginHooks
>;
export type AddonHooks = 'banner' | 'footer' | 'intro' | 'outro';
type MakeAsync<Fn> = Fn extends (this: infer This, ...args: infer Args) => infer Return
? (this: This, ...args: Args) => Return | Promise<Return>
: never;
// eslint-disable-next-line @typescript-eslint/ban-types
type ObjectHook<T, O = {}> = T | ({ handler: T; order?: 'pre' | 'post' | null } & O);
export type PluginHooks = {
[K in keyof FunctionPluginHooks]: ObjectHook<
K extends AsyncPluginHooks ? MakeAsync<FunctionPluginHooks[K]> : FunctionPluginHooks[K],
// eslint-disable-next-line @typescript-eslint/ban-types
K extends ParallelPluginHooks ? { sequential?: boolean } : {}
>;
};
export interface OutputPlugin
extends Partial<{ [K in OutputPluginHooks]: PluginHooks[K] }>,
Partial<{ [K in AddonHooks]: ObjectHook<AddonHook> }> {
cacheKey?: string;
name: string;
}
export interface Plugin extends OutputPlugin, Partial<PluginHooks> {
// for inter-plugin communication
api?: any;
}
type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
export interface NormalizedTreeshakingOptions {
annotations: boolean;
correctVarValueBeforeDeclaration: boolean;
moduleSideEffects: HasModuleSideEffects;
propertyReadSideEffects: boolean | 'always';
tryCatchDeoptimization: boolean;
unknownGlobalSideEffects: boolean;
}
export interface TreeshakingOptions
extends Partial<Omit<NormalizedTreeshakingOptions, 'moduleSideEffects'>> {
moduleSideEffects?: ModuleSideEffectsOption;
preset?: TreeshakingPreset;
/** @deprecated Use `moduleSideEffects` instead */
pureExternalModules?: PureModulesOption;
}
interface GetManualChunkApi {
getModuleIds: () => IterableIterator<string>;
getModuleInfo: GetModuleInfo;
}
export type GetManualChunk = (id: string, api: GetManualChunkApi) => string | null | void;
export type ExternalOption =
| (string | RegExp)[]
| string
| RegExp
| ((source: string, importer: string | undefined, isResolved: boolean) => boolean | null | void);
export type PureModulesOption = boolean | string[] | IsPureModule;
export type GlobalsOption = { [name: string]: string } | ((name: string) => string);
export type InputOption = string | string[] | { [entryAlias: string]: string };
export type ManualChunksOption = { [chunkAlias: string]: string[] } | GetManualChunk;
export type ModuleSideEffectsOption = boolean | 'no-external' | string[] | HasModuleSideEffects;
export type PreserveEntrySignaturesOption = false | 'strict' | 'allow-extension' | 'exports-only';
export type SourcemapPathTransformOption = (
relativeSourcePath: string,
sourcemapPath: string
) => string;
export interface InputOptions {
acorn?: Record<string, unknown>;
acornInjectPlugins?: (() => unknown)[] | (() => unknown);
cache?: false | RollupCache;
context?: string;
experimentalCacheExpiry?: number;
external?: ExternalOption;
/** @deprecated Use the "inlineDynamicImports" output option instead. */
inlineDynamicImports?: boolean;
input?: InputOption;
makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource';
/** @deprecated Use the "manualChunks" output option instead. */
manualChunks?: ManualChunksOption;
maxParallelFileOps?: number;
/** @deprecated Use the "maxParallelFileOps" option instead. */
maxParallelFileReads?: number;
moduleContext?: ((id: string) => string | null | void) | { [id: string]: string };
onwarn?: WarningHandlerWithDefault;
perf?: boolean;
plugins?: (Plugin | null | false | undefined)[];
preserveEntrySignatures?: PreserveEntrySignaturesOption;
/** @deprecated Use the "preserveModules" output option instead. */
preserveModules?: boolean;
preserveSymlinks?: boolean;
shimMissingExports?: boolean;
strictDeprecations?: boolean;
treeshake?: boolean | TreeshakingPreset | TreeshakingOptions;
watch?: WatcherOptions | false;
}
export interface NormalizedInputOptions {
acorn: Record<string, unknown>;
acornInjectPlugins: (() => unknown)[];
cache: false | undefined | RollupCache;
context: string;
experimentalCacheExpiry: number;
external: IsExternal;
/** @deprecated Use the "inlineDynamicImports" output option instead. */
inlineDynamicImports: boolean | undefined;
input: string[] | { [entryAlias: string]: string };
makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
/** @deprecated Use the "manualChunks" output option instead. */
manualChunks: ManualChunksOption | undefined;
maxParallelFileOps: number;
/** @deprecated Use the "maxParallelFileOps" option instead. */
maxParallelFileReads: number;
moduleContext: (id: string) => string;
onwarn: WarningHandler;
perf: boolean;
plugins: Plugin[];
preserveEntrySignatures: PreserveEntrySignaturesOption;
/** @deprecated Use the "preserveModules" output option instead. */
preserveModules: boolean | undefined;
preserveSymlinks: boolean;
shimMissingExports: boolean;
strictDeprecations: boolean;
treeshake: false | NormalizedTreeshakingOptions;
}
export type InternalModuleFormat = 'amd' | 'cjs' | 'es' | 'iife' | 'system' | 'umd';
export type ModuleFormat = InternalModuleFormat | 'commonjs' | 'esm' | 'module' | 'systemjs';
type GeneratedCodePreset = 'es5' | 'es2015';
interface NormalizedGeneratedCodeOptions {
arrowFunctions: boolean;
constBindings: boolean;
objectShorthand: boolean;
reservedNamesAsProps: boolean;
symbols: boolean;
}
interface GeneratedCodeOptions extends Partial<NormalizedGeneratedCodeOptions> {
preset?: GeneratedCodePreset;
}
export type OptionsPaths = Record<string, string> | ((id: string) => string);
export type InteropType = boolean | 'auto' | 'esModule' | 'default' | 'defaultOnly';
export type GetInterop = (id: string | null) => InteropType;
export type AmdOptions = (
| {
autoId?: false;
id: string;
}
| {
autoId: true;
basePath?: string;
id?: undefined;
}
| {
autoId?: false;
id?: undefined;
}
) & {
define?: string;
forceJsExtensionForImports?: boolean;
};
export type NormalizedAmdOptions = (
| {
autoId: false;
id?: string;
}
| {
autoId: true;
basePath: string;
}
) & {
define: string;
forceJsExtensionForImports: boolean;
};
export interface OutputOptions {
amd?: AmdOptions;
assetFileNames?: string | ((chunkInfo: PreRenderedAsset) => string);
banner?: string | (() => string | Promise<string>);
chunkFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
compact?: boolean;
// only required for bundle.write
dir?: string;
/** @deprecated Use the "renderDynamicImport" plugin hook instead. */
dynamicImportFunction?: string;
entryFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
esModule?: boolean;
exports?: 'default' | 'named' | 'none' | 'auto';
extend?: boolean;
externalLiveBindings?: boolean;
// only required for bundle.write
file?: string;
footer?: string | (() => string | Promise<string>);
format?: ModuleFormat;
freeze?: boolean;
generatedCode?: GeneratedCodePreset | GeneratedCodeOptions;
globals?: GlobalsOption;
hoistTransitiveImports?: boolean;
indent?: string | boolean;
inlineDynamicImports?: boolean;
interop?: InteropType | GetInterop;
intro?: string | (() => string | Promise<string>);
manualChunks?: ManualChunksOption;
minifyInternalExports?: boolean;
name?: string;
/** @deprecated Use "generatedCode.symbols" instead. */
namespaceToStringTag?: boolean;
noConflict?: boolean;
outro?: string | (() => string | Promise<string>);
paths?: OptionsPaths;
plugins?: (OutputPlugin | null | false | undefined)[];
/** @deprecated Use "generatedCode.constBindings" instead. */
preferConst?: boolean;
preserveModules?: boolean;
preserveModulesRoot?: string;
sanitizeFileName?: boolean | ((fileName: string) => string);
sourcemap?: boolean | 'inline' | 'hidden';
sourcemapBaseUrl?: string;
sourcemapExcludeSources?: boolean;
sourcemapFile?: string;
sourcemapPathTransform?: SourcemapPathTransformOption;
strict?: boolean;
systemNullSetters?: boolean;
validate?: boolean;
}
export interface NormalizedOutputOptions {
amd: NormalizedAmdOptions;
assetFileNames: string | ((chunkInfo: PreRenderedAsset) => string);
banner: () => string | Promise<string>;
chunkFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
compact: boolean;
dir: string | undefined;
/** @deprecated Use the "renderDynamicImport" plugin hook instead. */
dynamicImportFunction: string | undefined;
entryFileNames: string | ((chunkInfo: PreRenderedChunk) => string);
esModule: boolean;
exports: 'default' | 'named' | 'none' | 'auto';
extend: boolean;
externalLiveBindings: boolean;
file: string | undefined;
footer: () => string | Promise<string>;
format: InternalModuleFormat;
freeze: boolean;
generatedCode: NormalizedGeneratedCodeOptions;
globals: GlobalsOption;
hoistTransitiveImports: boolean;
indent: true | string;
inlineDynamicImports: boolean;
interop: GetInterop;
intro: () => string | Promise<string>;
manualChunks: ManualChunksOption;
minifyInternalExports: boolean;
name: string | undefined;
namespaceToStringTag: boolean;
noConflict: boolean;
outro: () => string | Promise<string>;
paths: OptionsPaths;
plugins: OutputPlugin[];
/** @deprecated Use the "renderDynamicImport" plugin hook instead. */
preferConst: boolean;
preserveModules: boolean;
preserveModulesRoot: string | undefined;
sanitizeFileName: (fileName: string) => string;
sourcemap: boolean | 'inline' | 'hidden';
sourcemapBaseUrl: string | undefined;
sourcemapExcludeSources: boolean;
sourcemapFile: string | undefined;
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
strict: boolean;
systemNullSetters: boolean;
validate: boolean;
}
export type WarningHandlerWithDefault = (
warning: RollupWarning,
defaultHandler: WarningHandler
) => void;
export type WarningHandler = (warning: RollupWarning) => void;
export interface SerializedTimings {
[label: string]: [number, number, number];
}
export interface PreRenderedAsset {
name: string | undefined;
source: string | Uint8Array;
type: 'asset';
}
export interface OutputAsset extends PreRenderedAsset {
fileName: string;
/** @deprecated Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead */
isAsset: true;
}
export interface RenderedModule {
code: string | null;
originalLength: number;
removedExports: string[];
renderedExports: string[];
renderedLength: number;
}
export interface PreRenderedChunk {
exports: string[];
facadeModuleId: string | null;
isDynamicEntry: boolean;
isEntry: boolean;
isImplicitEntry: boolean;
modules: {
[id: string]: RenderedModule;
};
name: string;
type: 'chunk';
}
export interface RenderedChunk extends PreRenderedChunk {
code?: string;
dynamicImports: string[];
fileName: string;
implicitlyLoadedBefore: string[];
importedBindings: {
[imported: string]: string[];
};
imports: string[];
map?: SourceMap;
referencedFiles: string[];
}
export interface OutputChunk extends RenderedChunk {
code: string;
}
export interface SerializablePluginCache {
[key: string]: [number, any];
}
export interface RollupCache {
modules: ModuleJSON[];
plugins?: Record<string, SerializablePluginCache>;
}
export interface RollupOutput {
output: [OutputChunk, ...(OutputChunk | OutputAsset)[]];
}
export interface RollupBuild {
cache: RollupCache | undefined;
close: () => Promise<void>;
closed: boolean;
generate: (outputOptions: OutputOptions) => Promise<RollupOutput>;
getTimings?: () => SerializedTimings;
watchFiles: string[];
write: (options: OutputOptions) => Promise<RollupOutput>;
}
export interface RollupOptions extends InputOptions {
// This is included for compatibility with config files but ignored by rollup.rollup
output?: OutputOptions | OutputOptions[];
}
export interface MergedRollupOptions extends InputOptions {
output: OutputOptions[];
}
export function rollup(options: RollupOptions): Promise<RollupBuild>;
export interface ChokidarOptions {
alwaysStat?: boolean;
atomic?: boolean | number;
awaitWriteFinish?:
| {
pollInterval?: number;
stabilityThreshold?: number;
}
| boolean;
binaryInterval?: number;
cwd?: string;
depth?: number;
disableGlobbing?: boolean;
followSymlinks?: boolean;
ignoreInitial?: boolean;
ignorePermissionErrors?: boolean;
ignored?: any;
interval?: number;
persistent?: boolean;
useFsEvents?: boolean;
usePolling?: boolean;
}
export type RollupWatchHooks = 'onError' | 'onStart' | 'onBundleStart' | 'onBundleEnd' | 'onEnd';
export interface WatcherOptions {
buildDelay?: number;
chokidar?: ChokidarOptions;
clearScreen?: boolean;
exclude?: string | RegExp | (string | RegExp)[];
include?: string | RegExp | (string | RegExp)[];
skipWrite?: boolean;
}
export interface RollupWatchOptions extends InputOptions {
output?: OutputOptions | OutputOptions[];
watch?: WatcherOptions | false;
}
interface TypedEventEmitter<T extends { [event: string]: (...args: any) => any }> {
addListener<K extends keyof T>(event: K, listener: T[K]): this;
emit<K extends keyof T>(event: K, ...args: Parameters<T[K]>): boolean;
eventNames(): Array<keyof T>;
getMaxListeners(): number;
listenerCount(type: keyof T): number;
listeners<K extends keyof T>(event: K): Array<T[K]>;
off<K extends keyof T>(event: K, listener: T[K]): this;
on<K extends keyof T>(event: K, listener: T[K]): this;
once<K extends keyof T>(event: K, listener: T[K]): this;
prependListener<K extends keyof T>(event: K, listener: T[K]): this;
prependOnceListener<K extends keyof T>(event: K, listener: T[K]): this;
rawListeners<K extends keyof T>(event: K): Array<T[K]>;
removeAllListeners<K extends keyof T>(event?: K): this;
removeListener<K extends keyof T>(event: K, listener: T[K]): this;
setMaxListeners(n: number): this;
}
export interface RollupAwaitingEmitter<T extends { [event: string]: (...args: any) => any }>
extends TypedEventEmitter<T> {
close(): Promise<void>;
emitAndAwait<K extends keyof T>(event: K, ...args: Parameters<T[K]>): Promise<ReturnType<T[K]>[]>;
/**
* Registers an event listener that will be awaited before Rollup continues
* for events emitted via emitAndAwait. All listeners will be awaited in
* parallel while rejections are tracked via Promise.all.
* Listeners are removed automatically when removeAwaited is called, which
* happens automatically after each run.
*/
onCurrentAwaited<K extends keyof T>(
event: K,
listener: (...args: Parameters<T[K]>) => Promise<ReturnType<T[K]>>
): this;
removeAwaited(): this;
}
export type RollupWatcherEvent =
| { code: 'START' }
| { code: 'BUNDLE_START'; input?: InputOption; output: readonly string[] }
| {
code: 'BUNDLE_END';
duration: number;
input?: InputOption;
output: readonly string[];
result: RollupBuild;
}
| { code: 'END' }
| { code: 'ERROR'; error: RollupError; result: RollupBuild | null };
export type RollupWatcher = RollupAwaitingEmitter<{
change: (id: string, change: { event: ChangeEvent }) => void;
close: () => void;
event: (event: RollupWatcherEvent) => void;
restart: () => void;
}>;
export function watch(config: RollupWatchOptions | RollupWatchOptions[]): RollupWatcher;
interface AcornNode {
end: number;
start: number;
type: string;
}
export function defineConfig(options: RollupOptions): RollupOptions;
export function defineConfig(options: RollupOptions[]): RollupOptions[];

View File

@@ -0,0 +1,38 @@
var isNumber = require('./isNumber');
/**
* Checks if `value` is `NaN`.
*
* **Note:** This method is based on
* [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as
* global [`isNaN`](https://mdn.io/isNaN) which returns `true` for
* `undefined` and other non-number values.
*
* @static
* @memberOf _
* @since 0.1.0
* @category Lang
* @param {*} value The value to check.
* @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
* @example
*
* _.isNaN(NaN);
* // => true
*
* _.isNaN(new Number(NaN));
* // => true
*
* isNaN(undefined);
* // => true
*
* _.isNaN(undefined);
* // => false
*/
function isNaN(value) {
// An `NaN` primitive is the only value that is not equal to itself.
// Perform the `toStringTag` check first to avoid errors with some
// ActiveX objects in IE.
return isNumber(value) && value != +value;
}
module.exports = isNaN;

View File

@@ -0,0 +1,47 @@
'use strict';
var bind = require('function-bind');
var GetIntrinsic = require('get-intrinsic');
var $apply = GetIntrinsic('%Function.prototype.apply%');
var $call = GetIntrinsic('%Function.prototype.call%');
var $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);
var $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);
var $defineProperty = GetIntrinsic('%Object.defineProperty%', true);
var $max = GetIntrinsic('%Math.max%');
if ($defineProperty) {
try {
$defineProperty({}, 'a', { value: 1 });
} catch (e) {
// IE 8 has a broken defineProperty
$defineProperty = null;
}
}
module.exports = function callBind(originalFunction) {
var func = $reflectApply(bind, $call, arguments);
if ($gOPD && $defineProperty) {
var desc = $gOPD(func, 'length');
if (desc.configurable) {
// original length, plus the receiver, minus any additional arguments (after the receiver)
$defineProperty(
func,
'length',
{ value: 1 + $max(0, originalFunction.length - (arguments.length - 1)) }
);
}
}
return func;
};
var applyBind = function applyBind() {
return $reflectApply(bind, $apply, arguments);
};
if ($defineProperty) {
$defineProperty(module.exports, 'apply', { value: applyBind });
} else {
module.exports.apply = applyBind;
}

View File

@@ -0,0 +1 @@
{"name":"is-promise","version":"2.2.2","files":{"package.json":{"checkedAt":1678883673238,"integrity":"sha512-W2Tm5hywkMO2pAqL09FI6G/eeNHJ/kxCEZZJGwoidrLO/oW/CunGftVCRdEfvAObIKY7xpKhnq6K5gIRaI7g4Q==","mode":420,"size":471},"index.js":{"checkedAt":1678883673238,"integrity":"sha512-Qad/KpksPGNBMhdpVM0xCRrH9G/IAUVzPIwMW8mlzv8M8AeUIN8wu67rtPWYUwv+4VlHw+M+zNhTih9eBBrn0g==","mode":420,"size":201},"index.mjs":{"checkedAt":1678883673238,"integrity":"sha512-gtnod4AoOjzrLHmNxxUxjIQlQzEmyhdce9bycnVKnJ+tcXWdjGtt2BSTfdgCFHVAqUQEOzvJeoxOwjbFaZskPw==","mode":420,"size":151},"readme.md":{"checkedAt":1678883673238,"integrity":"sha512-VhOx/i6syuWAWXIoIC1EbRrufqYvauzAATmXyUYzSLEVZibVtZmH7x2FdRo7GdJOA80T2+bUnFWQXHk4qPW8kw==","mode":420,"size":864},"LICENSE":{"checkedAt":1678883673238,"integrity":"sha512-sninKVyQok6a4SaJJ9Z+lCMZXY783aUHhjapGiZ7Ou+aeRutwGvRbKFYhPglcrd5GauRHGx7ikBhTB9PvARr2g==","mode":420,"size":1058}}}

View File

@@ -0,0 +1,29 @@
{
"name": "inflight",
"version": "1.0.6",
"description": "Add callbacks to requests in flight to avoid async duplication",
"main": "inflight.js",
"files": [
"inflight.js"
],
"dependencies": {
"once": "^1.3.0",
"wrappy": "1"
},
"devDependencies": {
"tap": "^7.1.2"
},
"scripts": {
"test": "tap test.js --100"
},
"repository": {
"type": "git",
"url": "https://github.com/npm/inflight.git"
},
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"bugs": {
"url": "https://github.com/isaacs/inflight/issues"
},
"homepage": "https://github.com/isaacs/inflight",
"license": "ISC"
}

View File

@@ -0,0 +1,5 @@
import { Observable } from '../Observable';
import { MonoTypeOperatorFunction, OperatorFunction, TruthyTypesOf } from '../types';
export declare function single<T>(predicate: BooleanConstructor): OperatorFunction<T, TruthyTypesOf<T>>;
export declare function single<T>(predicate?: (value: T, index: number, source: Observable<T>) => boolean): MonoTypeOperatorFunction<T>;
//# sourceMappingURL=single.d.ts.map

View File

@@ -0,0 +1,312 @@
<!-- Please do not edit this file. Edit the `blah` field in the `package.json` instead. If in doubt, open an issue. -->
# git-up
[![Support me on Patreon][badge_patreon]][patreon] [![Buy me a book][badge_amazon]][amazon] [![PayPal][badge_paypal_donate]][paypal-donations] [![Ask me anything](https://img.shields.io/badge/ask%20me-anything-1abc9c.svg)](https://github.com/IonicaBizau/ama) [![Version](https://img.shields.io/npm/v/git-up.svg)](https://www.npmjs.com/package/git-up) [![Downloads](https://img.shields.io/npm/dt/git-up.svg)](https://www.npmjs.com/package/git-up) [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/johnnyb?utm_source=github&utm_medium=button&utm_term=johnnyb&utm_campaign=github)
<a href="https://www.buymeacoffee.com/H96WwChMy" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/yellow_img.png" alt="Buy Me A Coffee"></a>
> A low level git url parser.
## :cloud: Installation
```sh
# Using npm
npm install --save git-up
# Using yarn
yarn add git-up
```
## :clipboard: Example
```js
// Dependencies
var gitUp = require("git-up");
console.log(gitUp("git@github.com:IonicaBizau/node-parse-url.git"));
// => {
// protocols: []
// , port: null
// , resource: "github.com"
// , user: "git"
// , pathname: "/IonicaBizau/node-parse-url.git"
// , hash: ""
// , search: ""
// , href: "git@github.com:IonicaBizau/node-parse-url.git"
// , protocol: "ssh"
// }
console.log(gitUp("https://github.com/IonicaBizau/node-parse-url.git"));
// => {
// protocols: [ "https" ]
// , port: null
// , resource: "github.com"
// , user: ""
// , pathname: "/IonicaBizau/node-parse-url.git"
// , hash: ""
// , search: ""
// , href: "https://github.com/IonicaBizau/node-parse-url.git"
// , protocol: "https"
// }
```
## :question: Get Help
There are few ways to get help:
1. Please [post questions on Stack Overflow](https://stackoverflow.com/questions/ask). You can open issues with questions, as long you add a link to your Stack Overflow question.
2. For bug reports and feature requests, open issues. :bug:
3. For direct and quick help, you can [use Codementor](https://www.codementor.io/johnnyb). :rocket:
## :memo: Documentation
### `gitUp(input)`
Parses the input url.
#### Params
- **String** `input`: The input url.
#### Return
- **Object** An object containing the following fields:
- `protocols` (Array): An array with the url protocols (usually it has one element).
- `port` (null|Number): The domain port.
- `resource` (String): The url domain (including subdomains).
- `user` (String): The authentication user (usually for ssh urls).
- `pathname` (String): The url pathname.
- `hash` (String): The url hash.
- `search` (String): The url querystring value.
- `href` (String): The input url.
- `protocol` (String): The git url protocol.
- `token` (String): The oauth token (could appear in the https urls).
## :yum: How to contribute
Have an idea? Found a bug? See [how to contribute][contributing].
## :sparkling_heart: Support my projects
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously,
this takes time. You can integrate and use these projects in your applications *for free*! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
- Starring and sharing the projects you like :rocket:
- [![Buy me a book][badge_amazon]][amazon]—I love books! I will remember you after years if you buy me one. :grin: :book:
- [![PayPal][badge_paypal]][paypal-donations]—You can make one-time donations via PayPal. I'll probably buy a ~~coffee~~ tea. :tea:
- [![Support me on Patreon][badge_patreon]][patreon]—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
- **Bitcoin**—You can send me bitcoins at this address (or scanning the code below): `1P9BRsmazNQcuyTxEqveUsnf5CERdq35V6`
![](https://i.imgur.com/z6OQI95.png)
Thanks! :heart:
## :dizzy: Where is this library used?
If you are using this library in one of your projects, add it in this list. :sparkles:
- `git-url-parse`
- `gatsby-telemetry`
- `@jamo/gatsby-telemetry`
- `@enkeledi/react-native-week-month-date-picker`
- `erxes-telemetry`
- `@hemith/react-native-tnk`
- `miguelcostero-ng2-toasty`
- `native-kakao-login`
- `react-native-my-first-try-arun-ramya`
- `react-native-kakao-maps`
- `react-native-is7`
- `react-native-ytximkit`
- `react-native-payu-payment-testing`
- `npm_one_1_2_3`
- `react-native-biometric-authenticate`
- `react-native-arunmeena1987`
- `react-native-contact-list`
- `rn-adyen-dropin`
- `@positionex/position-sdk`
- `@corelmax/react-native-my2c2p-sdk`
- `@felipesimmi/react-native-datalogic-module`
- `@hawkingnetwork/react-native-tab-view`
- `drowl-base-theme-iconset`
- `native-apple-login`
- `react-native-cplus`
- `npm_qwerty`
- `react-native-arunjeyam1987`
- `react-native-bubble-chart`
- `react-native-flyy`
- `@react-18-pdf/root`
- `@apardellass/react-native-audio-stream`
- `@geeky-apo/react-native-advanced-clipboard`
- `candlelabssdk`
- `@saad27/react-native-bottom-tab-tour`
- `codelofts-git-url-parse`
- `gb-notifications`
- `react-native-dsphoto-module`
- `react-native-responsive-size`
- `react-native-sayhello-module`
- `npm_one_12_34_1_`
- `npm_one_2_2`
- `payutesting`
- `@con-test/react-native-concent-common`
- `react-native-shekhar-bridge-test`
- `react-feedback-sdk`
- `@oiti/documentoscopy-react-native`
- `birken-react-native-community-image-editor`
- `git-web`
- `luojia-cli-dev`
- `reac-native-arun-ramya-test`
- `react-native-plugpag-wrapper`
- `react-native-pulsator-native`
- `react-native-arun-ramya-test`
- `react-native-arunramya151`
- `react-native-transtracker-library`
- `ship-release`
- `@jfilipe-sparta/react-native-module_2`
- `cogoportutils`
- `@buganto/client`
- `angularvezba`
- `astra-ufo-sdk`
- `react-native-syan-photo-picker`
- `@wecraftapps/react-native-use-keyboard`
- `l2forlerna`
- `native-google-login`
- `react-native-modal-progress-bar`
- `react-native-test-module-hhh`
- `raact-native-arunramya151`
- `react-native-jsi-device-info`
- `react-native-badge-control`
- `front-end-styleguide-cli`
- `front-end-styleguide-init`
- `hubgit`
- `rn-tm-notify`
- `native-date-picker-module`
## :scroll: License
[MIT][license] © [Ionică Bizău][website]
[license]: /LICENSE
[website]: https://ionicabizau.net
[contributing]: /CONTRIBUTING.md
[docs]: /DOCUMENTATION.md
[badge_patreon]: https://ionicabizau.github.io/badges/patreon.svg
[badge_amazon]: https://ionicabizau.github.io/badges/amazon.svg
[badge_paypal]: https://ionicabizau.github.io/badges/paypal.svg
[badge_paypal_donate]: https://ionicabizau.github.io/badges/paypal_donate.svg
[patreon]: https://www.patreon.com/ionicabizau
[amazon]: http://amzn.eu/hRo9sIZ
[paypal-donations]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RVXDDLKKLQRJW

View File

@@ -0,0 +1,43 @@
{
"name": "crc-32",
"version": "1.2.2",
"author": "sheetjs",
"description": "Pure-JS CRC-32",
"keywords": [ "crc", "crc32", "checksum" ],
"bin": {
"crc32": "bin/crc32.njs"
},
"main": "crc32.js",
"types": "types/index.d.ts",
"typesVersions": { "*": { "*": ["types/index.d.ts" ] } },
"dependencies": {
},
"devDependencies": {
"printj": "~1.3.1",
"exit-on-epipe": "~1.0.1",
"mocha": "~2.5.3",
"blanket": "~1.2.3",
"codepage": "~1.10.0",
"@sheetjs/uglify-js": "~2.7.3",
"@types/node": "^8.0.7",
"dtslint": "^0.1.2",
"typescript": "2.2.0"
},
"repository": { "type": "git", "url": "git://github.com/SheetJS/js-crc32.git" },
"scripts": {
"test": "make test",
"build": "make",
"lint": "make fullint",
"dtslint": "dtslint types"
},
"config": {
"blanket": {
"pattern": "crc32.js"
}
},
"homepage": "https://sheetjs.com/",
"files": ["crc32.js", "crc32c.js", "bin/crc32.njs", "LICENSE", "README.md", "types/index.d.ts", "types/*.json"],
"bugs": { "url": "https://github.com/SheetJS/js-crc32/issues" },
"license": "Apache-2.0",
"engines": { "node": ">=0.8" }
}

View File

@@ -0,0 +1,26 @@
/**
* Creates a function that returns `value`.
*
* @static
* @memberOf _
* @since 2.4.0
* @category Util
* @param {*} value The value to return from the new function.
* @returns {Function} Returns the new constant function.
* @example
*
* var objects = _.times(2, _.constant({ 'a': 1 }));
*
* console.log(objects);
* // => [{ 'a': 1 }, { 'a': 1 }]
*
* console.log(objects[0] === objects[1]);
* // => true
*/
function constant(value) {
return function() {
return value;
};
}
module.exports = constant;

View File

@@ -0,0 +1,24 @@
var baseSum = require('./_baseSum'),
identity = require('./identity');
/**
* Computes the sum of the values in `array`.
*
* @static
* @memberOf _
* @since 3.4.0
* @category Math
* @param {Array} array The array to iterate over.
* @returns {number} Returns the sum.
* @example
*
* _.sum([4, 2, 8, 6]);
* // => 20
*/
function sum(array) {
return (array && array.length)
? baseSum(array, identity)
: 0;
}
module.exports = sum;

View File

@@ -0,0 +1,20 @@
'use strict';
var abs = require('./abs');
var floor = require('./floor');
var ToNumber = require('./ToNumber');
var $isNaN = require('../helpers/isNaN');
var $isFinite = require('../helpers/isFinite');
var $sign = require('../helpers/sign');
// https://262.ecma-international.org/12.0/#sec-tointegerorinfinity
module.exports = function ToIntegerOrInfinity(value) {
var number = ToNumber(value);
if ($isNaN(number) || number === 0) { return 0; }
if (!$isFinite(number)) { return number; }
var integer = floor(abs(number));
if (integer === 0) { return 0; }
return $sign(number) * integer;
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"agent.js","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,8CAAsB;AACtB,8CAAsB;AACtB,kDAAgC;AAChC,6DAAqC;AACrC,2CAAkE;AAGlE,MAAM,KAAK,GAAG,eAAW,CAAC,kBAAkB,CAAC,CAAC;AAY9C,SAAS,OAAO,CAAC,QAAwB;IACxC,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC3E,CAAC;AAED;;;;;GAKG;AACH,MAAqB,cAAe,SAAQ,kBAAK;IAIhD,YAAY,KAAqC;QAChD,IAAI,IAA2B,CAAC;QAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC9B,IAAI,GAAG,aAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;SACxB;aAAM;YACN,IAAI,GAAG,KAAK,CAAC;SACb;QACD,IAAI,CAAC,IAAI,EAAE;YACV,MAAM,IAAI,KAAK,CACd,8DAA8D,CAC9D,CAAC;SACF;QACD,KAAK,CAAC,0CAA0C,EAAE,IAAI,CAAC,CAAC;QACxD,KAAK,CAAC,IAAI,CAAC,CAAC;QAEZ,MAAM,KAAK,qBAA+B,IAAI,CAAE,CAAC;QAEjD,wDAAwD;QACxD,uBAAuB;QACvB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAE/D,+DAA+D;QAC/D,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,IAAI,CAAC;QAC1C,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;YACnC,KAAK,CAAC,IAAI,GAAG,QAAQ,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SACtC;QACD,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC9B,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC;QAED,IAAI,KAAK,CAAC,IAAI,IAAI,KAAK,CAAC,IAAI,EAAE;YAC7B,kEAAkE;YAClE,8DAA8D;YAC9D,iEAAiE;YACjE,8BAA8B;YAC9B,OAAO,KAAK,CAAC,IAAI,CAAC;YAClB,OAAO,KAAK,CAAC,QAAQ,CAAC;SACtB;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACpB,CAAC;IAED;;;;;OAKG;IACG,QAAQ,CACb,GAAgC,EAChC,IAAoB;;YAEpB,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC;YACpC,MAAM,MAAM,GAAG,aAAG,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAEnC,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACrB,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC;aAC1B;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;gBACrB,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC;aACrD;YAED,IAAI,MAAM,CAAC,IAAI,IAAI,IAAI,IAAI,OAAO,IAAI,CAAC,IAAI,EAAE;gBAC5C,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;aAChC;YAED,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,EAAE;gBACzB,yDAAyD;gBACzD,2CAA2C;gBAC3C,OAAO,MAAM,CAAC,IAAI,CAAC;aACnB;YAED,0DAA0D;YAC1D,0DAA0D;YAC1D,GAAG,CAAC,IAAI,GAAG,aAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAE9B,wDAAwD;YACxD,IAAI,KAAK,CAAC,IAAI,EAAE;gBACf,GAAG,CAAC,SAAS,CACZ,qBAAqB,EACrB,SAAS,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CACrD,CAAC;aACF;YAED,kDAAkD;YAClD,IAAI,MAAkB,CAAC;YACvB,IAAI,WAAW,EAAE;gBAChB,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA8B,CAAC,CAAC;aACrD;iBAAM;gBACN,KAAK,CAAC,2BAA2B,EAAE,KAAK,CAAC,CAAC;gBAC1C,MAAM,GAAG,aAAG,CAAC,OAAO,CAAC,KAA2B,CAAC,CAAC;aAClD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,kEAAkE;YAClE,IAAI,GAAG,CAAC,OAAO,EAAE;gBAChB,IAAI,KAAa,CAAC;gBAClB,IAAI,YAAoB,CAAC;gBACzB,KAAK,CAAC,oDAAoD,CAAC,CAAC;gBAC5D,GAAG,CAAC,OAAO,GAAG,IAAI,CAAC;gBACnB,GAAG,CAAC,eAAe,EAAE,CAAC;gBACtB,IAAI,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;oBACxC,YAAY;oBACZ,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;oBACtB,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC5D,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;iBACvC;qBAAM,IAAI,GAAG,CAAC,UAAU,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;oBACvD,aAAa;oBACb,KAAK,CACJ,+DAA+D,CAC/D,CAAC;oBACF,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;oBAC/B,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;oBAC7C,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI;wBACrB,GAAG,CAAC,OAAO,GAAG,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;oBAC7C,KAAK,CAAC,mBAAmB,EAAE,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;iBACnD;aACD;YAED,mEAAmE;YACnE,mEAAmE;YACnE,qEAAqE;YACrE,qDAAqD;YACrD,MAAM,cAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAE9B,OAAO,MAAM,CAAC;QACf,CAAC;KAAA;CACD;AA1ID,iCA0IC"}

View File

@@ -0,0 +1,36 @@
import { __extends } from "tslib";
import { Scheduler } from '../Scheduler';
var AsyncScheduler = (function (_super) {
__extends(AsyncScheduler, _super);
function AsyncScheduler(SchedulerAction, now) {
if (now === void 0) { now = Scheduler.now; }
var _this = _super.call(this, SchedulerAction, now) || this;
_this.actions = [];
_this._active = false;
return _this;
}
AsyncScheduler.prototype.flush = function (action) {
var actions = this.actions;
if (this._active) {
actions.push(action);
return;
}
var error;
this._active = true;
do {
if ((error = action.execute(action.state, action.delay))) {
break;
}
} while ((action = actions.shift()));
this._active = false;
if (error) {
while ((action = actions.shift())) {
action.unsubscribe();
}
throw error;
}
};
return AsyncScheduler;
}(Scheduler));
export { AsyncScheduler };
//# sourceMappingURL=AsyncScheduler.js.map

View File

@@ -0,0 +1,9 @@
"use strict";
module.exports = function () {
var from = Array.from, arr, result;
if (typeof from !== "function") return false;
arr = ["raz", "dwa"];
result = from(arr);
return Boolean(result && result !== arr && result[1] === "dwa");
};

View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AjaxTimeoutError = exports.AjaxError = void 0;
var getXHRResponse_1 = require("./getXHRResponse");
var createErrorClass_1 = require("../util/createErrorClass");
exports.AjaxError = createErrorClass_1.createErrorClass(function (_super) {
return function AjaxErrorImpl(message, xhr, request) {
this.message = message;
this.name = 'AjaxError';
this.xhr = xhr;
this.request = request;
this.status = xhr.status;
this.responseType = xhr.responseType;
var response;
try {
response = getXHRResponse_1.getXHRResponse(xhr);
}
catch (err) {
response = xhr.responseText;
}
this.response = response;
};
});
exports.AjaxTimeoutError = (function () {
function AjaxTimeoutErrorImpl(xhr, request) {
exports.AjaxError.call(this, 'ajax timeout', xhr, request);
this.name = 'AjaxTimeoutError';
return this;
}
AjaxTimeoutErrorImpl.prototype = Object.create(exports.AjaxError.prototype);
return AjaxTimeoutErrorImpl;
})();
//# sourceMappingURL=errors.js.map

View File

@@ -0,0 +1,52 @@
# is-date-object <sup>[![Version Badge][2]][1]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][11]][1]
Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
## Example
```js
var isDate = require('is-date-object');
var assert = require('assert');
assert.notOk(isDate(undefined));
assert.notOk(isDate(null));
assert.notOk(isDate(false));
assert.notOk(isDate(true));
assert.notOk(isDate(42));
assert.notOk(isDate('foo'));
assert.notOk(isDate(function () {}));
assert.notOk(isDate([]));
assert.notOk(isDate({}));
assert.notOk(isDate(/a/g));
assert.notOk(isDate(new RegExp('a', 'g')));
assert.ok(isDate(new Date()));
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[1]: https://npmjs.org/package/is-date-object
[2]: https://versionbadg.es/inspect-js/is-date-object.svg
[5]: https://david-dm.org/inspect-js/is-date-object.svg
[6]: https://david-dm.org/inspect-js/is-date-object
[7]: https://david-dm.org/inspect-js/is-date-object/dev-status.svg
[8]: https://david-dm.org/inspect-js/is-date-object#info=devDependencies
[11]: https://nodei.co/npm/is-date-object.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/is-date-object.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/is-date-object.svg
[downloads-url]: https://npm-stat.com/charts.html?package=is-date-object
[codecov-image]: https://codecov.io/gh/inspect-js/is-date-object/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-date-object/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-date-object
[actions-url]: https://github.com/inspect-js/is-date-object/actions

View File

@@ -0,0 +1,49 @@
import { Observable } from '../Observable';
import { SchedulerLike } from '../types';
/**
* Creates an Observable that emits sequential numbers every specified
* interval of time, on a specified {@link SchedulerLike}.
*
* <span class="informal">Emits incremental numbers periodically in time.</span>
*
* ![](interval.png)
*
* `interval` returns an Observable that emits an infinite sequence of
* ascending integers, with a constant interval of time of your choosing
* between those emissions. The first emission is not sent immediately, but
* only after the first period has passed. By default, this operator uses the
* `async` {@link SchedulerLike} to provide a notion of time, but you may pass any
* {@link SchedulerLike} to it.
*
* ## Example
*
* Emits ascending numbers, one every second (1000ms) up to the number 3
*
* ```ts
* import { interval, take } from 'rxjs';
*
* const numbers = interval(1000);
*
* const takeFourNumbers = numbers.pipe(take(4));
*
* takeFourNumbers.subscribe(x => console.log('Next: ', x));
*
* // Logs:
* // Next: 0
* // Next: 1
* // Next: 2
* // Next: 3
* ```
*
* @see {@link timer}
* @see {@link delay}
*
* @param {number} [period=0] The interval size in milliseconds (by default)
* or the time unit determined by the scheduler's clock.
* @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for scheduling
* the emission of values, and providing a notion of "time".
* @return {Observable} An Observable that emits a sequential number each time
* interval.
*/
export declare function interval(period?: number, scheduler?: SchedulerLike): Observable<number>;
//# sourceMappingURL=interval.d.ts.map

View File

@@ -0,0 +1,12 @@
var test = require('tap').test;
var detective = require('../');
var fs = require('fs');
var src = fs.readFileSync(__dirname + '/files/set-in-object-pattern.js');
test('set in object pattern', function (t) {
t.deepEqual(
detective(src, { word : 'load' }),
[ 'a', 'b', 'c', 'tt' ]
);
t.end();
});

View File

@@ -0,0 +1,9 @@
"use strict";
var resolveException = require("../lib/resolve-exception")
, is = require("./is");
module.exports = function (value/*, options*/) {
if (is(value)) return value;
return resolveException(value, "%v is not an array object", arguments[1]);
};

View File

@@ -0,0 +1 @@
{"name":"cacheable-lookup","version":"7.0.0","files":{"LICENSE":{"checkedAt":1678883670949,"integrity":"sha512-cIt5XW2Mkz/IzwMNxjFwSz2WT4PyUInw2ERNcXsk+0hQp/PDDcbYONUnfSNZKhxiAXL/NRM0Fl96vDdpTLHDLA==","mode":420,"size":1071},"source/index.js":{"checkedAt":1678883670949,"integrity":"sha512-ZxJacKYcT4NZ7eRzxnMDC6PeOeeaAdH+VVIcixuhZudi+SW8BnVNwGduZ4nqnPDQv/kEyLnsHeeZELipSzO7LA==","mode":420,"size":9887},"package.json":{"checkedAt":1678883670949,"integrity":"sha512-eURWxIWQrENusPoaqYIN6cPrsFI1Cx5VnwMM0/wmpdq4TnlOGwulMrTKnvo5WlhFqfoqPWpjYqKdrKt4NXBwqQ==","mode":420,"size":1308},"README.md":{"checkedAt":1678883670954,"integrity":"sha512-GirqN+XeZgUzH2jkEJ6FqvNXBgycuinHn9zC1HAmoseA50D+J6qzVzQyd/6VmXNsWQpi0vIpJkLGcsko4P4nig==","mode":420,"size":7843},"index.d.ts":{"checkedAt":1678883670954,"integrity":"sha512-ohkps0xNn/lCoeYJswIBAnGuDMdJ2BjEKF7ZcBLCcAHa1fujiHy2pUcEq5G9TlvWDsI6ouMW79MDsuqkQOG/RA==","mode":420,"size":5084}}}

View File

@@ -0,0 +1,25 @@
'use strict';
var GetIntrinsic = require('get-intrinsic');
var $TypeError = GetIntrinsic('%TypeError%');
var ToInt32 = require('../ToInt32');
var ToUint32 = require('../ToUint32');
var modulo = require('../modulo');
var Type = require('../Type');
// https://262.ecma-international.org/12.0/#sec-numeric-types-number-signedRightShift
module.exports = function NumberSignedRightShift(x, y) {
if (Type(x) !== 'Number' || Type(y) !== 'Number') {
throw new $TypeError('Assertion failed: `x` and `y` arguments must be Numbers');
}
var lnum = ToInt32(x);
var rnum = ToUint32(y);
var shiftCount = modulo(rnum, 32);
return lnum >> shiftCount;
};

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('stubTrue', require('../stubTrue'), require('./_falseOptions'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1,36 @@
var toFinite = require('./toFinite');
/**
* Converts `value` to an integer.
*
* **Note:** This method is loosely based on
* [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).
*
* @static
* @memberOf _
* @since 4.0.0
* @category Lang
* @param {*} value The value to convert.
* @returns {number} Returns the converted integer.
* @example
*
* _.toInteger(3.2);
* // => 3
*
* _.toInteger(Number.MIN_VALUE);
* // => 0
*
* _.toInteger(Infinity);
* // => 1.7976931348623157e+308
*
* _.toInteger('3.2');
* // => 3
*/
function toInteger(value) {
var result = toFinite(value),
remainder = result % 1;
return result === result ? (remainder ? result - remainder : result) : 0;
}
module.exports = toInteger;

View File

@@ -0,0 +1,94 @@
export var TYPE;
(function (TYPE) {
/**
* Raw text
*/
TYPE[TYPE["literal"] = 0] = "literal";
/**
* Variable w/o any format, e.g `var` in `this is a {var}`
*/
TYPE[TYPE["argument"] = 1] = "argument";
/**
* Variable w/ number format
*/
TYPE[TYPE["number"] = 2] = "number";
/**
* Variable w/ date format
*/
TYPE[TYPE["date"] = 3] = "date";
/**
* Variable w/ time format
*/
TYPE[TYPE["time"] = 4] = "time";
/**
* Variable w/ select format
*/
TYPE[TYPE["select"] = 5] = "select";
/**
* Variable w/ plural format
*/
TYPE[TYPE["plural"] = 6] = "plural";
/**
* Only possible within plural argument.
* This is the `#` symbol that will be substituted with the count.
*/
TYPE[TYPE["pound"] = 7] = "pound";
/**
* XML-like tag
*/
TYPE[TYPE["tag"] = 8] = "tag";
})(TYPE || (TYPE = {}));
export var SKELETON_TYPE;
(function (SKELETON_TYPE) {
SKELETON_TYPE[SKELETON_TYPE["number"] = 0] = "number";
SKELETON_TYPE[SKELETON_TYPE["dateTime"] = 1] = "dateTime";
})(SKELETON_TYPE || (SKELETON_TYPE = {}));
/**
* Type Guards
*/
export function isLiteralElement(el) {
return el.type === TYPE.literal;
}
export function isArgumentElement(el) {
return el.type === TYPE.argument;
}
export function isNumberElement(el) {
return el.type === TYPE.number;
}
export function isDateElement(el) {
return el.type === TYPE.date;
}
export function isTimeElement(el) {
return el.type === TYPE.time;
}
export function isSelectElement(el) {
return el.type === TYPE.select;
}
export function isPluralElement(el) {
return el.type === TYPE.plural;
}
export function isPoundElement(el) {
return el.type === TYPE.pound;
}
export function isTagElement(el) {
return el.type === TYPE.tag;
}
export function isNumberSkeleton(el) {
return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);
}
export function isDateTimeSkeleton(el) {
return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);
}
export function createLiteralElement(value) {
return {
type: TYPE.literal,
value: value,
};
}
export function createNumberElement(value, style) {
return {
type: TYPE.number,
value: value,
style: style,
};
}

View File

@@ -0,0 +1,90 @@
# queue-microtask [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
[ci-image]: https://img.shields.io/github/workflow/status/feross/queue-microtask/ci/master
[ci-url]: https://github.com/feross/queue-microtask/actions
[npm-image]: https://img.shields.io/npm/v/queue-microtask.svg
[npm-url]: https://npmjs.org/package/queue-microtask
[downloads-image]: https://img.shields.io/npm/dm/queue-microtask.svg
[downloads-url]: https://npmjs.org/package/queue-microtask
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com
### fast, tiny [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) shim for modern engines
- Use [`queueMicrotask`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/queueMicrotask) in all modern JS engines.
- No dependencies. Less than 10 lines. No shims or complicated fallbacks.
- Optimal performance in all modern environments
- Uses `queueMicrotask` in modern environments
- Fallback to `Promise.resolve().then(fn)` in Node.js 10 and earlier, and old browsers (same performance as `queueMicrotask`)
## install
```
npm install queue-microtask
```
## usage
```js
const queueMicrotask = require('queue-microtask')
queueMicrotask(() => { /* this will run soon */ })
```
## What is `queueMicrotask` and why would one use it?
The `queueMicrotask` function is a WHATWG standard. It queues a microtask to be executed prior to control returning to the event loop.
A microtask is a short function which will run after the current task has completed its work and when there is no other code waiting to be run before control of the execution context is returned to the event loop.
The code `queueMicrotask(fn)` is equivalent to the code `Promise.resolve().then(fn)`. It is also very similar to [`process.nextTick(fn)`](https://nodejs.org/api/process.html#process_process_nexttick_callback_args) in Node.
Using microtasks lets code run without interfering with any other, potentially higher priority, code that is pending, but before the JS engine regains control over the execution context.
See the [spec](https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#microtask-queuing) or [Node documentation](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback) for more information.
## Who is this package for?
This package allows you to use `queueMicrotask` safely in all modern JS engines. Use it if you prioritize small JS bundle size over support for old browsers.
If you just need to support Node 12 and later, use `queueMicrotask` directly. If you need to support all versions of Node, use this package.
## Why not use `process.nextTick`?
In Node, `queueMicrotask` and `process.nextTick` are [essentially equivalent](https://nodejs.org/api/globals.html#globals_queuemicrotask_callback), though there are [subtle differences](https://github.com/YuzuJS/setImmediate#macrotasks-and-microtasks) that don't matter in most situations.
You can think of `queueMicrotask` as a standardized version of `process.nextTick` that works in the browser. No need to rely on your browser bundler to shim `process` for the browser environment.
## Why not use `setTimeout(fn, 0)`?
This approach is the most compatible, but it has problems. Modern browsers throttle timers severely, so `setTimeout(…, 0)` usually takes at least 4ms to run. Furthermore, the throttling gets even worse if the page is backgrounded. If you have many `setTimeout` calls, then this can severely limit the performance of your program.
## Why not use a microtask library like [`immediate`](https://www.npmjs.com/package/immediate) or [`asap`](https://www.npmjs.com/package/asap)?
These packages are great! However, if you prioritize small JS bundle size over optimal performance in old browsers then you may want to consider this package.
This package (`queue-microtask`) is four times smaller than `immediate`, twice as small as `asap`, and twice as small as using `process.nextTick` and letting the browser bundler shim it automatically.
Note: This package throws an exception in JS environments which lack `Promise` support -- which are usually very old browsers and Node.js versions.
Since the `queueMicrotask` API is supported in Node.js, Chrome, Firefox, Safari, Opera, and Edge, **the vast majority of users will get optimal performance**. Any JS environment with `Promise`, which is almost all of them, also get optimal performance. If you need support for JS environments which lack `Promise` support, use one of the alternative packages.
## What is a shim?
> In computer programming, a shim is a library that transparently intercepts API calls and changes the arguments passed, handles the operation itself or redirects the operation elsewhere. [Wikipedia](https://en.wikipedia.org/wiki/Shim_(computing))
This package could also be described as a "ponyfill".
> A ponyfill is almost the same as a polyfill, but not quite. Instead of patching functionality for older browsers, a ponyfill provides that functionality as a standalone module you can use. [PonyFoo](https://ponyfoo.com/articles/polyfills-or-ponyfills)
## API
### `queueMicrotask(fn)`
The `queueMicrotask()` method queues a microtask.
The `fn` argument is a function to be executed after all pending tasks have completed but before yielding control to the browser's event loop.
## license
MIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org).

View File

@@ -0,0 +1 @@
{"version":3,"file":"windowToggle.js","sourceRoot":"","sources":["../../../../src/internal/operators/windowToggle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAiD9C,MAAM,UAAU,YAAY,CAC1B,QAA4B,EAC5B,eAAuD;IAEvD,OAAO,OAAO,CAAC,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;QACpC,MAAM,OAAO,GAAiB,EAAE,CAAC;QAEjC,MAAM,WAAW,GAAG,CAAC,GAAQ,EAAE,EAAE;YAC/B,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE;gBACzB,OAAO,CAAC,KAAK,EAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;aAC7B;YACD,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC,CAAC;QAEF,SAAS,CAAC,QAAQ,CAAC,CAAC,SAAS,CAC3B,wBAAwB,CACtB,UAAU,EACV,CAAC,SAAS,EAAE,EAAE;YACZ,MAAM,MAAM,GAAG,IAAI,OAAO,EAAK,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACrB,MAAM,mBAAmB,GAAG,IAAI,YAAY,EAAE,CAAC;YAC/C,MAAM,WAAW,GAAG,GAAG,EAAE;gBACvB,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;gBAC3B,MAAM,CAAC,QAAQ,EAAE,CAAC;gBAClB,mBAAmB,CAAC,WAAW,EAAE,CAAC;YACpC,CAAC,CAAC;YAEF,IAAI,eAAgC,CAAC;YACrC,IAAI;gBACF,eAAe,GAAG,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC;aACzD;YAAC,OAAO,GAAG,EAAE;gBACZ,WAAW,CAAC,GAAG,CAAC,CAAC;gBACjB,OAAO;aACR;YAED,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC;YAEvC,mBAAmB,CAAC,GAAG,CAAC,eAAe,CAAC,SAAS,CAAC,wBAAwB,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;QAC3H,CAAC,EACD,IAAI,CACL,CACF,CAAC;QAGF,MAAM,CAAC,SAAS,CACd,wBAAwB,CACtB,UAAU,EACV,CAAC,KAAQ,EAAE,EAAE;YAGX,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;YACpC,KAAK,MAAM,MAAM,IAAI,WAAW,EAAE;gBAChC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACpB;QACH,CAAC,EACD,GAAG,EAAE;YAEH,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE;gBACzB,OAAO,CAAC,KAAK,EAAG,CAAC,QAAQ,EAAE,CAAC;aAC7B;YACD,UAAU,CAAC,QAAQ,EAAE,CAAC;QACxB,CAAC,EACD,WAAW,EACX,GAAG,EAAE;YAMH,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE;gBACzB,OAAO,CAAC,KAAK,EAAG,CAAC,WAAW,EAAE,CAAC;aAChC;QACH,CAAC,CACF,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,184 @@
import type {StringDigit} from '../source/internal';
import type {Split} from './split';
import type {StringKeyOf} from './string-key-of';
type GetOptions = {
strict?: boolean;
};
/**
Like the `Get` type but receives an array of strings as a path parameter.
*/
type GetWithPath<BaseType, Keys extends readonly string[], Options extends GetOptions = {}> =
Keys extends []
? BaseType
: Keys extends readonly [infer Head, ...infer Tail]
? GetWithPath<
PropertyOf<BaseType, Extract<Head, string>, Options>,
Extract<Tail, string[]>,
Options
>
: never;
/**
Adds `undefined` to `Type` if `strict` is enabled.
*/
type Strictify<Type, Options extends GetOptions> =
Options['strict'] extends true ? Type | undefined : Type;
/**
If `Options['strict']` is `true`, includes `undefined` in the returned type when accessing properties on `Record<string, any>`.
Known limitations:
- Does not include `undefined` in the type on object types with an index signature (for example, `{a: string; [key: string]: string}`).
*/
type StrictPropertyOf<BaseType, Key extends keyof BaseType, Options extends GetOptions> =
Record<string, any> extends BaseType
? string extends keyof BaseType
? Strictify<BaseType[Key], Options> // Record<string, any>
: BaseType[Key] // Record<'a' | 'b', any> (Records with a string union as keys have required properties)
: BaseType[Key];
/**
Splits a dot-prop style path into a tuple comprised of the properties in the path. Handles square-bracket notation.
@example
```
ToPath<'foo.bar.baz'>
//=> ['foo', 'bar', 'baz']
ToPath<'foo[0].bar.baz'>
//=> ['foo', '0', 'bar', 'baz']
```
*/
type ToPath<S extends string> = Split<FixPathSquareBrackets<S>, '.'>;
/**
Replaces square-bracketed dot notation with dots, for example, `foo[0].bar` -> `foo.0.bar`.
*/
type FixPathSquareBrackets<Path extends string> =
Path extends `[${infer Head}]${infer Tail}`
? Tail extends `[${string}`
? `${Head}.${FixPathSquareBrackets<Tail>}`
: `${Head}${FixPathSquareBrackets<Tail>}`
: Path extends `${infer Head}[${infer Middle}]${infer Tail}`
? `${Head}.${FixPathSquareBrackets<`[${Middle}]${Tail}`>}`
: Path;
/**
Returns true if `LongString` is made up out of `Substring` repeated 0 or more times.
@example
```
ConsistsOnlyOf<'aaa', 'a'> //=> true
ConsistsOnlyOf<'ababab', 'ab'> //=> true
ConsistsOnlyOf<'aBa', 'a'> //=> false
ConsistsOnlyOf<'', 'a'> //=> true
```
*/
type ConsistsOnlyOf<LongString extends string, Substring extends string> =
LongString extends ''
? true
: LongString extends `${Substring}${infer Tail}`
? ConsistsOnlyOf<Tail, Substring>
: false;
/**
Convert a type which may have number keys to one with string keys, making it possible to index using strings retrieved from template types.
@example
```
type WithNumbers = {foo: string; 0: boolean};
type WithStrings = WithStringKeys<WithNumbers>;
type WithNumbersKeys = keyof WithNumbers;
//=> 'foo' | 0
type WithStringsKeys = keyof WithStrings;
//=> 'foo' | '0'
```
*/
type WithStringKeys<BaseType> = {
[Key in StringKeyOf<BaseType>]: UncheckedIndex<BaseType, Key>
};
/**
Perform a `T[U]` operation if `T` supports indexing.
*/
type UncheckedIndex<T, U extends string | number> = [T] extends [Record<string | number, any>] ? T[U] : never;
/**
Get a property of an object or array. Works when indexing arrays using number-literal-strings, for example, `PropertyOf<number[], '0'> = number`, and when indexing objects with number keys.
Note:
- Returns `unknown` if `Key` is not a property of `BaseType`, since TypeScript uses structural typing, and it cannot be guaranteed that extra properties unknown to the type system will exist at runtime.
- Returns `undefined` from nullish values, to match the behaviour of most deep-key libraries like `lodash`, `dot-prop`, etc.
*/
type PropertyOf<BaseType, Key extends string, Options extends GetOptions = {}> =
BaseType extends null | undefined
? undefined
: Key extends keyof BaseType
? StrictPropertyOf<BaseType, Key, Options>
: BaseType extends [] | [unknown, ...unknown[]]
? unknown // It's a tuple, but `Key` did not extend `keyof BaseType`. So the index is out of bounds.
: BaseType extends {
[n: number]: infer Item;
length: number; // Note: This is needed to avoid being too lax with records types using number keys like `{0: string; 1: boolean}`.
}
? (
ConsistsOnlyOf<Key, StringDigit> extends true
? Strictify<Item, Options>
: unknown
)
: Key extends keyof WithStringKeys<BaseType>
? StrictPropertyOf<WithStringKeys<BaseType>, Key, Options>
: unknown;
// This works by first splitting the path based on `.` and `[...]` characters into a tuple of string keys. Then it recursively uses the head key to get the next property of the current object, until there are no keys left. Number keys extract the item type from arrays, or are converted to strings to extract types from tuples and dictionaries with number keys.
/**
Get a deeply-nested property from an object using a key path, like Lodash's `.get()` function.
Use-case: Retrieve a property from deep inside an API response or some other complex object.
@example
```
import type {Get} from 'type-fest';
import * as lodash from 'lodash';
const get = <BaseType, Path extends string | readonly string[]>(object: BaseType, path: Path): Get<BaseType, Path> =>
lodash.get(object, path);
interface ApiResponse {
hits: {
hits: Array<{
_id: string
_source: {
name: Array<{
given: string[]
family: string
}>
birthDate: string
}
}>
}
}
const getName = (apiResponse: ApiResponse) =>
get(apiResponse, 'hits.hits[0]._source.name');
//=> Array<{given: string[]; family: string}>
// Path also supports a readonly array of strings
const getNameWithPathArray = (apiResponse: ApiResponse) =>
get(apiResponse, ['hits','hits', '0', '_source', 'name'] as const);
//=> Array<{given: string[]; family: string}>
// Strict mode:
Get<string[], '3', {strict: true}> //=> string | undefined
Get<Record<string, string>, 'foo', {strict: true}> // => string | undefined
```
@category Object
@category Array
@category Template literal
*/
export type Get<BaseType, Path extends string | readonly string[], Options extends GetOptions = {}> =
GetWithPath<BaseType, Path extends string ? ToPath<Path> : Path, Options>;

View File

@@ -0,0 +1,63 @@
"use strict";
var __read = (this && this.__read) || function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
to[j] = from[i];
return to;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.withLatestFrom = void 0;
var lift_1 = require("../util/lift");
var OperatorSubscriber_1 = require("./OperatorSubscriber");
var innerFrom_1 = require("../observable/innerFrom");
var identity_1 = require("../util/identity");
var noop_1 = require("../util/noop");
var args_1 = require("../util/args");
function withLatestFrom() {
var inputs = [];
for (var _i = 0; _i < arguments.length; _i++) {
inputs[_i] = arguments[_i];
}
var project = args_1.popResultSelector(inputs);
return lift_1.operate(function (source, subscriber) {
var len = inputs.length;
var otherValues = new Array(len);
var hasValue = inputs.map(function () { return false; });
var ready = false;
var _loop_1 = function (i) {
innerFrom_1.innerFrom(inputs[i]).subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function (value) {
otherValues[i] = value;
if (!ready && !hasValue[i]) {
hasValue[i] = true;
(ready = hasValue.every(identity_1.identity)) && (hasValue = null);
}
}, noop_1.noop));
};
for (var i = 0; i < len; i++) {
_loop_1(i);
}
source.subscribe(OperatorSubscriber_1.createOperatorSubscriber(subscriber, function (value) {
if (ready) {
var values = __spreadArray([value], __read(otherValues));
subscriber.next(project ? project.apply(void 0, __spreadArray([], __read(values))) : values);
}
}));
});
}
exports.withLatestFrom = withLatestFrom;
//# sourceMappingURL=withLatestFrom.js.map

View File

@@ -0,0 +1,32 @@
/// <reference types="node" />
import type { ClientRequest, IncomingMessage } from 'http';
export interface Timings {
start: number;
socket?: number;
lookup?: number;
connect?: number;
secureConnect?: number;
upload?: number;
response?: number;
end?: number;
error?: number;
abort?: number;
phases: {
wait?: number;
dns?: number;
tcp?: number;
tls?: number;
request?: number;
firstByte?: number;
download?: number;
total?: number;
};
}
export interface ClientRequestWithTimings extends ClientRequest {
timings?: Timings;
}
export interface IncomingMessageWithTimings extends IncomingMessage {
timings?: Timings;
}
declare const timer: (request: ClientRequestWithTimings) => Timings;
export default timer;

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('dropRightWhile', require('../dropRightWhile'));
func.placeholder = require('./placeholder');
module.exports = func;