new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"AnimationFrameAction.js","sources":["../../../src/internal/scheduler/AnimationFrameAction.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAS5C;IAA6C,gDAAc;IAEzD,8BAAsB,SAAkC,EAClC,IAAmD;QADzE,YAEE,kBAAM,SAAS,EAAE,IAAI,CAAC,SACvB;QAHqB,eAAS,GAAT,SAAS,CAAyB;QAClC,UAAI,GAAJ,IAAI,CAA+C;;IAEzE,CAAC;IAES,6CAAc,GAAxB,UAAyB,SAAkC,EAAE,EAAQ,EAAE,KAAiB;QAAjB,sBAAA,EAAA,SAAiB;QAEtF,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,GAAG,CAAC,EAAE;YAC/B,OAAO,iBAAM,cAAc,YAAC,SAAS,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;SACnD;QAED,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAI7B,OAAO,SAAS,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,qBAAqB,CACxE,cAAM,OAAA,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,EAArB,CAAqB,CAAC,CAAC,CAAC;IAClC,CAAC;IACS,6CAAc,GAAxB,UAAyB,SAAkC,EAAE,EAAQ,EAAE,KAAiB;QAAjB,sBAAA,EAAA,SAAiB;QAItF,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,IAAI,IAAI,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,EAAE;YACvE,OAAO,iBAAM,cAAc,YAAC,SAAS,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;SACnD;QAID,IAAI,SAAS,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;YAClC,oBAAoB,CAAC,EAAE,CAAC,CAAC;YACzB,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC;SACjC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;IACH,2BAAC;AAAD,CAAC,AArCD,CAA6C,WAAW,GAqCvD"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"reduce.js","sources":["../../../src/internal/operators/reduce.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AA2DpC,MAAM,UAAU,MAAM,CAAO,WAA4D,EAAE,IAAY;IAMrG,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE;QACzB,OAAO,SAAS,8BAA8B,CAAC,MAAqB;YAClE,OAAO,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAClF,CAAC,CAAC;KACH;IACD,OAAO,SAAS,sBAAsB,CAAC,MAAqB;QAC1D,OAAO,IAAI,CACT,IAAI,CAAW,UAAC,GAAG,EAAE,KAAK,EAAE,KAAK,IAAK,OAAA,WAAW,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,GAAG,CAAC,CAAC,EAAlC,CAAkC,CAAC,EACzE,QAAQ,CAAC,CAAC,CAAC,CACZ,CAAC,MAAM,CAAC,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC"}
|
||||
@@ -0,0 +1,64 @@
|
||||
|
||||
export { config } from '../internal/config';
|
||||
export { InnerSubscriber } from '../internal/InnerSubscriber';
|
||||
export { OuterSubscriber } from '../internal/OuterSubscriber';
|
||||
export { Scheduler } from '../internal/Scheduler';
|
||||
export { AnonymousSubject } from '../internal/Subject';
|
||||
export { SubjectSubscription } from '../internal/SubjectSubscription';
|
||||
export { Subscriber } from '../internal/Subscriber';
|
||||
|
||||
export { fromPromise } from '../internal/observable/fromPromise';
|
||||
export { fromIterable } from '../internal/observable/fromIterable';
|
||||
export { ajax } from '../internal/observable/dom/ajax';
|
||||
export { webSocket } from '../internal/observable/dom/webSocket';
|
||||
export { AjaxRequest, AjaxCreationMethod, ajaxGet, ajaxPost, ajaxDelete, ajaxPut, ajaxPatch, ajaxGetJSON,
|
||||
AjaxObservable, AjaxSubscriber, AjaxResponse, AjaxError, AjaxTimeoutError } from '../internal/observable/dom/AjaxObservable';
|
||||
export { WebSocketSubjectConfig, WebSocketSubject } from '../internal/observable/dom/WebSocketSubject';
|
||||
export { CombineLatestOperator } from '../internal/observable/combineLatest';
|
||||
export { EventTargetLike } from '../internal/observable/fromEvent';
|
||||
export { ConditionFunc, IterateFunc, ResultFunc, GenerateBaseOptions, GenerateOptions } from '../internal/observable/generate';
|
||||
export { dispatch } from '../internal/observable/range';
|
||||
export { SubscribeOnObservable } from '../internal/observable/SubscribeOnObservable';
|
||||
|
||||
export { Timestamp } from '../internal/operators/timestamp';
|
||||
export { TimeInterval } from '../internal/operators/timeInterval';
|
||||
export { GroupedObservable } from '../internal/operators/groupBy';
|
||||
export { ShareReplayConfig } from '../internal/operators/shareReplay';
|
||||
export { ThrottleConfig, defaultThrottleConfig } from '../internal/operators/throttle';
|
||||
|
||||
export { rxSubscriber } from '../internal/symbol/rxSubscriber';
|
||||
export { iterator } from '../internal/symbol/iterator';
|
||||
export { observable } from '../internal/symbol/observable';
|
||||
|
||||
export { ArgumentOutOfRangeError } from '../internal/util/ArgumentOutOfRangeError';
|
||||
export { EmptyError } from '../internal/util/EmptyError';
|
||||
export { Immediate } from '../internal/util/Immediate';
|
||||
export { ObjectUnsubscribedError } from '../internal/util/ObjectUnsubscribedError';
|
||||
export { TimeoutError } from '../internal/util/TimeoutError';
|
||||
export { UnsubscriptionError } from '../internal/util/UnsubscriptionError';
|
||||
export { applyMixins } from '../internal/util/applyMixins';
|
||||
export { errorObject } from '../internal/util/errorObject';
|
||||
export { hostReportError } from '../internal/util/hostReportError';
|
||||
export { identity } from '../internal/util/identity';
|
||||
export { isArray } from '../internal/util/isArray';
|
||||
export { isArrayLike } from '../internal/util/isArrayLike';
|
||||
export { isDate } from '../internal/util/isDate';
|
||||
export { isFunction } from '../internal/util/isFunction';
|
||||
export { isIterable } from '../internal/util/isIterable';
|
||||
export { isNumeric } from '../internal/util/isNumeric';
|
||||
export { isObject } from '../internal/util/isObject';
|
||||
export { isInteropObservable as isObservable } from '../internal/util/isInteropObservable';
|
||||
export { isPromise } from '../internal/util/isPromise';
|
||||
export { isScheduler } from '../internal/util/isScheduler';
|
||||
export { noop } from '../internal/util/noop';
|
||||
export { not } from '../internal/util/not';
|
||||
export { pipe } from '../internal/util/pipe';
|
||||
export { root } from '../internal/util/root';
|
||||
export { subscribeTo } from '../internal/util/subscribeTo';
|
||||
export { subscribeToArray } from '../internal/util/subscribeToArray';
|
||||
export { subscribeToIterable } from '../internal/util/subscribeToIterable';
|
||||
export { subscribeToObservable } from '../internal/util/subscribeToObservable';
|
||||
export { subscribeToPromise } from '../internal/util/subscribeToPromise';
|
||||
export { subscribeToResult } from '../internal/util/subscribeToResult';
|
||||
export { toSubscriber } from '../internal/util/toSubscriber';
|
||||
export { tryCatch } from '../internal/util/tryCatch';
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={C:{"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0.00242,"48":0,"49":0,"50":0,"51":0,"52":0.00242,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"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.00242,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0.00242,"100":0,"101":0,"102":0.00485,"103":0.00242,"104":0.00242,"105":0.00242,"106":0.00242,"107":0.00727,"108":0.17688,"109":0.11873,"110":0.00727,"111":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.00242,"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.00242,"64":0,"65":0,"66":0,"67":0,"68":0.00242,"69":0.00242,"70":0.00485,"71":0.00485,"72":0.00242,"73":0,"74":0.01212,"75":0,"76":0,"77":0.00242,"78":0.00242,"79":0.00485,"80":0.00485,"81":0.00485,"83":0.00727,"84":0.00242,"85":0.00242,"86":0.00727,"87":0.01212,"88":0.00242,"89":0.00242,"90":0.00485,"91":0.00727,"92":0.00485,"93":0.00242,"94":0.00969,"95":0.00485,"96":0.00969,"97":0.00727,"98":0.00485,"99":0.00969,"100":0.00727,"101":0.00727,"102":0.00969,"103":0.0315,"104":0.01938,"105":0.01938,"106":0.02423,"107":0.06784,"108":2.05228,"109":2.11286,"110":0.00485,"111":0,"112":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,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0.00242,"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.00242,"56":0,"57":0,"58":0.00242,"60":0.00242,"62":0,"63":0.00727,"64":0.00727,"65":0.00485,"66":0.00727,"67":0.00727,"68":0,"69":0,"70":0,"71":0,"72":0.00242,"73":0.02423,"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.00242,"93":0.00727,"94":0.03877,"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.00242,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0.00242,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0.00242,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0.00242,"106":0.00242,"107":0.00485,"108":0.1163,"109":0.11146},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0.00242,"15":0,_:"0","3.1":0,"3.2":0,"5.1":0,"6.1":0,"7.1":0,"9.1":0,"10.1":0,"11.1":0,"12.1":0,"13.1":0.00242,"14.1":0.00242,"15.1":0,"15.2-15.3":0,"15.4":0.00242,"15.5":0.00242,"15.6":0.01212,"16.0":0.00242,"16.1":0.00969,"16.2":0.01696,"16.3":0.00242},G:{"8":0.00058,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0,"7.0-7.1":0.00585,"8.1-8.4":0,"9.0-9.2":0.00029,"9.3":0.00526,"10.0-10.2":0.00058,"10.3":0.00497,"11.0-11.2":0.00555,"11.3-11.4":0.00117,"12.0-12.1":0.00409,"12.2-12.5":0.07249,"13.0-13.1":0.00263,"13.2":0.00234,"13.3":0.00526,"13.4-13.7":0.01461,"14.0-14.4":0.05232,"14.5-14.8":0.07249,"15.0-15.1":0.05232,"15.2-15.3":0.04472,"15.4":0.03946,"15.5":0.08623,"15.6":0.19175,"16.0":0.31159,"16.1":0.6299,"16.2":0.98796,"16.3":0.11253},P:{"4":0.09092,"5.0-5.4":0,"6.2-6.4":0.0101,"7.2-7.4":0.06062,"8.2":0,"9.2":0.0101,"10.1":0,"11.1-11.2":0.0101,"12.0":0.0101,"13.0":0.03031,"14.0":0.02021,"15.0":0.0101,"16.0":0.05051,"17.0":0.04041,"18.0":0.06062,"19.0":0.50513},I:{"0":0,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.03485},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.00727,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.14396},Q:{"13.1":0},O:{"0":1.92456},H:{"0":2.24528},L:{"0":84.81215},S:{"2.5":0.40916}};
|
||||
@@ -0,0 +1,140 @@
|
||||
import { Operator } from '../Operator';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { Observable } from '../Observable';
|
||||
import { Subscription } from '../Subscription';
|
||||
import { OperatorFunction } from '../types';
|
||||
import { SimpleOuterSubscriber, innerSubscribe, SimpleInnerSubscriber } from '../innerSubscribe';
|
||||
|
||||
/**
|
||||
* Buffers the source Observable values, using a factory function of closing
|
||||
* Observables to determine when to close, emit, and reset the buffer.
|
||||
*
|
||||
* <span class="informal">Collects values from the past as an array. When it
|
||||
* starts collecting values, it calls a function that returns an Observable that
|
||||
* tells when to close the buffer and restart collecting.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* Opens a buffer immediately, then closes the buffer when the observable
|
||||
* returned by calling `closingSelector` function emits a value. When it closes
|
||||
* the buffer, it immediately opens a new buffer and repeats the process.
|
||||
*
|
||||
* ## Example
|
||||
*
|
||||
* Emit an array of the last clicks every [1-5] random seconds
|
||||
*
|
||||
* ```ts
|
||||
* import { fromEvent, interval } from 'rxjs';
|
||||
* import { bufferWhen } from 'rxjs/operators';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const buffered = clicks.pipe(bufferWhen(() =>
|
||||
* interval(1000 + Math.random() * 4000)
|
||||
* ));
|
||||
* buffered.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* @see {@link buffer}
|
||||
* @see {@link bufferCount}
|
||||
* @see {@link bufferTime}
|
||||
* @see {@link bufferToggle}
|
||||
* @see {@link windowWhen}
|
||||
*
|
||||
* @param {function(): Observable} closingSelector A function that takes no
|
||||
* arguments and returns an Observable that signals buffer closure.
|
||||
* @return {Observable<T[]>} An observable of arrays of buffered values.
|
||||
* @method bufferWhen
|
||||
* @owner Observable
|
||||
*/
|
||||
export function bufferWhen<T>(closingSelector: () => Observable<any>): OperatorFunction<T, T[]> {
|
||||
return function (source: Observable<T>) {
|
||||
return source.lift(new BufferWhenOperator(closingSelector));
|
||||
};
|
||||
}
|
||||
|
||||
class BufferWhenOperator<T> implements Operator<T, T[]> {
|
||||
|
||||
constructor(private closingSelector: () => Observable<any>) {
|
||||
}
|
||||
|
||||
call(subscriber: Subscriber<T[]>, source: any): any {
|
||||
return source.subscribe(new BufferWhenSubscriber(subscriber, this.closingSelector));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
class BufferWhenSubscriber<T> extends SimpleOuterSubscriber<T, any> {
|
||||
private buffer?: T[];
|
||||
private subscribing: boolean = false;
|
||||
private closingSubscription?: Subscription;
|
||||
|
||||
constructor(destination: Subscriber<T[]>, private closingSelector: () => Observable<any>) {
|
||||
super(destination);
|
||||
this.openBuffer();
|
||||
}
|
||||
|
||||
protected _next(value: T) {
|
||||
this.buffer!.push(value);
|
||||
}
|
||||
|
||||
protected _complete() {
|
||||
const buffer = this.buffer;
|
||||
if (buffer) {
|
||||
this.destination.next!(buffer);
|
||||
}
|
||||
super._complete();
|
||||
}
|
||||
|
||||
/** @deprecated This is an internal implementation detail, do not use. */
|
||||
_unsubscribe() {
|
||||
this.buffer = undefined;
|
||||
this.subscribing = false;
|
||||
}
|
||||
|
||||
notifyNext(): void {
|
||||
this.openBuffer();
|
||||
}
|
||||
|
||||
notifyComplete(): void {
|
||||
if (this.subscribing) {
|
||||
this.complete();
|
||||
} else {
|
||||
this.openBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
openBuffer() {
|
||||
let { closingSubscription } = this;
|
||||
|
||||
if (closingSubscription) {
|
||||
this.remove(closingSubscription);
|
||||
closingSubscription.unsubscribe();
|
||||
}
|
||||
|
||||
const buffer = this.buffer;
|
||||
if (this.buffer) {
|
||||
this.destination.next!(buffer);
|
||||
}
|
||||
|
||||
this.buffer = [];
|
||||
|
||||
let closingNotifier;
|
||||
try {
|
||||
const { closingSelector } = this;
|
||||
closingNotifier = closingSelector();
|
||||
} catch (err) {
|
||||
return this.error(err);
|
||||
}
|
||||
closingSubscription = new Subscription();
|
||||
this.closingSubscription = closingSubscription;
|
||||
this.add(closingSubscription);
|
||||
this.subscribing = true;
|
||||
closingSubscription.add(innerSubscribe(closingNotifier, new SimpleInnerSubscriber(this)));
|
||||
this.subscribing = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { ObservableInput } from '../types';
|
||||
import { from } from './from';
|
||||
import { isArray } from '../util/isArray';
|
||||
import { EMPTY } from './empty';
|
||||
|
||||
/* tslint:disable:max-line-length */
|
||||
export function onErrorResumeNext<R>(v: ObservableInput<R>): Observable<R>;
|
||||
export function onErrorResumeNext<T2, T3, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<R>;
|
||||
export function onErrorResumeNext<T2, T3, T4, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<R>;
|
||||
export function onErrorResumeNext<T2, T3, T4, T5, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<R>;
|
||||
export function onErrorResumeNext<T2, T3, T4, T5, T6, R>(v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<R>;
|
||||
|
||||
export function onErrorResumeNext<R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): Observable<R>;
|
||||
export function onErrorResumeNext<R>(array: ObservableInput<any>[]): Observable<R>;
|
||||
/* tslint:enable:max-line-length */
|
||||
|
||||
/**
|
||||
* When any of the provided Observable emits an complete or error notification, it immediately subscribes to the next one
|
||||
* that was passed.
|
||||
*
|
||||
* <span class="informal">Execute series of Observables no matter what, even if it means swallowing errors.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `onErrorResumeNext` Will subscribe to each observable source it is provided, in order.
|
||||
* If the source it's subscribed to emits an error or completes, it will move to the next source
|
||||
* without error.
|
||||
*
|
||||
* If `onErrorResumeNext` is provided no arguments, or a single, empty array, it will return {@link index/EMPTY}.
|
||||
*
|
||||
* `onErrorResumeNext` is basically {@link concat}, only it will continue, even if one of its
|
||||
* sources emits an error.
|
||||
*
|
||||
* Note that there is no way to handle any errors thrown by sources via the result of
|
||||
* `onErrorResumeNext`. If you want to handle errors thrown in any given source, you can
|
||||
* always use the {@link catchError} operator on them before passing them into `onErrorResumeNext`.
|
||||
*
|
||||
* ## Example
|
||||
* Subscribe to the next Observable after map fails</caption>
|
||||
* ```ts
|
||||
* import { onErrorResumeNext, of } from 'rxjs';
|
||||
* import { map } from 'rxjs/operators';
|
||||
*
|
||||
* onErrorResumeNext(
|
||||
* of(1, 2, 3, 0).pipe(
|
||||
* map(x => {
|
||||
* if (x === 0) throw Error();
|
||||
* return 10 / x;
|
||||
* })
|
||||
* ),
|
||||
* of(1, 2, 3),
|
||||
* )
|
||||
* .subscribe(
|
||||
* val => console.log(val),
|
||||
* err => console.log(err), // Will never be called.
|
||||
* () => console.log('done'),
|
||||
* );
|
||||
*
|
||||
* // Logs:
|
||||
* // 10
|
||||
* // 5
|
||||
* // 3.3333333333333335
|
||||
* // 1
|
||||
* // 2
|
||||
* // 3
|
||||
* // "done"
|
||||
* ```
|
||||
*
|
||||
* @see {@link concat}
|
||||
* @see {@link catchError}
|
||||
*
|
||||
* @param {...ObservableInput} sources Observables (or anything that *is* observable) passed either directly or as an array.
|
||||
* @return {Observable} An Observable that concatenates all sources, one after the other,
|
||||
* ignoring all errors, such that any error causes it to move on to the next source.
|
||||
*/
|
||||
export function onErrorResumeNext<T, R>(...sources: Array<ObservableInput<any> |
|
||||
Array<ObservableInput<any>> |
|
||||
((...values: Array<any>) => R)>): Observable<R> {
|
||||
|
||||
if (sources.length === 0) {
|
||||
return EMPTY;
|
||||
}
|
||||
|
||||
const [ first, ...remainder ] = sources;
|
||||
|
||||
if (sources.length === 1 && isArray(first)) {
|
||||
return onErrorResumeNext(...first);
|
||||
}
|
||||
|
||||
return new Observable(subscriber => {
|
||||
const subNext = () => subscriber.add(
|
||||
onErrorResumeNext(...remainder).subscribe(subscriber)
|
||||
);
|
||||
|
||||
return from(first).subscribe({
|
||||
next(value) { subscriber.next(value); },
|
||||
error: subNext,
|
||||
complete: subNext,
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
'use strict';
|
||||
const is = require('@sindresorhus/is');
|
||||
|
||||
module.exports = url => {
|
||||
const options = {
|
||||
protocol: url.protocol,
|
||||
hostname: url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,
|
||||
hash: url.hash,
|
||||
search: url.search,
|
||||
pathname: url.pathname,
|
||||
href: url.href
|
||||
};
|
||||
|
||||
if (is.string(url.port) && url.port.length > 0) {
|
||||
options.port = Number(url.port);
|
||||
}
|
||||
|
||||
if (url.username || url.password) {
|
||||
options.auth = `${url.username}:${url.password}`;
|
||||
}
|
||||
|
||||
options.path = is.null(url.search) ? url.pathname : `${url.pathname}${url.search}`;
|
||||
|
||||
return options;
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,96 @@
|
||||
declare const figureSet: {
|
||||
readonly tick: string;
|
||||
readonly cross: string;
|
||||
readonly star: string;
|
||||
readonly square: string;
|
||||
readonly squareSmall: string;
|
||||
readonly squareSmallFilled: string;
|
||||
readonly play: string;
|
||||
readonly circle: string;
|
||||
readonly circleFilled: string;
|
||||
readonly circleDotted: string;
|
||||
readonly circleDouble: string;
|
||||
readonly circleCircle: string;
|
||||
readonly circleCross: string;
|
||||
readonly circlePipe: string;
|
||||
readonly circleQuestionMark: string;
|
||||
readonly bullet: string;
|
||||
readonly dot: string;
|
||||
readonly line: string;
|
||||
readonly ellipsis: string;
|
||||
readonly pointer: string;
|
||||
readonly pointerSmall: string;
|
||||
readonly info: string;
|
||||
readonly warning: string;
|
||||
readonly hamburger: string;
|
||||
readonly smiley: string;
|
||||
readonly mustache: string;
|
||||
readonly heart: string;
|
||||
readonly nodejs: string;
|
||||
readonly arrowUp: string;
|
||||
readonly arrowDown: string;
|
||||
readonly arrowLeft: string;
|
||||
readonly arrowRight: string;
|
||||
readonly radioOn: string;
|
||||
readonly radioOff: string;
|
||||
readonly checkboxOn: string;
|
||||
readonly checkboxOff: string;
|
||||
readonly checkboxCircleOn: string;
|
||||
readonly checkboxCircleOff: string;
|
||||
readonly questionMarkPrefix: string;
|
||||
readonly oneHalf: string;
|
||||
readonly oneThird: string;
|
||||
readonly oneQuarter: string;
|
||||
readonly oneFifth: string;
|
||||
readonly oneSixth: string;
|
||||
readonly oneSeventh: string;
|
||||
readonly oneEighth: string;
|
||||
readonly oneNinth: string;
|
||||
readonly oneTenth: string;
|
||||
readonly twoThirds: string;
|
||||
readonly twoFifths: string;
|
||||
readonly threeQuarters: string;
|
||||
readonly threeFifths: string;
|
||||
readonly threeEighths: string;
|
||||
readonly fourFifths: string;
|
||||
readonly fiveSixths: string;
|
||||
readonly fiveEighths: string;
|
||||
readonly sevenEighth: string;
|
||||
}
|
||||
|
||||
type FigureSet = typeof figureSet
|
||||
|
||||
declare const figures: {
|
||||
/**
|
||||
Replace Unicode symbols depending on the OS.
|
||||
|
||||
@param string - String where the Unicode symbols will be replaced with fallback symbols depending on the OS.
|
||||
@returns The input with replaced fallback Unicode symbols on Windows.
|
||||
|
||||
@example
|
||||
```
|
||||
import figures = require('figures');
|
||||
|
||||
console.log(figures('✔︎ check'));
|
||||
// On non-Windows OSes: ✔︎ check
|
||||
// On Windows: √ check
|
||||
|
||||
console.log(figures.tick);
|
||||
// On non-Windows OSes: ✔︎
|
||||
// On Windows: √
|
||||
```
|
||||
*/
|
||||
(string: string): string;
|
||||
|
||||
/**
|
||||
Symbols to use when not running on Windows.
|
||||
*/
|
||||
readonly main: FigureSet;
|
||||
|
||||
/**
|
||||
Symbols to use when running on Windows.
|
||||
*/
|
||||
readonly windows: FigureSet;
|
||||
} & FigureSet;
|
||||
|
||||
export = figures;
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"@sindresorhus/is","version":"4.6.0","files":{"license":{"checkedAt":1678887829613,"integrity":"sha512-0fM2/ycrxrltyaBKfQ748Ck23VlPUUBgNAR47ldf4B1V/HoXTfWBSk+vcshGKwEpmOynu4mOP5o+hyBfuRNa8g==","mode":420,"size":1117},"dist/types.js":{"checkedAt":1678887829877,"integrity":"sha512-J8mJXA599wVc/gMb0t0iE2RpvHonu51NqP9B0oOXTsQmyj//TBWIp9PzMtQe3Hwjy2KVWmo0GtroEHRfOY+keQ==","mode":420,"size":194},"dist/index.js":{"checkedAt":1678887829877,"integrity":"sha512-KFT0HAFb+vZZ73raXb8HALCQ7516dF0/KZfSWkHb/mN9xD9QfFlUJW1pTphVWSfWHS+t41yelMBhezNSm19z0w==","mode":420,"size":21169},"package.json":{"checkedAt":1678887829877,"integrity":"sha512-fUAa2ithci/LMLaFWtRpPMCplkYIjPGx08tWcWrpxv+Io8zzWlAOqtg2MFtNkeqBV1JajfP5+M8L5CbumkXSVQ==","mode":420,"size":1826},"readme.md":{"checkedAt":1678887829881,"integrity":"sha512-fmpekGeGzU6eG0F65gCNetqPabQeOwMTeCx2rFKIsi+0j7QC6fyJSdOK6FyYRy2uXaSvfFLgKod4+LqVvBI1jg==","mode":420,"size":17370},"dist/types.d.ts":{"checkedAt":1678887829892,"integrity":"sha512-6Q4WXCObTdzRo66iwTIcQDIj/vx9wpC3eJYxsBmyNaodnxBo3osjhcIym+3Vox2ZojWN7ESijQ4oK5GzOtYdQQ==","mode":420,"size":1177},"dist/index.d.ts":{"checkedAt":1678887829892,"integrity":"sha512-S9tFElgEW8YhicsFGrqxZ3OdwWcueMc8/fZi/bPqyMecna0DLY41GnRLAYmIm6fj+TVfOsJJ2G1VKqxzjGmkKQ==","mode":420,"size":14604}}}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"concatMapTo.js","sources":["../../src/add/operator/concatMapTo.ts"],"names":[],"mappings":";;AAAA,gDAA8C"}
|
||||
@@ -0,0 +1,91 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { Operator } from '../Operator';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { EmptyError } from '../util/EmptyError';
|
||||
import { OperatorFunction } from '../../internal/types';
|
||||
import { filter } from './filter';
|
||||
import { take } from './take';
|
||||
import { defaultIfEmpty } from './defaultIfEmpty';
|
||||
import { throwIfEmpty } from './throwIfEmpty';
|
||||
import { identity } from '../util/identity';
|
||||
|
||||
/* tslint:disable:max-line-length */
|
||||
export function first<T, D = T>(
|
||||
predicate?: null,
|
||||
defaultValue?: D
|
||||
): OperatorFunction<T, T | D>;
|
||||
export function first<T, S extends T>(
|
||||
predicate: (value: T, index: number, source: Observable<T>) => value is S,
|
||||
defaultValue?: S
|
||||
): OperatorFunction<T, S>;
|
||||
export function first<T, D = T>(
|
||||
predicate: (value: T, index: number, source: Observable<T>) => boolean,
|
||||
defaultValue?: D
|
||||
): OperatorFunction<T, T | D>;
|
||||
/* tslint:enable:max-line-length */
|
||||
|
||||
/**
|
||||
* Emits only the first value (or the first value that meets some condition)
|
||||
* emitted by the source Observable.
|
||||
*
|
||||
* <span class="informal">Emits only the first value. Or emits only the first
|
||||
* value that passes some test.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* If called with no arguments, `first` emits the first value of the source
|
||||
* Observable, then completes. If called with a `predicate` function, `first`
|
||||
* emits the first value of the source that matches the specified condition. It
|
||||
* may also take a deprecated `resultSelector` function to produce the output
|
||||
* value from the input value, and a `defaultValue` to emit in case the source
|
||||
* completes before it is able to emit a valid value. Throws an error if
|
||||
* `defaultValue` was not provided and a matching element is not found.
|
||||
*
|
||||
* ## Examples
|
||||
* Emit only the first click that happens on the DOM
|
||||
* ```ts
|
||||
* import { fromEvent } from 'rxjs';
|
||||
* import { first } from 'rxjs/operators';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const result = clicks.pipe(first());
|
||||
* result.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* Emits the first click that happens on a DIV
|
||||
* ```ts
|
||||
* import { fromEvent } from 'rxjs';
|
||||
* import { first } from 'rxjs/operators';
|
||||
*
|
||||
* const clicks = fromEvent(document, 'click');
|
||||
* const result = clicks.pipe(first(ev => ev.target.tagName === 'DIV'));
|
||||
* result.subscribe(x => console.log(x));
|
||||
* ```
|
||||
*
|
||||
* @see {@link filter}
|
||||
* @see {@link find}
|
||||
* @see {@link take}
|
||||
*
|
||||
* @throws {EmptyError} Delivers an EmptyError to the Observer's `error`
|
||||
* callback if the Observable completes before any `next` notification was sent.
|
||||
*
|
||||
* @param {function(value: T, index: number, source: Observable<T>): boolean} [predicate]
|
||||
* An optional function called with each item to test for condition matching.
|
||||
* @param {R} [defaultValue] The default value emitted in case no valid value
|
||||
* was found on the source.
|
||||
* @return {Observable<T|R>} An Observable of the first item that matches the
|
||||
* condition.
|
||||
* @method first
|
||||
* @owner Observable
|
||||
*/
|
||||
export function first<T, D>(
|
||||
predicate?: ((value: T, index: number, source: Observable<T>) => boolean) | null,
|
||||
defaultValue?: D
|
||||
): OperatorFunction<T, T | D> {
|
||||
const hasDefaultValue = arguments.length >= 2;
|
||||
return (source: Observable<T>) => source.pipe(
|
||||
predicate ? filter((v, i) => predicate(v, i, source)) : identity,
|
||||
take(1),
|
||||
hasDefaultValue ? defaultIfEmpty<T | D>(defaultValue) : throwIfEmpty(() => new EmptyError()),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
// classList
|
||||
// https://developer.mozilla.org/en/DOM/element.classList
|
||||
// By Addy Osmani
|
||||
Modernizr.addTest('classlist', 'classList' in document.documentElement);
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("rxjs-compat/operator/timeInterval"));
|
||||
//# sourceMappingURL=timeInterval.js.map
|
||||
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("rxjs-compat/operator/publishBehavior"));
|
||||
//# sourceMappingURL=publishBehavior.js.map
|
||||
@@ -0,0 +1,104 @@
|
||||
import Node from './node.js'
|
||||
|
||||
export interface WarningOptions {
|
||||
/**
|
||||
* CSS node that caused the warning.
|
||||
*/
|
||||
node?: Node
|
||||
|
||||
/**
|
||||
* Word in CSS source that caused the warning.
|
||||
*/
|
||||
word?: string
|
||||
|
||||
/**
|
||||
* Index in CSS node string that caused the warning.
|
||||
*/
|
||||
index?: number
|
||||
|
||||
/**
|
||||
* Name of the plugin that created this warning. `Result#warn` fills
|
||||
* this property automatically.
|
||||
*/
|
||||
plugin?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a plugin’s warning. It can be created using `Node#warn`.
|
||||
*
|
||||
* ```js
|
||||
* if (decl.important) {
|
||||
* decl.warn(result, 'Avoid !important', { word: '!important' })
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
export default class Warning {
|
||||
/**
|
||||
* Type to filter warnings from `Result#messages`.
|
||||
* Always equal to `"warning"`.
|
||||
*/
|
||||
type: 'warning'
|
||||
|
||||
/**
|
||||
* The warning message.
|
||||
*
|
||||
* ```js
|
||||
* warning.text //=> 'Try to avoid !important'
|
||||
* ```
|
||||
*/
|
||||
text: string
|
||||
|
||||
/**
|
||||
* The name of the plugin that created this warning.
|
||||
* When you call `Node#warn` it will fill this property automatically.
|
||||
*
|
||||
* ```js
|
||||
* warning.plugin //=> 'postcss-important'
|
||||
* ```
|
||||
*/
|
||||
plugin: string
|
||||
|
||||
/**
|
||||
* Contains the CSS node that caused the warning.
|
||||
*
|
||||
* ```js
|
||||
* warning.node.toString() //=> 'color: white !important'
|
||||
* ```
|
||||
*/
|
||||
node: Node
|
||||
|
||||
/**
|
||||
* Line in the input file with this warning’s source.
|
||||
*
|
||||
* ```js
|
||||
* warning.line //=> 5
|
||||
* ```
|
||||
*/
|
||||
line: number
|
||||
|
||||
/**
|
||||
* Column in the input file with this warning’s source.
|
||||
*
|
||||
* ```js
|
||||
* warning.column //=> 6
|
||||
* ```
|
||||
*/
|
||||
column: number
|
||||
|
||||
/**
|
||||
* @param text Warning message.
|
||||
* @param opts Warning options.
|
||||
*/
|
||||
constructor(text: string, opts?: WarningOptions)
|
||||
|
||||
/**
|
||||
* Returns a warning position and message.
|
||||
*
|
||||
* ```js
|
||||
* warning.toString() //=> 'postcss-lint:a.css:10:14: Avoid !important'
|
||||
* ```
|
||||
*
|
||||
* @return Warning position and message.
|
||||
*/
|
||||
toString(): string
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"2":"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:{"2":"0 1 2 3 4 5 6 7 8 9 CC tB 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 DC EC"},D:{"2":"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","33":"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"},E:{"2":"GC zB","33":"I u J E F G A B C K L H HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"2":"G B C 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 OC PC QC RC qB 9B SC rB","33":"0 1 2 3 4 5 6 7 8 9 H M N O v w x y z AB"},G:{"33":"F zB TC AC UC VC WC XC YC ZC 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:{"2":"D","33":"tB I oC pC qC rC AC sC tC"},J:{"33":"E A"},K:{"2":"A B C e qB 9B rB"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"uC"},P:{"2":"vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","33":"I"},Q:{"2":"1B"},R:{"2":"8C"},S:{"2":"9C"}},B:7,C:"CSS Canvas Drawings"};
|
||||
@@ -0,0 +1,64 @@
|
||||
/** PURE_IMPORTS_START tslib,_Subscriber,_scheduler_async PURE_IMPORTS_END */
|
||||
import * as tslib_1 from "tslib";
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { async } from '../scheduler/async';
|
||||
export function debounceTime(dueTime, scheduler) {
|
||||
if (scheduler === void 0) {
|
||||
scheduler = async;
|
||||
}
|
||||
return function (source) { return source.lift(new DebounceTimeOperator(dueTime, scheduler)); };
|
||||
}
|
||||
var DebounceTimeOperator = /*@__PURE__*/ (function () {
|
||||
function DebounceTimeOperator(dueTime, scheduler) {
|
||||
this.dueTime = dueTime;
|
||||
this.scheduler = scheduler;
|
||||
}
|
||||
DebounceTimeOperator.prototype.call = function (subscriber, source) {
|
||||
return source.subscribe(new DebounceTimeSubscriber(subscriber, this.dueTime, this.scheduler));
|
||||
};
|
||||
return DebounceTimeOperator;
|
||||
}());
|
||||
var DebounceTimeSubscriber = /*@__PURE__*/ (function (_super) {
|
||||
tslib_1.__extends(DebounceTimeSubscriber, _super);
|
||||
function DebounceTimeSubscriber(destination, dueTime, scheduler) {
|
||||
var _this = _super.call(this, destination) || this;
|
||||
_this.dueTime = dueTime;
|
||||
_this.scheduler = scheduler;
|
||||
_this.debouncedSubscription = null;
|
||||
_this.lastValue = null;
|
||||
_this.hasValue = false;
|
||||
return _this;
|
||||
}
|
||||
DebounceTimeSubscriber.prototype._next = function (value) {
|
||||
this.clearDebounce();
|
||||
this.lastValue = value;
|
||||
this.hasValue = true;
|
||||
this.add(this.debouncedSubscription = this.scheduler.schedule(dispatchNext, this.dueTime, this));
|
||||
};
|
||||
DebounceTimeSubscriber.prototype._complete = function () {
|
||||
this.debouncedNext();
|
||||
this.destination.complete();
|
||||
};
|
||||
DebounceTimeSubscriber.prototype.debouncedNext = function () {
|
||||
this.clearDebounce();
|
||||
if (this.hasValue) {
|
||||
var lastValue = this.lastValue;
|
||||
this.lastValue = null;
|
||||
this.hasValue = false;
|
||||
this.destination.next(lastValue);
|
||||
}
|
||||
};
|
||||
DebounceTimeSubscriber.prototype.clearDebounce = function () {
|
||||
var debouncedSubscription = this.debouncedSubscription;
|
||||
if (debouncedSubscription !== null) {
|
||||
this.remove(debouncedSubscription);
|
||||
debouncedSubscription.unsubscribe();
|
||||
this.debouncedSubscription = null;
|
||||
}
|
||||
};
|
||||
return DebounceTimeSubscriber;
|
||||
}(Subscriber));
|
||||
function dispatchNext(subscriber) {
|
||||
subscriber.debouncedNext();
|
||||
}
|
||||
//# sourceMappingURL=debounceTime.js.map
|
||||
@@ -0,0 +1,95 @@
|
||||
"use strict";
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
}
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var map_1 = require("./map");
|
||||
var from_1 = require("../observable/from");
|
||||
var innerSubscribe_1 = require("../innerSubscribe");
|
||||
function exhaustMap(project, resultSelector) {
|
||||
if (resultSelector) {
|
||||
return function (source) { return source.pipe(exhaustMap(function (a, i) { return from_1.from(project(a, i)).pipe(map_1.map(function (b, ii) { return resultSelector(a, b, i, ii); })); })); };
|
||||
}
|
||||
return function (source) {
|
||||
return source.lift(new ExhaustMapOperator(project));
|
||||
};
|
||||
}
|
||||
exports.exhaustMap = exhaustMap;
|
||||
var ExhaustMapOperator = (function () {
|
||||
function ExhaustMapOperator(project) {
|
||||
this.project = project;
|
||||
}
|
||||
ExhaustMapOperator.prototype.call = function (subscriber, source) {
|
||||
return source.subscribe(new ExhaustMapSubscriber(subscriber, this.project));
|
||||
};
|
||||
return ExhaustMapOperator;
|
||||
}());
|
||||
var ExhaustMapSubscriber = (function (_super) {
|
||||
__extends(ExhaustMapSubscriber, _super);
|
||||
function ExhaustMapSubscriber(destination, project) {
|
||||
var _this = _super.call(this, destination) || this;
|
||||
_this.project = project;
|
||||
_this.hasSubscription = false;
|
||||
_this.hasCompleted = false;
|
||||
_this.index = 0;
|
||||
return _this;
|
||||
}
|
||||
ExhaustMapSubscriber.prototype._next = function (value) {
|
||||
if (!this.hasSubscription) {
|
||||
this.tryNext(value);
|
||||
}
|
||||
};
|
||||
ExhaustMapSubscriber.prototype.tryNext = function (value) {
|
||||
var result;
|
||||
var index = this.index++;
|
||||
try {
|
||||
result = this.project(value, index);
|
||||
}
|
||||
catch (err) {
|
||||
this.destination.error(err);
|
||||
return;
|
||||
}
|
||||
this.hasSubscription = true;
|
||||
this._innerSub(result);
|
||||
};
|
||||
ExhaustMapSubscriber.prototype._innerSub = function (result) {
|
||||
var innerSubscriber = new innerSubscribe_1.SimpleInnerSubscriber(this);
|
||||
var destination = this.destination;
|
||||
destination.add(innerSubscriber);
|
||||
var innerSubscription = innerSubscribe_1.innerSubscribe(result, innerSubscriber);
|
||||
if (innerSubscription !== innerSubscriber) {
|
||||
destination.add(innerSubscription);
|
||||
}
|
||||
};
|
||||
ExhaustMapSubscriber.prototype._complete = function () {
|
||||
this.hasCompleted = true;
|
||||
if (!this.hasSubscription) {
|
||||
this.destination.complete();
|
||||
}
|
||||
this.unsubscribe();
|
||||
};
|
||||
ExhaustMapSubscriber.prototype.notifyNext = function (innerValue) {
|
||||
this.destination.next(innerValue);
|
||||
};
|
||||
ExhaustMapSubscriber.prototype.notifyError = function (err) {
|
||||
this.destination.error(err);
|
||||
};
|
||||
ExhaustMapSubscriber.prototype.notifyComplete = function () {
|
||||
this.hasSubscription = false;
|
||||
if (this.hasCompleted) {
|
||||
this.destination.complete();
|
||||
}
|
||||
};
|
||||
return ExhaustMapSubscriber;
|
||||
}(innerSubscribe_1.SimpleOuterSubscriber));
|
||||
//# sourceMappingURL=exhaustMap.js.map
|
||||
@@ -0,0 +1,52 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isCreditCard;
|
||||
|
||||
var _assertString = _interopRequireDefault(require("./util/assertString"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
/* eslint-disable max-len */
|
||||
var creditCard = /^(?:4[0-9]{12}(?:[0-9]{3,6})?|5[1-5][0-9]{14}|(222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}|6(?:011|5[0-9][0-9])[0-9]{12,15}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11}|6[27][0-9]{14})$/;
|
||||
/* eslint-enable max-len */
|
||||
|
||||
function isCreditCard(str) {
|
||||
(0, _assertString.default)(str);
|
||||
var sanitized = str.replace(/[- ]+/g, '');
|
||||
|
||||
if (!creditCard.test(sanitized)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var sum = 0;
|
||||
var digit;
|
||||
var tmpNum;
|
||||
var shouldDouble;
|
||||
|
||||
for (var i = sanitized.length - 1; i >= 0; i--) {
|
||||
digit = sanitized.substring(i, i + 1);
|
||||
tmpNum = parseInt(digit, 10);
|
||||
|
||||
if (shouldDouble) {
|
||||
tmpNum *= 2;
|
||||
|
||||
if (tmpNum >= 10) {
|
||||
sum += tmpNum % 10 + 1;
|
||||
} else {
|
||||
sum += tmpNum;
|
||||
}
|
||||
} else {
|
||||
sum += tmpNum;
|
||||
}
|
||||
|
||||
shouldDouble = !shouldDouble;
|
||||
}
|
||||
|
||||
return !!(sum % 10 === 0 ? sanitized : false);
|
||||
}
|
||||
|
||||
module.exports = exports.default;
|
||||
module.exports.default = exports.default;
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
|
||||
"name": "combined-stream",
|
||||
"description": "A stream that emits multiple other streams one after another.",
|
||||
"version": "1.0.8",
|
||||
"homepage": "https://github.com/felixge/node-combined-stream",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/felixge/node-combined-stream.git"
|
||||
},
|
||||
"main": "./lib/combined_stream",
|
||||
"scripts": {
|
||||
"test": "node test/run.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"dependencies": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"far": "~0.0.7"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
#!/usr/bin/env node
|
||||
/* adler32.js (C) 2014-present SheetJS -- http://sheetjs.com */
|
||||
/* eslint-env node */
|
||||
/* vim: set ts=2 ft=javascript: */
|
||||
/*jshint node:true */
|
||||
|
||||
var X/*:ADLER32Module*/;
|
||||
try { X = require('../'); } catch(e) { X = require('adler-32'); }
|
||||
|
||||
function help()/*:number*/ {
|
||||
[
|
||||
"usage: adler32 [options] [filename]",
|
||||
"",
|
||||
"Options:",
|
||||
" -h, --help output usage information",
|
||||
" -V, --version output the version number",
|
||||
" -S, --seed=<n> use integer seed as starting value (default 1)",
|
||||
" -H, --hex-seed=<h> use hex seed as starting value (default 1)",
|
||||
" -d, --signed print result with format `%d` (default)",
|
||||
" -u, --unsigned print result with format `%u`",
|
||||
" -x, --hex print result with format `%0.8x`",
|
||||
" -X, --HEX print result with format `%0.8X`",
|
||||
" -F, --format=<s> use specified printf format",
|
||||
"",
|
||||
"Set filename = '-' or pipe data into adler32 to read from stdin",
|
||||
"Default output mode is signed (-d)",
|
||||
""
|
||||
].forEach(function(l) { console.log(l); });
|
||||
return 0;
|
||||
}
|
||||
|
||||
function version()/*:number*/ { console.log(X.version); return 0; }
|
||||
|
||||
var fs = require('fs');
|
||||
require('exit-on-epipe');
|
||||
|
||||
function die(msg/*:string*/, ec/*:?number*/)/*:void*/ { console.error(msg); process.exit(ec || 0); }
|
||||
|
||||
var args/*:Array<string>*/ = process.argv.slice(2);
|
||||
var filename/*:string*/ = "";
|
||||
var fmt/*:string*/ = "";
|
||||
var seed = 1, r = 10;
|
||||
|
||||
for(var i = 0; i < args.length; ++i) {
|
||||
var arg = args[i];
|
||||
if(arg.charCodeAt(0) != 45) { if(filename === "") filename = arg; continue; }
|
||||
var m = arg.indexOf("=") == -1 ? arg : arg.substr(0, arg.indexOf("="));
|
||||
switch(m) {
|
||||
case "-": filename = "-"; break;
|
||||
|
||||
case "--help": case "-h": process.exit(help()); break;
|
||||
case "--version": case "-V": process.exit(version()); break;
|
||||
|
||||
case "--signed": case "-d": fmt = "%d"; break;
|
||||
case "--unsigned": case "-u": fmt = "%u"; break;
|
||||
case "--hex": case "-x": fmt = "%0.8x"; break;
|
||||
case "--HEX": case "-X": fmt = "%0.8X"; break;
|
||||
case "--format": case "-F":
|
||||
fmt = ((m!=arg) ? arg.substr(m.length+1) : args[++i])||""; break;
|
||||
|
||||
case "--hex-seed": case "-H": r = 16;
|
||||
/* falls through */
|
||||
case "--seed": case "-S":
|
||||
seed=parseInt((m!=arg) ? arg.substr(m.length+1) : args[++i], r)||1; break;
|
||||
|
||||
default: die("adler32: unrecognized option `" + arg + "'", 22);
|
||||
}
|
||||
}
|
||||
|
||||
if(!process.stdin.isTTY) filename = filename || "-";
|
||||
if(filename.length===0) die("adler32: must specify a filename ('-' for stdin)",1);
|
||||
|
||||
var adler32 = seed;
|
||||
// $FlowIgnore -- Writable is callable but type sig disagrees
|
||||
var writable = require('stream').Writable();
|
||||
writable._write = function(chunk, e, cb) { adler32 = X.buf(chunk, adler32); cb(); };
|
||||
writable._writev = function(chunks, cb) {
|
||||
chunks.forEach(function(c) { adler32 = X.buf(c.chunk, adler32);});
|
||||
cb();
|
||||
};
|
||||
writable.on('finish', function() {
|
||||
console.log(fmt === "" ? adler32 : require("printj").sprintf(fmt, adler32));
|
||||
});
|
||||
|
||||
if(filename === "-") process.stdin.pipe(writable);
|
||||
else if(fs.existsSync(filename)) fs.createReadStream(filename).pipe(writable);
|
||||
else die("adler32: " + filename + ": No such file or directory", 2);
|
||||
@@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
const net = require('net');
|
||||
/* istanbul ignore file: https://github.com/nodejs/node/blob/v13.0.1/lib/_http_agent.js */
|
||||
|
||||
module.exports = options => {
|
||||
let servername = options.host;
|
||||
const hostHeader = options.headers && options.headers.host;
|
||||
|
||||
if (hostHeader) {
|
||||
if (hostHeader.startsWith('[')) {
|
||||
const index = hostHeader.indexOf(']');
|
||||
if (index === -1) {
|
||||
servername = hostHeader;
|
||||
} else {
|
||||
servername = hostHeader.slice(1, -1);
|
||||
}
|
||||
} else {
|
||||
servername = hostHeader.split(':', 1)[0];
|
||||
}
|
||||
}
|
||||
|
||||
if (net.isIP(servername)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
return servername;
|
||||
};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"combineLatest.js","sources":["../../src/internal/operators/combineLatest.ts"],"names":[],"mappings":";;AACA,2CAA0C;AAC1C,6DAAoE;AACpE,2CAA0C;AAI1C,IAAM,IAAI,GAAG,EAAE,CAAC;AAoChB,SAAgB,aAAa;IAAO,qBAE+C;SAF/C,UAE+C,EAF/C,qBAE+C,EAF/C,IAE+C;QAF/C,gCAE+C;;IACjF,IAAI,OAAO,GAAiC,IAAI,CAAC;IACjD,IAAI,OAAO,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,UAAU,EAAE;QAC7D,OAAO,GAAiC,WAAW,CAAC,GAAG,EAAE,CAAC;KAC3D;IAID,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,IAAI,iBAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE;QACvD,WAAW,GAAS,WAAW,CAAC,CAAC,CAAE,CAAC,KAAK,EAAE,CAAC;KAC7C;IAED,OAAO,UAAC,MAAqB,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,WAAI,EAAE,MAAM,SAAK,WAAW,EAAE,EAAE,IAAI,qCAAqB,CAAC,OAAO,CAAC,CAAC,EAApF,CAAoF,CAAC;AACzH,CAAC;AAfD,sCAeC"}
|
||||
@@ -0,0 +1 @@
|
||||
import 'rxjs-compat/add/operator/sampleTime';
|
||||
@@ -0,0 +1,47 @@
|
||||
Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
||||
|
||||
Based on Underscore.js, copyright Jeremy Ashkenas,
|
||||
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
|
||||
|
||||
This software consists of voluntary contributions made by many
|
||||
individuals. For exact contribution history, see the revision history
|
||||
available at https://github.com/lodash/lodash
|
||||
|
||||
The following license applies to all parts of this software except as
|
||||
documented below:
|
||||
|
||||
====
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
====
|
||||
|
||||
Copyright and related rights for sample code are waived via CC0. Sample
|
||||
code is defined as all source code displayed within the prose of the
|
||||
documentation.
|
||||
|
||||
CC0: http://creativecommons.org/publicdomain/zero/1.0/
|
||||
|
||||
====
|
||||
|
||||
Files located in the node_modules and vendor directories are externally
|
||||
maintained libraries used by this software which have their own
|
||||
licenses; we recommend you read them, as their terms may differ from the
|
||||
terms above.
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/InnerSubscriber';
|
||||
Reference in New Issue
Block a user