new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
# rest.js
|
||||
|
||||
> GitHub REST API client for JavaScript
|
||||
|
||||
[](https://www.npmjs.com/package/@octokit/rest)
|
||||
[](https://github.com/octokit/rest.js/actions?query=workflow%3ATest+branch%3Amaster)
|
||||
|
||||
## Usage
|
||||
|
||||
<table>
|
||||
<tbody valign=top align=left>
|
||||
<tr><th>
|
||||
Browsers
|
||||
</th><td width=100%>
|
||||
Load <code>@octokit/rest</code> directly from <a href="https://cdn.skypack.dev">cdn.skypack.dev</a>
|
||||
|
||||
```html
|
||||
<script type="module">
|
||||
import { Octokit } from "https://cdn.skypack.dev/@octokit/rest";
|
||||
</script>
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
<tr><th>
|
||||
Node
|
||||
</th><td>
|
||||
|
||||
Install with <code>npm install @octokit/rest</code>
|
||||
|
||||
```js
|
||||
const { Octokit } = require("@octokit/rest");
|
||||
// or: import { Octokit } from "@octokit/rest";
|
||||
```
|
||||
|
||||
</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
```js
|
||||
const octokit = new Octokit();
|
||||
|
||||
// Compare: https://docs.github.com/en/rest/reference/repos/#list-organization-repositories
|
||||
octokit.rest.repos
|
||||
.listForOrg({
|
||||
org: "octokit",
|
||||
type: "public",
|
||||
})
|
||||
.then(({ data }) => {
|
||||
// handle data
|
||||
});
|
||||
```
|
||||
|
||||
See https://octokit.github.io/rest.js for full documentation.
|
||||
|
||||
## Contributing
|
||||
|
||||
We would love you to contribute to `@octokit/rest`, pull requests are very welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
||||
|
||||
## Credits
|
||||
|
||||
`@octokit/rest` was originally created as [`node-github`](https://www.npmjs.com/package/github) in 2012 by Mike de Boer from Cloud9 IDE, Inc. [The original commit](https://github.blog/2020-04-09-from-48k-lines-of-code-to-10-the-story-of-githubs-javascript-sdk/) is from 2010 which predates the npm registry.
|
||||
|
||||
It was adopted and renamed by GitHub in 2017. Learn more about it's origin on GitHub's blog: [From 48k lines of code to 10—the story of GitHub’s JavaScript SDK](https://github.blog/2020-04-09-from-48k-lines-of-code-to-10-the-story-of-githubs-javascript-sdk/)
|
||||
|
||||
## LICENSE
|
||||
|
||||
[MIT](LICENSE)
|
||||
@@ -0,0 +1,5 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "5"
|
||||
- "4"
|
||||
- "0.12"
|
||||
@@ -0,0 +1,67 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { SubscribableOrPromise, ObservedValueOf, ObservableInput } from '../types';
|
||||
import { from } from './from'; // lol
|
||||
import { empty } from './empty';
|
||||
|
||||
/**
|
||||
* Creates an Observable that, on subscribe, calls an Observable factory to
|
||||
* make an Observable for each new Observer.
|
||||
*
|
||||
* <span class="informal">Creates the Observable lazily, that is, only when it
|
||||
* is subscribed.
|
||||
* </span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `defer` allows you to create the Observable only when the Observer
|
||||
* subscribes, and create a fresh Observable for each Observer. It waits until
|
||||
* an Observer subscribes to it, and then it generates an Observable,
|
||||
* typically with an Observable factory function. It does this afresh for each
|
||||
* subscriber, so although each subscriber may think it is subscribing to the
|
||||
* same Observable, in fact each subscriber gets its own individual
|
||||
* Observable.
|
||||
*
|
||||
* ## Example
|
||||
* ### Subscribe to either an Observable of clicks or an Observable of interval, at random
|
||||
* ```ts
|
||||
* import { defer, fromEvent, interval } from 'rxjs';
|
||||
*
|
||||
* const clicksOrInterval = defer(function () {
|
||||
* return Math.random() > 0.5
|
||||
* ? fromEvent(document, 'click')
|
||||
* : interval(1000);
|
||||
* });
|
||||
* clicksOrInterval.subscribe(x => console.log(x));
|
||||
*
|
||||
* // Results in the following behavior:
|
||||
* // If the result of Math.random() is greater than 0.5 it will listen
|
||||
* // for clicks anywhere on the "document"; when document is clicked it
|
||||
* // will log a MouseEvent object to the console. If the result is less
|
||||
* // than 0.5 it will emit ascending numbers, one every second(1000ms).
|
||||
* ```
|
||||
*
|
||||
* @see {@link Observable}
|
||||
*
|
||||
* @param {function(): SubscribableOrPromise} observableFactory The Observable
|
||||
* factory function to invoke for each Observer that subscribes to the output
|
||||
* Observable. May also return a Promise, which will be converted on the fly
|
||||
* to an Observable.
|
||||
* @return {Observable} An Observable whose Observers' subscriptions trigger
|
||||
* an invocation of the given Observable factory function.
|
||||
* @static true
|
||||
* @name defer
|
||||
* @owner Observable
|
||||
*/
|
||||
export function defer<R extends ObservableInput<any> | void>(observableFactory: () => R): Observable<ObservedValueOf<R>> {
|
||||
return new Observable<ObservedValueOf<R>>(subscriber => {
|
||||
let input: R | void;
|
||||
try {
|
||||
input = observableFactory();
|
||||
} catch (err) {
|
||||
subscriber.error(err);
|
||||
return undefined;
|
||||
}
|
||||
const source = input ? from(input as ObservableInput<ObservedValueOf<R>>) : empty();
|
||||
return source.subscribe(subscriber);
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// canvas.toDataURL type support
|
||||
// http://www.w3.org/TR/html5/the-canvas-element.html#dom-canvas-todataurl
|
||||
|
||||
// This test is asynchronous. Watch out.
|
||||
|
||||
(function () {
|
||||
|
||||
if (!Modernizr.canvas) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var image = new Image(),
|
||||
canvas = document.createElement('canvas'),
|
||||
ctx = canvas.getContext('2d');
|
||||
|
||||
image.onload = function() {
|
||||
ctx.drawImage(image, 0, 0);
|
||||
|
||||
Modernizr.addTest('todataurljpeg', function() {
|
||||
return canvas.toDataURL('image/jpeg').indexOf('data:image/jpeg') === 0;
|
||||
});
|
||||
Modernizr.addTest('todataurlwebp', function() {
|
||||
return canvas.toDataURL('image/webp').indexOf('data:image/webp') === 0;
|
||||
});
|
||||
};
|
||||
|
||||
image.src = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACklEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==';
|
||||
}());
|
||||
@@ -0,0 +1,18 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { ObservableInput, OperatorFunction } from '../types';
|
||||
export declare function onErrorResumeNext<T>(): OperatorFunction<T, T>;
|
||||
export declare function onErrorResumeNext<T, T2>(v: ObservableInput<T2>): OperatorFunction<T, T | T2>;
|
||||
export declare function onErrorResumeNext<T, T2, T3>(v: ObservableInput<T2>, v2: ObservableInput<T3>): OperatorFunction<T, T | T2 | T3>;
|
||||
export declare function onErrorResumeNext<T, T2, T3, T4>(v: ObservableInput<T2>, v2: ObservableInput<T3>, v3: ObservableInput<T4>): OperatorFunction<T, T | T2 | T3 | T4>;
|
||||
export declare function onErrorResumeNext<T, T2, T3, T4, T5>(v: ObservableInput<T2>, v2: ObservableInput<T3>, v3: ObservableInput<T4>, v4: ObservableInput<T5>): OperatorFunction<T, T | T2 | T3 | T4 | T5>;
|
||||
export declare function onErrorResumeNext<T, T2, T3, T4, T5, T6>(v: ObservableInput<T2>, v2: ObservableInput<T3>, v3: ObservableInput<T4>, v4: ObservableInput<T5>, v5: ObservableInput<T6>): OperatorFunction<T, T | T2 | T3 | T4 | T5 | T6>;
|
||||
export declare function onErrorResumeNext<T, T2, T3, T4, T5, T6, T7>(v: ObservableInput<T2>, v2: ObservableInput<T3>, v3: ObservableInput<T4>, v4: ObservableInput<T5>, v5: ObservableInput<T6>, v6: ObservableInput<T7>): OperatorFunction<T, T | T2 | T3 | T4 | T5 | T6 | T7>;
|
||||
export declare function onErrorResumeNext<T, R>(...observables: Array<ObservableInput<any>>): OperatorFunction<T, T | R>;
|
||||
export declare function onErrorResumeNext<T, R>(array: ObservableInput<any>[]): OperatorFunction<T, T | R>;
|
||||
export declare function onErrorResumeNextStatic<R>(v: ObservableInput<R>): Observable<R>;
|
||||
export declare function onErrorResumeNextStatic<T2, T3, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<R>;
|
||||
export declare function onErrorResumeNextStatic<T2, T3, T4, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<R>;
|
||||
export declare function onErrorResumeNextStatic<T2, T3, T4, T5, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<R>;
|
||||
export declare function onErrorResumeNextStatic<T2, T3, T4, T5, T6, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<R>;
|
||||
export declare function onErrorResumeNextStatic<R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): Observable<R>;
|
||||
export declare function onErrorResumeNextStatic<R>(array: ObservableInput<any>[]): Observable<R>;
|
||||
@@ -0,0 +1,200 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var Subject_1 = require("./Subject");
|
||||
exports.Subject = Subject_1.Subject;
|
||||
exports.AnonymousSubject = Subject_1.AnonymousSubject;
|
||||
var Observable_1 = require("./Observable");
|
||||
exports.Observable = Observable_1.Observable;
|
||||
var config_1 = require("./config");
|
||||
exports.config = config_1.config;
|
||||
require("rxjs-compat/add/observable/bindCallback");
|
||||
require("rxjs-compat/add/observable/bindNodeCallback");
|
||||
require("rxjs-compat/add/observable/combineLatest");
|
||||
require("rxjs-compat/add/observable/concat");
|
||||
require("rxjs-compat/add/observable/defer");
|
||||
require("rxjs-compat/add/observable/empty");
|
||||
require("rxjs-compat/add/observable/forkJoin");
|
||||
require("rxjs-compat/add/observable/from");
|
||||
require("rxjs-compat/add/observable/fromEvent");
|
||||
require("rxjs-compat/add/observable/fromEventPattern");
|
||||
require("rxjs-compat/add/observable/fromPromise");
|
||||
require("rxjs-compat/add/observable/generate");
|
||||
require("rxjs-compat/add/observable/if");
|
||||
require("rxjs-compat/add/observable/interval");
|
||||
require("rxjs-compat/add/observable/merge");
|
||||
require("rxjs-compat/add/observable/race");
|
||||
require("rxjs-compat/add/observable/never");
|
||||
require("rxjs-compat/add/observable/of");
|
||||
require("rxjs-compat/add/observable/onErrorResumeNext");
|
||||
require("rxjs-compat/add/observable/pairs");
|
||||
require("rxjs-compat/add/observable/range");
|
||||
require("rxjs-compat/add/observable/using");
|
||||
require("rxjs-compat/add/observable/throw");
|
||||
require("rxjs-compat/add/observable/timer");
|
||||
require("rxjs-compat/add/observable/zip");
|
||||
require("rxjs-compat/add/observable/dom/ajax");
|
||||
require("rxjs-compat/add/observable/dom/webSocket");
|
||||
require("rxjs-compat/add/operator/buffer");
|
||||
require("rxjs-compat/add/operator/bufferCount");
|
||||
require("rxjs-compat/add/operator/bufferTime");
|
||||
require("rxjs-compat/add/operator/bufferToggle");
|
||||
require("rxjs-compat/add/operator/bufferWhen");
|
||||
require("rxjs-compat/add/operator/catch");
|
||||
require("rxjs-compat/add/operator/combineAll");
|
||||
require("rxjs-compat/add/operator/combineLatest");
|
||||
require("rxjs-compat/add/operator/concat");
|
||||
require("rxjs-compat/add/operator/concatAll");
|
||||
require("rxjs-compat/add/operator/concatMap");
|
||||
require("rxjs-compat/add/operator/concatMapTo");
|
||||
require("rxjs-compat/add/operator/count");
|
||||
require("rxjs-compat/add/operator/dematerialize");
|
||||
require("rxjs-compat/add/operator/debounce");
|
||||
require("rxjs-compat/add/operator/debounceTime");
|
||||
require("rxjs-compat/add/operator/defaultIfEmpty");
|
||||
require("rxjs-compat/add/operator/delay");
|
||||
require("rxjs-compat/add/operator/delayWhen");
|
||||
require("rxjs-compat/add/operator/distinct");
|
||||
require("rxjs-compat/add/operator/distinctUntilChanged");
|
||||
require("rxjs-compat/add/operator/distinctUntilKeyChanged");
|
||||
require("rxjs-compat/add/operator/do");
|
||||
require("rxjs-compat/add/operator/exhaust");
|
||||
require("rxjs-compat/add/operator/exhaustMap");
|
||||
require("rxjs-compat/add/operator/expand");
|
||||
require("rxjs-compat/add/operator/elementAt");
|
||||
require("rxjs-compat/add/operator/filter");
|
||||
require("rxjs-compat/add/operator/finally");
|
||||
require("rxjs-compat/add/operator/find");
|
||||
require("rxjs-compat/add/operator/findIndex");
|
||||
require("rxjs-compat/add/operator/first");
|
||||
require("rxjs-compat/add/operator/groupBy");
|
||||
require("rxjs-compat/add/operator/ignoreElements");
|
||||
require("rxjs-compat/add/operator/isEmpty");
|
||||
require("rxjs-compat/add/operator/audit");
|
||||
require("rxjs-compat/add/operator/auditTime");
|
||||
require("rxjs-compat/add/operator/last");
|
||||
require("rxjs-compat/add/operator/let");
|
||||
require("rxjs-compat/add/operator/every");
|
||||
require("rxjs-compat/add/operator/map");
|
||||
require("rxjs-compat/add/operator/mapTo");
|
||||
require("rxjs-compat/add/operator/materialize");
|
||||
require("rxjs-compat/add/operator/max");
|
||||
require("rxjs-compat/add/operator/merge");
|
||||
require("rxjs-compat/add/operator/mergeAll");
|
||||
require("rxjs-compat/add/operator/mergeMap");
|
||||
require("rxjs-compat/add/operator/mergeMapTo");
|
||||
require("rxjs-compat/add/operator/mergeScan");
|
||||
require("rxjs-compat/add/operator/min");
|
||||
require("rxjs-compat/add/operator/multicast");
|
||||
require("rxjs-compat/add/operator/observeOn");
|
||||
require("rxjs-compat/add/operator/onErrorResumeNext");
|
||||
require("rxjs-compat/add/operator/pairwise");
|
||||
require("rxjs-compat/add/operator/partition");
|
||||
require("rxjs-compat/add/operator/pluck");
|
||||
require("rxjs-compat/add/operator/publish");
|
||||
require("rxjs-compat/add/operator/publishBehavior");
|
||||
require("rxjs-compat/add/operator/publishReplay");
|
||||
require("rxjs-compat/add/operator/publishLast");
|
||||
require("rxjs-compat/add/operator/race");
|
||||
require("rxjs-compat/add/operator/reduce");
|
||||
require("rxjs-compat/add/operator/repeat");
|
||||
require("rxjs-compat/add/operator/repeatWhen");
|
||||
require("rxjs-compat/add/operator/retry");
|
||||
require("rxjs-compat/add/operator/retryWhen");
|
||||
require("rxjs-compat/add/operator/sample");
|
||||
require("rxjs-compat/add/operator/sampleTime");
|
||||
require("rxjs-compat/add/operator/scan");
|
||||
require("rxjs-compat/add/operator/sequenceEqual");
|
||||
require("rxjs-compat/add/operator/share");
|
||||
require("rxjs-compat/add/operator/shareReplay");
|
||||
require("rxjs-compat/add/operator/single");
|
||||
require("rxjs-compat/add/operator/skip");
|
||||
require("rxjs-compat/add/operator/skipLast");
|
||||
require("rxjs-compat/add/operator/skipUntil");
|
||||
require("rxjs-compat/add/operator/skipWhile");
|
||||
require("rxjs-compat/add/operator/startWith");
|
||||
require("rxjs-compat/add/operator/subscribeOn");
|
||||
require("rxjs-compat/add/operator/switch");
|
||||
require("rxjs-compat/add/operator/switchMap");
|
||||
require("rxjs-compat/add/operator/switchMapTo");
|
||||
require("rxjs-compat/add/operator/take");
|
||||
require("rxjs-compat/add/operator/takeLast");
|
||||
require("rxjs-compat/add/operator/takeUntil");
|
||||
require("rxjs-compat/add/operator/takeWhile");
|
||||
require("rxjs-compat/add/operator/throttle");
|
||||
require("rxjs-compat/add/operator/throttleTime");
|
||||
require("rxjs-compat/add/operator/timeInterval");
|
||||
require("rxjs-compat/add/operator/timeout");
|
||||
require("rxjs-compat/add/operator/timeoutWith");
|
||||
require("rxjs-compat/add/operator/timestamp");
|
||||
require("rxjs-compat/add/operator/toArray");
|
||||
require("rxjs-compat/add/operator/toPromise");
|
||||
require("rxjs-compat/add/operator/window");
|
||||
require("rxjs-compat/add/operator/windowCount");
|
||||
require("rxjs-compat/add/operator/windowTime");
|
||||
require("rxjs-compat/add/operator/windowToggle");
|
||||
require("rxjs-compat/add/operator/windowWhen");
|
||||
require("rxjs-compat/add/operator/withLatestFrom");
|
||||
require("rxjs-compat/add/operator/zip");
|
||||
require("rxjs-compat/add/operator/zipAll");
|
||||
var Subscription_1 = require("./Subscription");
|
||||
exports.Subscription = Subscription_1.Subscription;
|
||||
var Subscriber_1 = require("./Subscriber");
|
||||
exports.Subscriber = Subscriber_1.Subscriber;
|
||||
var AsyncSubject_1 = require("./AsyncSubject");
|
||||
exports.AsyncSubject = AsyncSubject_1.AsyncSubject;
|
||||
var ReplaySubject_1 = require("./ReplaySubject");
|
||||
exports.ReplaySubject = ReplaySubject_1.ReplaySubject;
|
||||
var BehaviorSubject_1 = require("./BehaviorSubject");
|
||||
exports.BehaviorSubject = BehaviorSubject_1.BehaviorSubject;
|
||||
var ConnectableObservable_1 = require("./observable/ConnectableObservable");
|
||||
exports.ConnectableObservable = ConnectableObservable_1.ConnectableObservable;
|
||||
var Notification_1 = require("./Notification");
|
||||
exports.Notification = Notification_1.Notification;
|
||||
exports.NotificationKind = Notification_1.NotificationKind;
|
||||
var EmptyError_1 = require("./util/EmptyError");
|
||||
exports.EmptyError = EmptyError_1.EmptyError;
|
||||
var ArgumentOutOfRangeError_1 = require("./util/ArgumentOutOfRangeError");
|
||||
exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError_1.ArgumentOutOfRangeError;
|
||||
var ObjectUnsubscribedError_1 = require("./util/ObjectUnsubscribedError");
|
||||
exports.ObjectUnsubscribedError = ObjectUnsubscribedError_1.ObjectUnsubscribedError;
|
||||
var TimeoutError_1 = require("./util/TimeoutError");
|
||||
exports.TimeoutError = TimeoutError_1.TimeoutError;
|
||||
var UnsubscriptionError_1 = require("./util/UnsubscriptionError");
|
||||
exports.UnsubscriptionError = UnsubscriptionError_1.UnsubscriptionError;
|
||||
var timeInterval_1 = require("./operators/timeInterval");
|
||||
exports.TimeInterval = timeInterval_1.TimeInterval;
|
||||
var timestamp_1 = require("./operators/timestamp");
|
||||
exports.Timestamp = timestamp_1.Timestamp;
|
||||
var TestScheduler_1 = require("./testing/TestScheduler");
|
||||
exports.TestScheduler = TestScheduler_1.TestScheduler;
|
||||
var VirtualTimeScheduler_1 = require("./scheduler/VirtualTimeScheduler");
|
||||
exports.VirtualTimeScheduler = VirtualTimeScheduler_1.VirtualTimeScheduler;
|
||||
var AjaxObservable_1 = require("./observable/dom/AjaxObservable");
|
||||
exports.AjaxResponse = AjaxObservable_1.AjaxResponse;
|
||||
exports.AjaxError = AjaxObservable_1.AjaxError;
|
||||
exports.AjaxTimeoutError = AjaxObservable_1.AjaxTimeoutError;
|
||||
var pipe_1 = require("./util/pipe");
|
||||
exports.pipe = pipe_1.pipe;
|
||||
var asap_1 = require("./scheduler/asap");
|
||||
var async_1 = require("./scheduler/async");
|
||||
var queue_1 = require("./scheduler/queue");
|
||||
var animationFrame_1 = require("./scheduler/animationFrame");
|
||||
var rxSubscriber_1 = require("./symbol/rxSubscriber");
|
||||
var iterator_1 = require("./symbol/iterator");
|
||||
var observable_1 = require("./symbol/observable");
|
||||
var _operators = require("./operators/index");
|
||||
exports.operators = _operators;
|
||||
var Scheduler = {
|
||||
asap: asap_1.asap,
|
||||
queue: queue_1.queue,
|
||||
animationFrame: animationFrame_1.animationFrame,
|
||||
async: async_1.async
|
||||
};
|
||||
exports.Scheduler = Scheduler;
|
||||
var Symbol = {
|
||||
rxSubscriber: rxSubscriber_1.rxSubscriber,
|
||||
observable: observable_1.observable,
|
||||
iterator: iterator_1.iterator
|
||||
};
|
||||
exports.Symbol = Symbol;
|
||||
//# sourceMappingURL=Rx.js.map
|
||||
@@ -0,0 +1,61 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { SchedulerAction, SchedulerLike } from '../types';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { Subscription } from '../Subscription';
|
||||
/**
|
||||
* Convert an object into an Observable of `[key, value]` pairs.
|
||||
*
|
||||
* <span class="informal">Turn entries of an object into a stream.</span>
|
||||
*
|
||||
* <img src="./img/pairs.png" width="100%">
|
||||
*
|
||||
* `pairs` takes an arbitrary object and returns an Observable that emits arrays. Each
|
||||
* emitted array has exactly two elements - the first is a key from the object
|
||||
* and the second is a value corresponding to that key. Keys are extracted from
|
||||
* an object via `Object.keys` function, which means that they will be only
|
||||
* enumerable keys that are present on an object directly - not ones inherited
|
||||
* via prototype chain.
|
||||
*
|
||||
* By default these arrays are emitted synchronously. To change that you can
|
||||
* pass a {@link SchedulerLike} as a second argument to `pairs`.
|
||||
*
|
||||
* @example <caption>Converts a javascript object to an Observable</caption>
|
||||
* ```ts
|
||||
* import { pairs } from 'rxjs';
|
||||
*
|
||||
* const obj = {
|
||||
* foo: 42,
|
||||
* bar: 56,
|
||||
* baz: 78
|
||||
* };
|
||||
*
|
||||
* pairs(obj)
|
||||
* .subscribe(
|
||||
* value => console.log(value),
|
||||
* err => {},
|
||||
* () => console.log('the end!')
|
||||
* );
|
||||
*
|
||||
* // Logs:
|
||||
* // ["foo", 42],
|
||||
* // ["bar", 56],
|
||||
* // ["baz", 78],
|
||||
* // "the end!"
|
||||
* ```
|
||||
*
|
||||
* @param {Object} obj The object to inspect and turn into an
|
||||
* Observable sequence.
|
||||
* @param {Scheduler} [scheduler] An optional IScheduler to schedule
|
||||
* when resulting Observable will emit values.
|
||||
* @returns {(Observable<Array<string|T>>)} An observable sequence of
|
||||
* [key, value] pairs from the object.
|
||||
*/
|
||||
export declare function pairs<T>(obj: Object, scheduler?: SchedulerLike): Observable<[string, T]>;
|
||||
/** @internal */
|
||||
export declare function dispatch<T>(this: SchedulerAction<any>, state: {
|
||||
keys: string[];
|
||||
index: number;
|
||||
subscriber: Subscriber<[string, T]>;
|
||||
subscription: Subscription;
|
||||
obj: Object;
|
||||
}): void;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"1":"G A B","2":"BC","8":"J E F"},B:{"1":"C K L H M N O","129":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB DC EC","8":"CC tB","129":"VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB"},D:{"1":"0 1 2 3 4 5 6 7 8 9 u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB","4":"I","129":"QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC"},E:{"1":"u J E F G B C K L H HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","8":"I GC zB","129":"A"},F:{"1":"0 1 2 3 4 5 6 7 8 9 B C M N O v w x y z AB BB CB DB EB RC qB 9B SC rB","2":"G H OC","8":"PC QC","129":"FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d"},G:{"1":"F zB TC AC UC VC WC XC YC ZC","129":"aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"1":"tB I oC pC qC rC AC sC tC","129":"D"},J:{"1":"E A"},K:{"1":"B C qB 9B rB","8":"A","129":"e"},L:{"129":"D"},M:{"129":"D"},N:{"1":"A B"},O:{"129":"uC"},P:{"1":"I","129":"vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"129":"1B"},R:{"129":"8C"},S:{"1":"9C"}},B:2,C:"Geolocation"};
|
||||
@@ -0,0 +1,14 @@
|
||||
import { UnaryFunction } from '../types';
|
||||
export declare function pipe<T>(): UnaryFunction<T, T>;
|
||||
export declare function pipe<T, A>(fn1: UnaryFunction<T, A>): UnaryFunction<T, A>;
|
||||
export declare function pipe<T, A, B>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>): UnaryFunction<T, B>;
|
||||
export declare function pipe<T, A, B, C>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>): UnaryFunction<T, C>;
|
||||
export declare function pipe<T, A, B, C, D>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>): UnaryFunction<T, D>;
|
||||
export declare function pipe<T, A, B, C, D, E>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>): UnaryFunction<T, E>;
|
||||
export declare function pipe<T, A, B, C, D, E, F>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>): UnaryFunction<T, F>;
|
||||
export declare function pipe<T, A, B, C, D, E, F, G>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>): UnaryFunction<T, G>;
|
||||
export declare function pipe<T, A, B, C, D, E, F, G, H>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>): UnaryFunction<T, H>;
|
||||
export declare function pipe<T, A, B, C, D, E, F, G, H, I>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>, fn9: UnaryFunction<H, I>): UnaryFunction<T, I>;
|
||||
export declare function pipe<T, A, B, C, D, E, F, G, H, I>(fn1: UnaryFunction<T, A>, fn2: UnaryFunction<A, B>, fn3: UnaryFunction<B, C>, fn4: UnaryFunction<C, D>, fn5: UnaryFunction<D, E>, fn6: UnaryFunction<E, F>, fn7: UnaryFunction<F, G>, fn8: UnaryFunction<G, H>, fn9: UnaryFunction<H, I>, ...fns: UnaryFunction<any, any>[]): UnaryFunction<T, {}>;
|
||||
/** @internal */
|
||||
export declare function pipeFromArray<T, R>(fns: Array<UnaryFunction<T, R>>): UnaryFunction<T, R>;
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"1":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB","2":"CC tB DC EC"},D:{"1":"5 6 7 8 9 AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"0 1 2 3 4 I u J E F G A B C K L H M N O v w x y z"},E:{"1":"F G A B C K L H KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC","2":"I u J E GC zB HC IC JC"},F:{"1":"0 1 2 3 4 5 6 7 8 9 M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"G B C H OC PC QC RC qB 9B SC rB"},G:{"1":"F XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"zB TC AC UC VC WC"},H:{"2":"nC"},I:{"1":"D sC tC","2":"tB I oC pC qC rC AC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"1":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"1":"1B"},R:{"1":"8C"},S:{"1":"9C"}},B:1,C:"document.currentScript"};
|
||||
@@ -0,0 +1,104 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
// Adapted from Chris Veness' SHA1 code at
|
||||
// http://www.movable-type.co.uk/scripts/sha1.html
|
||||
function f(s, x, y, z) {
|
||||
switch (s) {
|
||||
case 0:
|
||||
return x & y ^ ~x & z;
|
||||
|
||||
case 1:
|
||||
return x ^ y ^ z;
|
||||
|
||||
case 2:
|
||||
return x & y ^ x & z ^ y & z;
|
||||
|
||||
case 3:
|
||||
return x ^ y ^ z;
|
||||
}
|
||||
}
|
||||
|
||||
function ROTL(x, n) {
|
||||
return x << n | x >>> 32 - n;
|
||||
}
|
||||
|
||||
function sha1(bytes) {
|
||||
const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6];
|
||||
const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0];
|
||||
|
||||
if (typeof bytes === 'string') {
|
||||
const msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
|
||||
|
||||
bytes = [];
|
||||
|
||||
for (let i = 0; i < msg.length; ++i) {
|
||||
bytes.push(msg.charCodeAt(i));
|
||||
}
|
||||
} else if (!Array.isArray(bytes)) {
|
||||
// Convert Array-like to Array
|
||||
bytes = Array.prototype.slice.call(bytes);
|
||||
}
|
||||
|
||||
bytes.push(0x80);
|
||||
const l = bytes.length / 4 + 2;
|
||||
const N = Math.ceil(l / 16);
|
||||
const M = new Array(N);
|
||||
|
||||
for (let i = 0; i < N; ++i) {
|
||||
const arr = new Uint32Array(16);
|
||||
|
||||
for (let j = 0; j < 16; ++j) {
|
||||
arr[j] = bytes[i * 64 + j * 4] << 24 | bytes[i * 64 + j * 4 + 1] << 16 | bytes[i * 64 + j * 4 + 2] << 8 | bytes[i * 64 + j * 4 + 3];
|
||||
}
|
||||
|
||||
M[i] = arr;
|
||||
}
|
||||
|
||||
M[N - 1][14] = (bytes.length - 1) * 8 / Math.pow(2, 32);
|
||||
M[N - 1][14] = Math.floor(M[N - 1][14]);
|
||||
M[N - 1][15] = (bytes.length - 1) * 8 & 0xffffffff;
|
||||
|
||||
for (let i = 0; i < N; ++i) {
|
||||
const W = new Uint32Array(80);
|
||||
|
||||
for (let t = 0; t < 16; ++t) {
|
||||
W[t] = M[i][t];
|
||||
}
|
||||
|
||||
for (let t = 16; t < 80; ++t) {
|
||||
W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1);
|
||||
}
|
||||
|
||||
let a = H[0];
|
||||
let b = H[1];
|
||||
let c = H[2];
|
||||
let d = H[3];
|
||||
let e = H[4];
|
||||
|
||||
for (let t = 0; t < 80; ++t) {
|
||||
const s = Math.floor(t / 20);
|
||||
const T = ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t] >>> 0;
|
||||
e = d;
|
||||
d = c;
|
||||
c = ROTL(b, 30) >>> 0;
|
||||
b = a;
|
||||
a = T;
|
||||
}
|
||||
|
||||
H[0] = H[0] + a >>> 0;
|
||||
H[1] = H[1] + b >>> 0;
|
||||
H[2] = H[2] + c >>> 0;
|
||||
H[3] = H[3] + d >>> 0;
|
||||
H[4] = H[4] + e >>> 0;
|
||||
}
|
||||
|
||||
return [H[0] >> 24 & 0xff, H[0] >> 16 & 0xff, H[0] >> 8 & 0xff, H[0] & 0xff, H[1] >> 24 & 0xff, H[1] >> 16 & 0xff, H[1] >> 8 & 0xff, H[1] & 0xff, H[2] >> 24 & 0xff, H[2] >> 16 & 0xff, H[2] >> 8 & 0xff, H[2] & 0xff, H[3] >> 24 & 0xff, H[3] >> 16 & 0xff, H[3] >> 8 & 0xff, H[3] & 0xff, H[4] >> 24 & 0xff, H[4] >> 16 & 0xff, H[4] >> 8 & 0xff, H[4] & 0xff];
|
||||
}
|
||||
|
||||
var _default = sha1;
|
||||
exports.default = _default;
|
||||
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var schematics_1 = require("@angular-devkit/schematics");
|
||||
var tasks_1 = require("@angular-devkit/schematics/tasks");
|
||||
var rxjsCompatVersion = '^6.0.0-rc.0';
|
||||
function rxjsV6MigrationSchematic(_options) {
|
||||
return function (tree, context) {
|
||||
var pkgPath = '/package.json';
|
||||
var buffer = tree.read(pkgPath);
|
||||
if (buffer == null) {
|
||||
throw new schematics_1.SchematicsException('Could not read package.json');
|
||||
}
|
||||
var content = buffer.toString();
|
||||
var pkg = JSON.parse(content);
|
||||
if (pkg === null || typeof pkg !== 'object' || Array.isArray(pkg)) {
|
||||
throw new schematics_1.SchematicsException('Error reading package.json');
|
||||
}
|
||||
if (!pkg.dependencies) {
|
||||
pkg.dependencies = {};
|
||||
}
|
||||
pkg.dependencies['rxjs-compat'] = rxjsCompatVersion;
|
||||
tree.overwrite(pkgPath, JSON.stringify(pkg, null, 2));
|
||||
context.addTask(new tasks_1.NodePackageInstallTask());
|
||||
return tree;
|
||||
};
|
||||
}
|
||||
exports.rxjsV6MigrationSchematic = rxjsV6MigrationSchematic;
|
||||
//# sourceMappingURL=index.js.map
|
||||
@@ -0,0 +1,25 @@
|
||||
import { AsyncScheduler } from './AsyncScheduler';
|
||||
export class AsapScheduler extends AsyncScheduler {
|
||||
flush(action) {
|
||||
this.active = true;
|
||||
this.scheduled = undefined;
|
||||
const { actions } = this;
|
||||
let error;
|
||||
let index = -1;
|
||||
let count = actions.length;
|
||||
action = action || actions.shift();
|
||||
do {
|
||||
if (error = action.execute(action.state, action.delay)) {
|
||||
break;
|
||||
}
|
||||
} while (++index < count && (action = actions.shift()));
|
||||
this.active = false;
|
||||
if (error) {
|
||||
while (++index < count && (action = actions.shift())) {
|
||||
action.unsubscribe();
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=AsapScheduler.js.map
|
||||
@@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "@types/keyv",
|
||||
"version": "3.1.4",
|
||||
"description": "TypeScript definitions for keyv",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/keyv",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "AryloYeung",
|
||||
"url": "https://github.com/Arylo",
|
||||
"githubUsername": "Arylo"
|
||||
},
|
||||
{
|
||||
"name": "BendingBender",
|
||||
"url": "https://github.com/BendingBender",
|
||||
"githubUsername": "BendingBender"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/keyv"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "e83393e0860475d12e960cede22532e18e129cf659f31f2a0298a88cb5d02d36",
|
||||
"typeScriptVersion": "3.9"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"scheduleArray.js","sources":["../../../src/internal/scheduled/scheduleArray.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,UAAU,aAAa,CAAI,KAAmB,EAAE,SAAwB;IAC5E,OAAO,IAAI,UAAU,CAAI,UAAA,UAAU;QACjC,IAAM,GAAG,GAAG,IAAI,YAAY,EAAE,CAAC;QAC/B,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC;YACzB,IAAI,CAAC,KAAK,KAAK,CAAC,MAAM,EAAE;gBACtB,UAAU,CAAC,QAAQ,EAAE,CAAC;gBACtB,OAAO;aACR;YACD,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC5B,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE;gBACtB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;aAC1B;QACH,CAAC,CAAC,CAAC,CAAC;QACJ,OAAO,GAAG,CAAC;IACb,CAAC,CAAC,CAAC;AACL,CAAC"}
|
||||
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var concat_1 = require("../observable/concat");
|
||||
function concat() {
|
||||
var observables = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
observables[_i] = arguments[_i];
|
||||
}
|
||||
return function (source) { return source.lift.call(concat_1.concat.apply(void 0, [source].concat(observables))); };
|
||||
}
|
||||
exports.concat = concat;
|
||||
//# sourceMappingURL=concat.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"windowWhen.js","sources":["../../../src/internal/operators/windowWhen.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAgD9D,MAAM,UAAU,UAAU,CAAI,eAAsC;IAClE,OAAO,SAAS,0BAA0B,CAAC,MAAqB;QAC9D,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,cAAc,CAAI,eAAe,CAAC,CAAC,CAAC;IAC7D,CAAC,CAAC;AACJ,CAAC;AAED,MAAM,cAAc;IAClB,YAAoB,eAAsC;QAAtC,oBAAe,GAAf,eAAe,CAAuB;IAC1D,CAAC;IAED,IAAI,CAAC,UAAqC,EAAE,MAAW;QACrD,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IAClF,CAAC;C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AAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED,2CAAc,GAAd;QACE,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED,sCAAS,GAAT;QACE,IAAI,IAAI,CAAC,QAAQ,EAAE;YACjB,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;YACzB,IAAM,YAAY,GAAG,IAAI,CAAC,oBAAoB,CAAC;YAC/C,IAAI,YAAY,EAAE;gBAChB,IAAI,CAAC,oBAAoB,GAAG,SAAS,CAAC;gBACtC,YAAY,CAAC,WAAW,EAAE,CAAC;gBAC3B,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;aAC3B;YAMD,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;YACvB,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;YACtB,iBAAM,KAAK,YAAC,KAAM,CAAC,CAAC;SACrB;IACH,CAAC;IACH,yBAAC;AAAD,CAAC,AArED,CAAuC,sCAAqB,GAqE3D"}
|
||||
@@ -0,0 +1,111 @@
|
||||
'use strict';
|
||||
|
||||
class CancelError extends Error {
|
||||
constructor(reason) {
|
||||
super(reason || 'Promise was canceled');
|
||||
this.name = 'CancelError';
|
||||
}
|
||||
|
||||
get isCanceled() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class PCancelable {
|
||||
static fn(userFn) {
|
||||
return (...arguments_) => {
|
||||
return new PCancelable((resolve, reject, onCancel) => {
|
||||
arguments_.push(onCancel);
|
||||
// eslint-disable-next-line promise/prefer-await-to-then
|
||||
userFn(...arguments_).then(resolve, reject);
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
constructor(executor) {
|
||||
this._cancelHandlers = [];
|
||||
this._isPending = true;
|
||||
this._isCanceled = false;
|
||||
this._rejectOnCancel = true;
|
||||
|
||||
this._promise = new Promise((resolve, reject) => {
|
||||
this._reject = reject;
|
||||
|
||||
const onResolve = value => {
|
||||
if (!this._isCanceled || !onCancel.shouldReject) {
|
||||
this._isPending = false;
|
||||
resolve(value);
|
||||
}
|
||||
};
|
||||
|
||||
const onReject = error => {
|
||||
this._isPending = false;
|
||||
reject(error);
|
||||
};
|
||||
|
||||
const onCancel = handler => {
|
||||
if (!this._isPending) {
|
||||
throw new Error('The `onCancel` handler was attached after the promise settled.');
|
||||
}
|
||||
|
||||
this._cancelHandlers.push(handler);
|
||||
};
|
||||
|
||||
Object.defineProperties(onCancel, {
|
||||
shouldReject: {
|
||||
get: () => this._rejectOnCancel,
|
||||
set: boolean => {
|
||||
this._rejectOnCancel = boolean;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return executor(onResolve, onReject, onCancel);
|
||||
});
|
||||
}
|
||||
|
||||
then(onFulfilled, onRejected) {
|
||||
// eslint-disable-next-line promise/prefer-await-to-then
|
||||
return this._promise.then(onFulfilled, onRejected);
|
||||
}
|
||||
|
||||
catch(onRejected) {
|
||||
return this._promise.catch(onRejected);
|
||||
}
|
||||
|
||||
finally(onFinally) {
|
||||
return this._promise.finally(onFinally);
|
||||
}
|
||||
|
||||
cancel(reason) {
|
||||
if (!this._isPending || this._isCanceled) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._isCanceled = true;
|
||||
|
||||
if (this._cancelHandlers.length > 0) {
|
||||
try {
|
||||
for (const handler of this._cancelHandlers) {
|
||||
handler();
|
||||
}
|
||||
} catch (error) {
|
||||
this._reject(error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (this._rejectOnCancel) {
|
||||
this._reject(new CancelError(reason));
|
||||
}
|
||||
}
|
||||
|
||||
get isCanceled() {
|
||||
return this._isCanceled;
|
||||
}
|
||||
}
|
||||
|
||||
Object.setPrototypeOf(PCancelable.prototype, Promise.prototype);
|
||||
|
||||
module.exports = PCancelable;
|
||||
module.exports.CancelError = CancelError;
|
||||
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function applyMixins(derivedCtor, baseCtors) {
|
||||
for (var i = 0, len = baseCtors.length; i < len; i++) {
|
||||
var baseCtor = baseCtors[i];
|
||||
var propertyKeys = Object.getOwnPropertyNames(baseCtor.prototype);
|
||||
for (var j = 0, len2 = propertyKeys.length; j < len2; j++) {
|
||||
var name_1 = propertyKeys[j];
|
||||
derivedCtor.prototype[name_1] = baseCtor.prototype[name_1];
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.applyMixins = applyMixins;
|
||||
//# sourceMappingURL=applyMixins.js.map
|
||||
@@ -0,0 +1,13 @@
|
||||
export interface TimeoutError extends Error {
|
||||
}
|
||||
export interface TimeoutErrorCtor {
|
||||
new (): TimeoutError;
|
||||
}
|
||||
/**
|
||||
* An error thrown when duetime elapses.
|
||||
*
|
||||
* @see {@link operators/timeout}
|
||||
*
|
||||
* @class TimeoutError
|
||||
*/
|
||||
export declare const TimeoutError: TimeoutErrorCtor;
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"throttleTime.js","sources":["../../src/add/operator/throttleTime.ts"],"names":[],"mappings":";;AAAA,iDAA+C"}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "assert",
|
||||
"main": "assert.js",
|
||||
"version": "0.1.0",
|
||||
"homepage": "https://github.com/jgallen23/assert",
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
],
|
||||
"_release": "0.1.0",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "0.1.0",
|
||||
"commit": "6a955e68d0dceba3e682faa895ef54828623e27a"
|
||||
},
|
||||
"_source": "https://github.com/jgallen23/assert.git",
|
||||
"_target": "~0.1.0",
|
||||
"_originalSource": "assert"
|
||||
}
|
||||
Reference in New Issue
Block a user