new license file version [CI SKIP]
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
/** PURE_IMPORTS_START PURE_IMPORTS_END */
|
||||
var ObjectUnsubscribedErrorImpl = /*@__PURE__*/ (function () {
|
||||
function ObjectUnsubscribedErrorImpl() {
|
||||
Error.call(this);
|
||||
this.message = 'object unsubscribed';
|
||||
this.name = 'ObjectUnsubscribedError';
|
||||
return this;
|
||||
}
|
||||
ObjectUnsubscribedErrorImpl.prototype = /*@__PURE__*/ Object.create(Error.prototype);
|
||||
return ObjectUnsubscribedErrorImpl;
|
||||
})();
|
||||
export var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl;
|
||||
//# sourceMappingURL=ObjectUnsubscribedError.js.map
|
||||
@@ -0,0 +1,52 @@
|
||||
"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 Subscriber_1 = require("../Subscriber");
|
||||
var Notification_1 = require("../Notification");
|
||||
function materialize() {
|
||||
return function materializeOperatorFunction(source) {
|
||||
return source.lift(new MaterializeOperator());
|
||||
};
|
||||
}
|
||||
exports.materialize = materialize;
|
||||
var MaterializeOperator = (function () {
|
||||
function MaterializeOperator() {
|
||||
}
|
||||
MaterializeOperator.prototype.call = function (subscriber, source) {
|
||||
return source.subscribe(new MaterializeSubscriber(subscriber));
|
||||
};
|
||||
return MaterializeOperator;
|
||||
}());
|
||||
var MaterializeSubscriber = (function (_super) {
|
||||
__extends(MaterializeSubscriber, _super);
|
||||
function MaterializeSubscriber(destination) {
|
||||
return _super.call(this, destination) || this;
|
||||
}
|
||||
MaterializeSubscriber.prototype._next = function (value) {
|
||||
this.destination.next(Notification_1.Notification.createNext(value));
|
||||
};
|
||||
MaterializeSubscriber.prototype._error = function (err) {
|
||||
var destination = this.destination;
|
||||
destination.next(Notification_1.Notification.createError(err));
|
||||
destination.complete();
|
||||
};
|
||||
MaterializeSubscriber.prototype._complete = function () {
|
||||
var destination = this.destination;
|
||||
destination.next(Notification_1.Notification.createComplete());
|
||||
destination.complete();
|
||||
};
|
||||
return MaterializeSubscriber;
|
||||
}(Subscriber_1.Subscriber));
|
||||
//# sourceMappingURL=materialize.js.map
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operator/filter';
|
||||
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var scan_1 = require("./scan");
|
||||
var takeLast_1 = require("./takeLast");
|
||||
var defaultIfEmpty_1 = require("./defaultIfEmpty");
|
||||
var pipe_1 = require("../util/pipe");
|
||||
function reduce(accumulator, seed) {
|
||||
if (arguments.length >= 2) {
|
||||
return function reduceOperatorFunctionWithSeed(source) {
|
||||
return pipe_1.pipe(scan_1.scan(accumulator, seed), takeLast_1.takeLast(1), defaultIfEmpty_1.defaultIfEmpty(seed))(source);
|
||||
};
|
||||
}
|
||||
return function reduceOperatorFunction(source) {
|
||||
return pipe_1.pipe(scan_1.scan(function (acc, value, index) { return accumulator(acc, value, index + 1); }), takeLast_1.takeLast(1))(source);
|
||||
};
|
||||
}
|
||||
exports.reduce = reduce;
|
||||
//# sourceMappingURL=reduce.js.map
|
||||
@@ -0,0 +1,327 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { ObservableInput, SchedulerLike, ObservedValueOf } from '../types';
|
||||
import { isScheduler } from '../util/isScheduler';
|
||||
import { isArray } from '../util/isArray';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { OuterSubscriber } from '../OuterSubscriber';
|
||||
import { Operator } from '../Operator';
|
||||
import { InnerSubscriber } from '../InnerSubscriber';
|
||||
import { subscribeToResult } from '../util/subscribeToResult';
|
||||
import { fromArray } from './fromArray';
|
||||
|
||||
const NONE = {};
|
||||
|
||||
/* tslint:disable:max-line-length */
|
||||
|
||||
// If called with a single array, it "auto-spreads" the array, with result selector
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, R>(sources: [O1], resultSelector: (v1: ObservedValueOf<O1>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, R>(sources: [O1, O2], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, R>(sources: [O1, O2, O3], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, R>(sources: [O1, O2, O3, O4], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, R>(sources: [O1, O2, O3, O4, O5], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>, R>(sources: [O1, O2, O3, O4, O5, O6], resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>, v6: ObservedValueOf<O6>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O extends ObservableInput<any>, R>(sources: O[], resultSelector: (...args: ObservedValueOf<O>[]) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
|
||||
// standard call, but with a result selector
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, R>(v1: O1, resultSelector: (v1: ObservedValueOf<O1>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, R>(v1: O1, v2: O2, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, v4: O4, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>, R>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, resultSelector: (v1: ObservedValueOf<O1>, v2: ObservedValueOf<O2>, v3: ObservedValueOf<O3>, v4: ObservedValueOf<O4>, v5: ObservedValueOf<O5>, v6: ObservedValueOf<O6>) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
|
||||
// With a scheduler (deprecated)
|
||||
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>>(sources: [O1], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>]>;
|
||||
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(sources: [O1, O2], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>]>;
|
||||
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(sources: [O1, O2, O3], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>]>;
|
||||
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(sources: [O1, O2, O3, O4], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>]>;
|
||||
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>]>;
|
||||
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5, O6], scheduler: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>, ObservedValueOf<O6>]>;
|
||||
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
|
||||
export function combineLatest<O extends ObservableInput<any>>(sources: O[], scheduler: SchedulerLike): Observable<ObservedValueOf<O>[]>;
|
||||
|
||||
// Best case
|
||||
export function combineLatest<O1 extends ObservableInput<any>>(sources: [O1]): Observable<[ObservedValueOf<O1>]>;
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(sources: [O1, O2]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>]>;
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(sources: [O1, O2, O3]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>]>;
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(sources: [O1, O2, O3, O4]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>]>;
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>]>;
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(sources: [O1, O2, O3, O4, O5, O6]): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>, ObservedValueOf<O6>]>;
|
||||
export function combineLatest<O extends ObservableInput<any>>(sources: O[]): Observable<ObservedValueOf<O>[]>;
|
||||
|
||||
// Standard calls
|
||||
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
|
||||
export function combineLatest<O1 extends ObservableInput<any>>(v1: O1, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>]>;
|
||||
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>>(v1: O1, v2: O2, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>]>;
|
||||
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>]>;
|
||||
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>]>;
|
||||
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>]>;
|
||||
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
|
||||
export function combineLatest<O1 extends ObservableInput<any>, O2 extends ObservableInput<any>, O3 extends ObservableInput<any>, O4 extends ObservableInput<any>, O5 extends ObservableInput<any>, O6 extends ObservableInput<any>>(v1: O1, v2: O2, v3: O3, v4: O4, v5: O5, v6: O6, scheduler?: SchedulerLike): Observable<[ObservedValueOf<O1>, ObservedValueOf<O2>, ObservedValueOf<O3>, ObservedValueOf<O4>, ObservedValueOf<O5>, ObservedValueOf<O6>]>;
|
||||
|
||||
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
|
||||
export function combineLatest<O extends ObservableInput<any>>(...observables: O[]): Observable<any[]>;
|
||||
|
||||
/** @deprecated Pass arguments in a single array instead `combineLatest([a, b, c])` */
|
||||
export function combineLatest<O extends ObservableInput<any>, R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R)>): Observable<R>;
|
||||
|
||||
/** @deprecated resultSelector no longer supported, pipe to map instead */
|
||||
export function combineLatest<O extends ObservableInput<any>, R>(array: O[], resultSelector: (...values: ObservedValueOf<O>[]) => R, scheduler?: SchedulerLike): Observable<R>;
|
||||
|
||||
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
|
||||
export function combineLatest<O extends ObservableInput<any>>(...observables: Array<O | SchedulerLike>): Observable<any[]>;
|
||||
|
||||
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
|
||||
export function combineLatest<O extends ObservableInput<any>, R>(...observables: Array<O | ((...values: ObservedValueOf<O>[]) => R) | SchedulerLike>): Observable<R>;
|
||||
|
||||
/** @deprecated Passing a scheduler here is deprecated, use {@link subscribeOn} and/or {@link observeOn} instead */
|
||||
export function combineLatest<R>(...observables: Array<ObservableInput<any> | ((...values: Array<any>) => R) | SchedulerLike>): Observable<R>;
|
||||
/* tslint:enable:max-line-length */
|
||||
|
||||
/**
|
||||
* Combines multiple Observables to create an Observable whose values are
|
||||
* calculated from the latest values of each of its input Observables.
|
||||
*
|
||||
* <span class="informal">Whenever any input Observable emits a value, it
|
||||
* computes a formula using the latest values from all the inputs, then emits
|
||||
* the output of that formula.</span>
|
||||
*
|
||||
* 
|
||||
*
|
||||
* `combineLatest` combines the values from all the Observables passed as
|
||||
* arguments. This is done by subscribing to each Observable in order and,
|
||||
* whenever any Observable emits, collecting an array of the most recent
|
||||
* values from each Observable. So if you pass `n` Observables to operator,
|
||||
* returned Observable will always emit an array of `n` values, in order
|
||||
* corresponding to order of passed Observables (value from the first Observable
|
||||
* on the first place and so on).
|
||||
*
|
||||
* Static version of `combineLatest` accepts either an array of Observables
|
||||
* or each Observable can be put directly as an argument. Note that array of
|
||||
* Observables is good choice, if you don't know beforehand how many Observables
|
||||
* you will combine. Passing empty array will result in Observable that
|
||||
* completes immediately.
|
||||
*
|
||||
* To ensure output array has always the same length, `combineLatest` will
|
||||
* actually wait for all input Observables to emit at least once,
|
||||
* before it starts emitting results. This means if some Observable emits
|
||||
* values before other Observables started emitting, all these values but the last
|
||||
* will be lost. On the other hand, if some Observable does not emit a value but
|
||||
* completes, resulting Observable will complete at the same moment without
|
||||
* emitting anything, since it will be now impossible to include value from
|
||||
* completed Observable in resulting array. Also, if some input Observable does
|
||||
* not emit any value and never completes, `combineLatest` will also never emit
|
||||
* and never complete, since, again, it will wait for all streams to emit some
|
||||
* value.
|
||||
*
|
||||
* If at least one Observable was passed to `combineLatest` and all passed Observables
|
||||
* emitted something, resulting Observable will complete when all combined
|
||||
* streams complete. So even if some Observable completes, result of
|
||||
* `combineLatest` will still emit values when other Observables do. In case
|
||||
* of completed Observable, its value from now on will always be the last
|
||||
* emitted value. On the other hand, if any Observable errors, `combineLatest`
|
||||
* will error immediately as well, and all other Observables will be unsubscribed.
|
||||
*
|
||||
* `combineLatest` accepts as optional parameter `project` function, which takes
|
||||
* as arguments all values that would normally be emitted by resulting Observable.
|
||||
* `project` can return any kind of value, which will be then emitted by Observable
|
||||
* instead of default array. Note that `project` does not take as argument that array
|
||||
* of values, but values themselves. That means default `project` can be imagined
|
||||
* as function that takes all its arguments and puts them into an array.
|
||||
*
|
||||
* ## Examples
|
||||
* ### Combine two timer Observables
|
||||
* ```ts
|
||||
* import { combineLatest, timer } from 'rxjs';
|
||||
*
|
||||
* const firstTimer = timer(0, 1000); // emit 0, 1, 2... after every second, starting from now
|
||||
* const secondTimer = timer(500, 1000); // emit 0, 1, 2... after every second, starting 0,5s from now
|
||||
* const combinedTimers = combineLatest(firstTimer, secondTimer);
|
||||
* combinedTimers.subscribe(value => console.log(value));
|
||||
* // Logs
|
||||
* // [0, 0] after 0.5s
|
||||
* // [1, 0] after 1s
|
||||
* // [1, 1] after 1.5s
|
||||
* // [2, 1] after 2s
|
||||
* ```
|
||||
*
|
||||
* ### Combine an array of Observables
|
||||
* ```ts
|
||||
* import { combineLatest, of } from 'rxjs';
|
||||
* import { delay, starWith } from 'rxjs/operators';
|
||||
*
|
||||
* const observables = [1, 5, 10].map(
|
||||
* n => of(n).pipe(
|
||||
* delay(n * 1000), // emit 0 and then emit n after n seconds
|
||||
* startWith(0),
|
||||
* )
|
||||
* );
|
||||
* const combined = combineLatest(observables);
|
||||
* combined.subscribe(value => console.log(value));
|
||||
* // Logs
|
||||
* // [0, 0, 0] immediately
|
||||
* // [1, 0, 0] after 1s
|
||||
* // [1, 5, 0] after 5s
|
||||
* // [1, 5, 10] after 10s
|
||||
* ```
|
||||
*
|
||||
*
|
||||
* ### Use project function to dynamically calculate the Body-Mass Index
|
||||
* ```ts
|
||||
* import { combineLatest, of } from 'rxjs';
|
||||
* import { map } from 'rxjs/operators';
|
||||
*
|
||||
* const weight = of(70, 72, 76, 79, 75);
|
||||
* const height = of(1.76, 1.77, 1.78);
|
||||
* const bmi = combineLatest(weight, height).pipe(
|
||||
* map(([w, h]) => w / (h * h)),
|
||||
* );
|
||||
* bmi.subscribe(x => console.log('BMI is ' + x));
|
||||
*
|
||||
* // With output to console:
|
||||
* // BMI is 24.212293388429753
|
||||
* // BMI is 23.93948099205209
|
||||
* // BMI is 23.671253629592222
|
||||
* ```
|
||||
*
|
||||
* @see {@link combineAll}
|
||||
* @see {@link merge}
|
||||
* @see {@link withLatestFrom}
|
||||
*
|
||||
* @param {ObservableInput} observable1 An input Observable to combine with other Observables.
|
||||
* @param {ObservableInput} observable2 An input Observable to combine with other Observables.
|
||||
* More than one input Observables may be given as arguments
|
||||
* or an array of Observables may be given as the first argument.
|
||||
* @param {function} [project] An optional function to project the values from
|
||||
* the combined latest values into a new value on the output Observable.
|
||||
* @param {SchedulerLike} [scheduler=null] The {@link SchedulerLike} to use for subscribing to
|
||||
* each input Observable.
|
||||
* @return {Observable} An Observable of projected values from the most recent
|
||||
* values from each input Observable, or an array of the most recent values from
|
||||
* each input Observable.
|
||||
*/
|
||||
export function combineLatest<O extends ObservableInput<any>, R>(
|
||||
...observables: (O | ((...values: ObservedValueOf<O>[]) => R) | SchedulerLike)[]
|
||||
): Observable<R> {
|
||||
let resultSelector: ((...values: Array<any>) => R) | undefined = undefined;
|
||||
let scheduler: SchedulerLike|undefined = undefined;
|
||||
|
||||
if (isScheduler(observables[observables.length - 1])) {
|
||||
scheduler = observables.pop() as SchedulerLike;
|
||||
}
|
||||
|
||||
if (typeof observables[observables.length - 1] === 'function') {
|
||||
resultSelector = observables.pop() as (...values: Array<any>) => R;
|
||||
}
|
||||
|
||||
// if the first and only other argument besides the resultSelector is an array
|
||||
// assume it's been called with `combineLatest([obs1, obs2, obs3], resultSelector)`
|
||||
if (observables.length === 1 && isArray(observables[0])) {
|
||||
observables = observables[0] as any;
|
||||
}
|
||||
|
||||
return fromArray(observables, scheduler).lift(new CombineLatestOperator(resultSelector));
|
||||
}
|
||||
|
||||
export class CombineLatestOperator<T, R> implements Operator<T, R> {
|
||||
constructor(private resultSelector?: (...values: Array<any>) => R) {
|
||||
}
|
||||
|
||||
call(subscriber: Subscriber<R>, source: any): any {
|
||||
return source.subscribe(new CombineLatestSubscriber(subscriber, this.resultSelector));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
export class CombineLatestSubscriber<T, R> extends OuterSubscriber<T, R> {
|
||||
private active: number = 0;
|
||||
private values: any[] = [];
|
||||
private observables: any[] = [];
|
||||
private toRespond?: number;
|
||||
|
||||
constructor(destination: Subscriber<R>, private resultSelector?: (...values: Array<any>) => R) {
|
||||
super(destination);
|
||||
}
|
||||
|
||||
protected _next(observable: any) {
|
||||
this.values.push(NONE);
|
||||
this.observables.push(observable);
|
||||
}
|
||||
|
||||
protected _complete() {
|
||||
const observables = this.observables;
|
||||
const len = observables.length;
|
||||
if (len === 0) {
|
||||
this.destination.complete!();
|
||||
} else {
|
||||
this.active = len;
|
||||
this.toRespond = len;
|
||||
for (let i = 0; i < len; i++) {
|
||||
const observable = observables[i];
|
||||
this.add(subscribeToResult(this, observable, undefined, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
notifyComplete(unused: Subscriber<R>): void {
|
||||
if ((this.active -= 1) === 0) {
|
||||
this.destination.complete!();
|
||||
}
|
||||
}
|
||||
|
||||
notifyNext(_outerValue: T, innerValue: R,
|
||||
outerIndex: number): void {
|
||||
const values = this.values;
|
||||
const oldVal = values[outerIndex];
|
||||
const toRespond = !this.toRespond
|
||||
? 0
|
||||
: oldVal === NONE ? --this.toRespond : this.toRespond;
|
||||
values[outerIndex] = innerValue;
|
||||
|
||||
if (toRespond === 0) {
|
||||
if (this.resultSelector) {
|
||||
this._tryResultSelector(values);
|
||||
} else {
|
||||
this.destination.next!(values.slice());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private _tryResultSelector(values: any[]) {
|
||||
let result: any;
|
||||
try {
|
||||
result = this.resultSelector!.apply(this, values);
|
||||
} catch (err) {
|
||||
this.destination.error!(err);
|
||||
return;
|
||||
}
|
||||
this.destination.next!(result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"pupa","version":"2.1.1","files":{"license":{"checkedAt":1678887829653,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"package.json":{"checkedAt":1678887830384,"integrity":"sha512-v2zSwakSqnx9Qy5CST6m/JIeryvVC0U4YmdGV+N6YjyXN6/sOJniE+EJ6kZeSDWCE1rXfUQJ8liKse9DZG27yw==","mode":420,"size":734},"index.js":{"checkedAt":1678887830384,"integrity":"sha512-GzhGjIIzCxCGZr6nmIXhsUYTWzu203QZY0VdbeJiuYD/WWXaIEO2xtsYliqx55L4oLdG54nyWvOjmswqhau1sA==","mode":420,"size":1100},"index.d.ts":{"checkedAt":1678887830384,"integrity":"sha512-QP6HHyhUw5iSs1X3yd/EsL5YPe8VDQbzHO73UhSzzvCgXfdcgrf5oON28oLs4QcLOGdJpdw6Qlp5gW3pcC0ttA==","mode":420,"size":746},"readme.md":{"checkedAt":1678887830384,"integrity":"sha512-qULSqsP+uBBRVP1Q0+FmvcKVdjtyTvWEWXeZo5i9J2sttS6eL52pPCfiZtiDzfQMlnZbOMgmOt3hF1A7V4PF4w==","mode":420,"size":1248}}}
|
||||
@@ -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/min"));
|
||||
//# sourceMappingURL=min.js.map
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operator/switchMap';
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/operators/throttle';
|
||||
@@ -0,0 +1,78 @@
|
||||
{
|
||||
"name": "validator",
|
||||
"description": "String validation and sanitization",
|
||||
"version": "13.5.2",
|
||||
"sideEffects": false,
|
||||
"homepage": "https://github.com/chriso/validator.js",
|
||||
"files": [
|
||||
"index.js",
|
||||
"es",
|
||||
"lib",
|
||||
"README.md",
|
||||
"LICENCE",
|
||||
"validator.js",
|
||||
"validator.min.js"
|
||||
],
|
||||
"keywords": [
|
||||
"validator",
|
||||
"validation",
|
||||
"validate",
|
||||
"sanitization",
|
||||
"sanitize",
|
||||
"sanitisation",
|
||||
"sanitise",
|
||||
"assert"
|
||||
],
|
||||
"author": "Chris O'Hara <cohara87@gmail.com>",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Anthony Nandaa",
|
||||
"url": "https://github.com/profnandaa"
|
||||
}
|
||||
],
|
||||
"main": "index.js",
|
||||
"bugs": {
|
||||
"url": "https://github.com/chriso/validator.js/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/chriso/validator.js.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.0.0",
|
||||
"@babel/core": "^7.0.0",
|
||||
"@babel/preset-env": "^7.0.0",
|
||||
"@babel/register": "^7.0.0",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-plugin-add-module-exports": "^1.0.0",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-config-airbnb-base": "^12.1.0",
|
||||
"eslint-plugin-import": "^2.11.0",
|
||||
"mocha": "^5.1.1",
|
||||
"nyc": "^14.1.0",
|
||||
"rimraf": "^3.0.0",
|
||||
"rollup": "^0.43.0",
|
||||
"rollup-plugin-babel": "^4.0.1",
|
||||
"uglify-js": "^3.0.19"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint src test",
|
||||
"lint:fix": "eslint --fix src test",
|
||||
"clean:node": "rimraf index.js lib",
|
||||
"clean:es": "rimraf es",
|
||||
"clean:browser": "rimraf validator*.js",
|
||||
"clean": "npm run clean:node && npm run clean:browser && npm run clean:es",
|
||||
"minify": "uglifyjs validator.js -o validator.min.js --compress --mangle --comments /Copyright/",
|
||||
"build:browser": "node --require @babel/register build-browser && npm run minify",
|
||||
"build:es": "babel src -d es --env-name=es",
|
||||
"build:node": "babel src -d .",
|
||||
"build": "npm run build:browser && npm run build:node && npm run build:es",
|
||||
"pretest": "npm run build && npm run lint",
|
||||
"test": "nyc mocha --require @babel/register --reporter dot",
|
||||
"test:ci": "nyc report --reporter=text-lcov"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"license": "MIT"
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"Immediate.js","sources":["../../../src/internal/util/Immediate.ts"],"names":[],"mappings":"AAAA,IAAI,UAAU,GAAG,CAAC,CAAC;AACnB,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;AAC7C,MAAM,aAAa,GAA2B,EAAE,CAAC;AAOjD,SAAS,kBAAkB,CAAC,MAAc;IACxC,IAAI,MAAM,IAAI,aAAa,EAAE;QAC3B,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;KACb;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAKD,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,YAAY,CAAC,EAAc;QACzB,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAC5B,aAAa,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;QAC7B,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACxD,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,cAAc,CAAC,MAAc;QAC3B,kBAAkB,CAAC,MAAM,CAAC,CAAC;IAC7B,CAAC;CACF,CAAC;AAKF,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO;QACL,OAAO,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,CAAC;IAC3C,CAAC;CACF,CAAC"}
|
||||
@@ -0,0 +1,188 @@
|
||||
import { Operator } from './Operator';
|
||||
import { Observable } from './Observable';
|
||||
import { Subscriber } from './Subscriber';
|
||||
import { Subscription } from './Subscription';
|
||||
import { Observer, SubscriptionLike, TeardownLogic } from './types';
|
||||
import { ObjectUnsubscribedError } from './util/ObjectUnsubscribedError';
|
||||
import { SubjectSubscription } from './SubjectSubscription';
|
||||
import { rxSubscriber as rxSubscriberSymbol } from '../internal/symbol/rxSubscriber';
|
||||
|
||||
/**
|
||||
* @class SubjectSubscriber<T>
|
||||
*/
|
||||
export class SubjectSubscriber<T> extends Subscriber<T> {
|
||||
constructor(protected destination: Subject<T>) {
|
||||
super(destination);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A Subject is a special type of Observable that allows values to be
|
||||
* multicasted to many Observers. Subjects are like EventEmitters.
|
||||
*
|
||||
* Every Subject is an Observable and an Observer. You can subscribe to a
|
||||
* Subject, and you can call next to feed values as well as error and complete.
|
||||
*
|
||||
* @class Subject<T>
|
||||
*/
|
||||
export class Subject<T> extends Observable<T> implements SubscriptionLike {
|
||||
|
||||
[rxSubscriberSymbol]() {
|
||||
return new SubjectSubscriber(this);
|
||||
}
|
||||
|
||||
observers: Observer<T>[] = [];
|
||||
|
||||
closed = false;
|
||||
|
||||
isStopped = false;
|
||||
|
||||
hasError = false;
|
||||
|
||||
thrownError: any = null;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
/**@nocollapse
|
||||
* @deprecated use new Subject() instead
|
||||
*/
|
||||
static create: Function = <T>(destination: Observer<T>, source: Observable<T>): AnonymousSubject<T> => {
|
||||
return new AnonymousSubject<T>(destination, source);
|
||||
}
|
||||
|
||||
lift<R>(operator: Operator<T, R>): Observable<R> {
|
||||
const subject = new AnonymousSubject(this, this);
|
||||
subject.operator = <any>operator;
|
||||
return <any>subject;
|
||||
}
|
||||
|
||||
next(value?: T) {
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
}
|
||||
if (!this.isStopped) {
|
||||
const { observers } = this;
|
||||
const len = observers.length;
|
||||
const copy = observers.slice();
|
||||
for (let i = 0; i < len; i++) {
|
||||
copy[i].next(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
error(err: any) {
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
}
|
||||
this.hasError = true;
|
||||
this.thrownError = err;
|
||||
this.isStopped = true;
|
||||
const { observers } = this;
|
||||
const len = observers.length;
|
||||
const copy = observers.slice();
|
||||
for (let i = 0; i < len; i++) {
|
||||
copy[i].error(err);
|
||||
}
|
||||
this.observers.length = 0;
|
||||
}
|
||||
|
||||
complete() {
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
}
|
||||
this.isStopped = true;
|
||||
const { observers } = this;
|
||||
const len = observers.length;
|
||||
const copy = observers.slice();
|
||||
for (let i = 0; i < len; i++) {
|
||||
copy[i].complete();
|
||||
}
|
||||
this.observers.length = 0;
|
||||
}
|
||||
|
||||
unsubscribe() {
|
||||
this.isStopped = true;
|
||||
this.closed = true;
|
||||
this.observers = null;
|
||||
}
|
||||
|
||||
/** @deprecated This is an internal implementation detail, do not use. */
|
||||
_trySubscribe(subscriber: Subscriber<T>): TeardownLogic {
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
} else {
|
||||
return super._trySubscribe(subscriber);
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated This is an internal implementation detail, do not use. */
|
||||
_subscribe(subscriber: Subscriber<T>): Subscription {
|
||||
if (this.closed) {
|
||||
throw new ObjectUnsubscribedError();
|
||||
} else if (this.hasError) {
|
||||
subscriber.error(this.thrownError);
|
||||
return Subscription.EMPTY;
|
||||
} else if (this.isStopped) {
|
||||
subscriber.complete();
|
||||
return Subscription.EMPTY;
|
||||
} else {
|
||||
this.observers.push(subscriber);
|
||||
return new SubjectSubscription(this, subscriber);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Observable with this Subject as the source. You can do this
|
||||
* to create customize Observer-side logic of the Subject and conceal it from
|
||||
* code that uses the Observable.
|
||||
* @return {Observable} Observable that the Subject casts to
|
||||
*/
|
||||
asObservable(): Observable<T> {
|
||||
const observable = new Observable<T>();
|
||||
(<any>observable).source = this;
|
||||
return observable;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @class AnonymousSubject<T>
|
||||
*/
|
||||
export class AnonymousSubject<T> extends Subject<T> {
|
||||
constructor(protected destination?: Observer<T>, source?: Observable<T>) {
|
||||
super();
|
||||
this.source = source;
|
||||
}
|
||||
|
||||
next(value: T) {
|
||||
const { destination } = this;
|
||||
if (destination && destination.next) {
|
||||
destination.next(value);
|
||||
}
|
||||
}
|
||||
|
||||
error(err: any) {
|
||||
const { destination } = this;
|
||||
if (destination && destination.error) {
|
||||
this.destination.error(err);
|
||||
}
|
||||
}
|
||||
|
||||
complete() {
|
||||
const { destination } = this;
|
||||
if (destination && destination.complete) {
|
||||
this.destination.complete();
|
||||
}
|
||||
}
|
||||
|
||||
/** @deprecated This is an internal implementation detail, do not use. */
|
||||
_subscribe(subscriber: Subscriber<T>): Subscription {
|
||||
const { source } = this;
|
||||
if (source) {
|
||||
return this.source.subscribe(subscriber);
|
||||
} else {
|
||||
return Subscription.EMPTY;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
/*
|
||||
https://developer.mozilla.org/en/CSS/background-position
|
||||
http://www.w3.org/TR/css3-background/#background-position
|
||||
|
||||
Example: http://jsfiddle.net/Blink/bBXvt/
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
var elem = document.createElement('a'),
|
||||
eStyle = elem.style,
|
||||
val = "right 10px bottom 10px";
|
||||
|
||||
Modernizr.addTest('bgpositionshorthand', function(){
|
||||
eStyle.cssText = "background-position: " + val + ";";
|
||||
return (eStyle.backgroundPosition === val);
|
||||
});
|
||||
|
||||
}());
|
||||
@@ -0,0 +1 @@
|
||||
export * from 'rxjs-compat/util/subscribeTo';
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"UnsubscriptionError.js","sources":["../../src/internal/util/UnsubscriptionError.ts"],"names":[],"mappings":";;AAQA,IAAM,uBAAuB,GAAG,CAAC;IAC/B,SAAS,uBAAuB,CAAY,MAAa;QACvD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC;YAClB,MAAM,CAAC,MAAM,iDACpB,MAAM,CAAC,GAAG,CAAC,UAAC,GAAG,EAAE,CAAC,IAAK,OAAG,CAAC,GAAG,CAAC,UAAK,GAAG,CAAC,QAAQ,EAAI,EAA7B,CAA6B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAG,CAAC,CAAC,CAAC,EAAE,CAAC;QACxE,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,uBAAuB,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAEnE,OAAO,uBAAuB,CAAC;AACjC,CAAC,CAAC,EAAE,CAAC;AAMQ,QAAA,mBAAmB,GAA4B,uBAA8B,CAAC"}
|
||||
@@ -0,0 +1,17 @@
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { observable as Symbol_observable } from '../symbol/observable';
|
||||
|
||||
/**
|
||||
* Subscribes to an object that implements Symbol.observable with the given
|
||||
* Subscriber.
|
||||
* @param obj An object that implements Symbol.observable
|
||||
*/
|
||||
export const subscribeToObservable = <T>(obj: any) => (subscriber: Subscriber<T>) => {
|
||||
const obs = obj[Symbol_observable]();
|
||||
if (typeof obs.subscribe !== 'function') {
|
||||
// Should be caught by observable subscribe function error handling.
|
||||
throw new TypeError('Provided object does not correctly implement Symbol.observable');
|
||||
} else {
|
||||
return obs.subscribe(subscriber);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { iterator as Symbol_iterator } from '../symbol/iterator';
|
||||
|
||||
export const subscribeToIterable = <T>(iterable: Iterable<T>) => (subscriber: Subscriber<T>) => {
|
||||
const iterator = (iterable as any)[Symbol_iterator]();
|
||||
|
||||
do {
|
||||
let item: IteratorResult<T>;
|
||||
try {
|
||||
item = iterator.next();
|
||||
} catch (err) {
|
||||
subscriber.error(err);
|
||||
return subscriber;
|
||||
}
|
||||
if (item.done) {
|
||||
subscriber.complete();
|
||||
break;
|
||||
}
|
||||
subscriber.next(item.value);
|
||||
if (subscriber.closed) {
|
||||
break;
|
||||
}
|
||||
} while (true);
|
||||
|
||||
// Finalize the iterator if it happens to be a Generator
|
||||
if (typeof iterator.return === 'function') {
|
||||
subscriber.add(() => {
|
||||
if (iterator.return) {
|
||||
iterator.return();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return subscriber;
|
||||
};
|
||||
@@ -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/operators/takeLast"));
|
||||
//# sourceMappingURL=takeLast.js.map
|
||||
@@ -0,0 +1,12 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { subscribeToArray } from '../util/subscribeToArray';
|
||||
import { scheduleArray } from '../scheduled/scheduleArray';
|
||||
export function fromArray(input, scheduler) {
|
||||
if (!scheduler) {
|
||||
return new Observable(subscribeToArray(input));
|
||||
}
|
||||
else {
|
||||
return scheduleArray(input, scheduler);
|
||||
}
|
||||
}
|
||||
//# sourceMappingURL=fromArray.js.map
|
||||
@@ -0,0 +1,54 @@
|
||||
/** PURE_IMPORTS_START tslib,_util_EmptyError,_Subscriber PURE_IMPORTS_END */
|
||||
import * as tslib_1 from "tslib";
|
||||
import { EmptyError } from '../util/EmptyError';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
export function throwIfEmpty(errorFactory) {
|
||||
if (errorFactory === void 0) {
|
||||
errorFactory = defaultErrorFactory;
|
||||
}
|
||||
return function (source) {
|
||||
return source.lift(new ThrowIfEmptyOperator(errorFactory));
|
||||
};
|
||||
}
|
||||
var ThrowIfEmptyOperator = /*@__PURE__*/ (function () {
|
||||
function ThrowIfEmptyOperator(errorFactory) {
|
||||
this.errorFactory = errorFactory;
|
||||
}
|
||||
ThrowIfEmptyOperator.prototype.call = function (subscriber, source) {
|
||||
return source.subscribe(new ThrowIfEmptySubscriber(subscriber, this.errorFactory));
|
||||
};
|
||||
return ThrowIfEmptyOperator;
|
||||
}());
|
||||
var ThrowIfEmptySubscriber = /*@__PURE__*/ (function (_super) {
|
||||
tslib_1.__extends(ThrowIfEmptySubscriber, _super);
|
||||
function ThrowIfEmptySubscriber(destination, errorFactory) {
|
||||
var _this = _super.call(this, destination) || this;
|
||||
_this.errorFactory = errorFactory;
|
||||
_this.hasValue = false;
|
||||
return _this;
|
||||
}
|
||||
ThrowIfEmptySubscriber.prototype._next = function (value) {
|
||||
this.hasValue = true;
|
||||
this.destination.next(value);
|
||||
};
|
||||
ThrowIfEmptySubscriber.prototype._complete = function () {
|
||||
if (!this.hasValue) {
|
||||
var err = void 0;
|
||||
try {
|
||||
err = this.errorFactory();
|
||||
}
|
||||
catch (e) {
|
||||
err = e;
|
||||
}
|
||||
this.destination.error(err);
|
||||
}
|
||||
else {
|
||||
return this.destination.complete();
|
||||
}
|
||||
};
|
||||
return ThrowIfEmptySubscriber;
|
||||
}(Subscriber));
|
||||
function defaultErrorFactory() {
|
||||
return new EmptyError();
|
||||
}
|
||||
//# sourceMappingURL=throwIfEmpty.js.map
|
||||
@@ -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","132":"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 CC tB I u J E F G A B C K L H M N O v w x y z DC EC","132":"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 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:{"2":"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 S T U V W X Y Z","132":"a b c d f g h i j k l m n o p q r s D t xB yB FC"},E:{"2":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 G B C 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 ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB OC PC QC RC qB 9B SC rB","132":"oB pB P Q R wB S T U V W X Y Z a b c d"},G:{"2":"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":"tB I oC pC qC rC AC sC tC","132":"D"},J:{"2":"E A"},K:{"2":"A B C qB 9B rB","132":"e"},L:{"132":"D"},M:{"132":"D"},N:{"2":"A B"},O:{"2":"uC"},P:{"2":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C","132":"sB 5C 6C 7C"},Q:{"2":"1B"},R:{"132":"8C"},S:{"132":"9C"}},B:4,C:"CSS Counter Styles"};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"dematerialize.js","sources":["../../src/internal/operators/dematerialize.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,4CAA2C;AAkD3C,SAAgB,aAAa;IAC3B,OAAO,SAAS,6BAA6B,CAAC,MAAmC;QAC/E,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,qBAAqB,EAAE,CAAC,CAAC;IAClD,CAAC,CAAC;AACJ,CAAC;AAJD,sCAIC;AAED;IAAA;IAIA,CAAC;IAHC,oCAAI,GAAJ,UAAK,UAA2B,EAAE,MAAW;QAC3C,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,uBAAuB,CAAC,UAAU,CAAC,CAAC,CAAC;IACnE,CAAC;IACH,4BAAC;AAAD,CAAC,AAJD,IAIC;AAOD;IAAmE,2CAAa;IAC9E,iCAAY,WAA4B;eACtC,kBAAM,WAAW,CAAC;IACpB,CAAC;IAES,uCAAK,GAAf,UAAgB,KAAQ;QACtB,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAClC,CAAC;IACH,8BAAC;AAAD,CAAC,AARD,CAAmE,uBAAU,GAQ5E"}
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"find.js","sources":["../../../src/internal/operators/find.ts"],"names":[],"mappings":";AAEA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AA8CzC,MAAM,UAAU,IAAI,CAAI,SAAsE,EACtE,OAAa;IACnC,IAAI,OAAO,SAAS,KAAK,UAAU,EAAE;QACnC,MAAM,IAAI,SAAS,CAAC,6BAA6B,CAAC,CAAC;KACpD;IACD,OAAO,UAAC,MAAqB,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAA8B,EAAlG,CAAkG,CAAC;AACvI,CAAC;AAED;IACE,2BAAoB,SAAsE,EACtE,MAAqB,EACrB,UAAmB,EACnB,OAAa;QAHb,cAAS,GAAT,SAAS,CAA6D;QACtE,WAAM,GAAN,MAAM,CAAe;QACrB,eAAU,GAAV,UAAU,CAAS;QACnB,YAAO,GAAP,OAAO,CAAM;IACjC,CAAC;IAED,gCAAI,GAAJ,UAAK,QAAuB,EAAE,MAAW;QACvC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC;IACzH,CAAC;IACH,wBAAC;AAAD,CAAC,AAVD,IAUC;;AAOD;IAA4C,+CAAa;IAGvD,6BAAY,WAA0B,EAClB,SAAsE,EACtE,MAAqB,EACrB,UAAmB,EACnB,OAAa;QAJjC,YAKE,kBAAM,WAAW,CAAC,SACnB;QALmB,eAAS,GAAT,SAAS,CAA6D;QACtE,YAAM,GAAN,MAAM,CAAe;QACrB,gBAAU,GAAV,UAAU,CAAS;QACnB,aAAO,GAAP,OAAO,CAAM;QANzB,WAAK,GAAW,CAAC,CAAC;;IAQ1B,CAAC;IAEO,4CAAc,GAAtB,UAAuB,KAAU;QAC/B,IAAM,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QAErC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACxB,WAAW,CAAC,QAAQ,EAAE,CAAC;QACvB,IAAI,CAAC,WAAW,EAAE,CAAC;IACrB,CAAC;IAES,mCAAK,GAAf,UAAgB,KAAQ;QAChB,IAAA,SAA2B,EAA1B,wBAAS,EAAE,oBAAO,CAAS;QAClC,IAAM,KAAK,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC3B,IAAI;YACF,IAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,IAAI,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;YAC1E,IAAI,MAAM,EAAE;gBACV,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;aACtD;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC7B;IACH,CAAC;IAES,uCAAS,GAAnB;QACE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;IACH,0BAAC;AAAD,CAAC,AAnCD,CAA4C,UAAU,GAmCrD"}
|
||||
@@ -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,"48":0,"49":0,"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,"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.00482,"79":0,"80":0,"81":0,"82":0,"83":0.00482,"84":0,"85":0,"86":0,"87":0.00965,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0.00482,"102":0.03376,"103":0,"104":0,"105":0,"106":0.00965,"107":0.00482,"108":0.55947,"109":0.35208,"110":0,"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.00965,"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,"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.00482,"80":0.02894,"81":0,"83":0,"84":0,"85":0,"86":0,"87":0.00965,"88":0.01929,"89":0,"90":0,"91":0.00482,"92":0,"93":0,"94":0.01929,"95":0.00482,"96":0.00482,"97":0.00482,"98":0,"99":0.00482,"100":0,"101":0.01447,"102":0.00482,"103":0.08681,"104":0.00965,"105":0.02894,"106":0.01929,"107":0.14951,"108":5.0545,"109":4.278,"110":0.00482,"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,"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,"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.00482,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0.28456,"94":0.13022,"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,"15":0,"16":0.00482,"17":0,"18":0,"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,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0.01447,"101":0,"102":0,"103":0,"104":0.00482,"105":0.00965,"106":0.00482,"107":0.13022,"108":2.30539,"109":2.12694},E:{"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0.00965,"14":0.16398,"15":0.01929,_:"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.05305,"13.1":0.1254,"14.1":0.39066,"15.1":0.02412,"15.2-15.3":0.0627,"15.4":0.12058,"15.5":0.21704,"15.6":2.0546,"16.0":0.1881,"16.1":0.52088,"16.2":1.14305,"16.3":0.07235},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0,"5.0-5.1":0,"6.0-6.1":0.0335,"7.0-7.1":0,"8.1-8.4":0,"9.0-9.2":0.02233,"9.3":0.55826,"10.0-10.2":0,"10.3":0.45777,"11.0-11.2":0,"11.3-11.4":0.06699,"12.0-12.1":0.00558,"12.2-12.5":2.00416,"13.0-13.1":0,"13.2":0.01117,"13.3":0.02791,"13.4-13.7":0.08932,"14.0-14.4":1.01603,"14.5-14.8":1.30633,"15.0-15.1":0.19539,"15.2-15.3":0.22889,"15.4":0.6755,"15.5":1.39007,"15.6":7.14015,"16.0":5.28673,"16.1":19.9299,"16.2":11.16521,"16.3":0.56384},P:{"4":0.2469,"5.0-5.4":0,"6.2-6.4":0,"7.2-7.4":0,"8.2":0,"9.2":0,"10.1":0,"11.1-11.2":0.02147,"12.0":0,"13.0":0,"14.0":0,"15.0":0.02147,"16.0":0.01073,"17.0":0.07514,"18.0":0.05367,"19.0":3.5103},I:{"0":0,"3":0,"4":0.01757,"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.26358},K:{_:"0 10 11 12 11.1 11.5 12.1"},A:{"6":0,"7":0,"8":0,"9":0,"10":0,"11":0.52571,"5.5":0},J:{"7":0,"10":0},N:{"10":0,"11":0},R:{_:"0"},M:{"0":0.23297},Q:{"13.1":0},O:{"0":0},H:{"0":0.0147},L:{"0":19.64019},S:{"2.5":0}};
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bufferWhen.js","sources":["../../src/add/operator/bufferWhen.ts"],"names":[],"mappings":";;AAAA,+CAA6C"}
|
||||
@@ -0,0 +1 @@
|
||||
{"name":"restore-cursor","version":"3.1.0","files":{"license":{"checkedAt":1678887829653,"integrity":"sha512-nIst73auX/5NY2Fmv5Y116vWnNrEv4GaIUX3lpZG05rpXJY2S8EX+fpUS5hRjClCM0VdT2Za9DDHXXB5jdSrEw==","mode":420,"size":1109},"package.json":{"checkedAt":1678887830102,"integrity":"sha512-MR37LuFNkyeuZQuhHxl9BFB2Ia+fOO26+Oc2Mucnbhsrm0nk1w0PEBa9vvRi932kf6wQeyNFnq5Hsthp1izduA==","mode":420,"size":795},"index.d.ts":{"checkedAt":1678887830102,"integrity":"sha512-TO/RB9yGNZw5mTX6Jzg8skbC933nS0zZDceUv8rF4lyB9bCVBiPD+Ipf+Qnr24tPq8U2/W1crfcxE4K1Viu1Zw==","mode":420,"size":201},"index.js":{"checkedAt":1678887830102,"integrity":"sha512-FbLSl78YSxbrvh1SWPbmcKzMv9QUaF+vd0FpX2D6K+E1JIBPhEaKJEEVqfRoCo5t0amqLXIlDQuU3tDJj3fCnQ==","mode":420,"size":215},"readme.md":{"checkedAt":1678887830102,"integrity":"sha512-qbC/hw7hoxF41ikKlVTA/JDfO1dgMICpcnDgLAT+NSPOjb3zJolvFoXfO8iMWpzTAJc2gET6FA3HE21bsd6c7g==","mode":420,"size":497}}}
|
||||
@@ -0,0 +1,130 @@
|
||||
import { ProcessOptions } from './postcss.js'
|
||||
import PreviousMap from './previous-map.js'
|
||||
|
||||
export interface FilePosition {
|
||||
/**
|
||||
* URL for the source file.
|
||||
*/
|
||||
url: string
|
||||
|
||||
/**
|
||||
* Absolute path to the source file.
|
||||
*/
|
||||
file?: string
|
||||
|
||||
/**
|
||||
* Line in source file.
|
||||
*/
|
||||
line: number
|
||||
|
||||
/**
|
||||
* Column in source file.
|
||||
*/
|
||||
column: number
|
||||
|
||||
/**
|
||||
* Source code.
|
||||
*/
|
||||
source?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the source CSS.
|
||||
*
|
||||
* ```js
|
||||
* const root = postcss.parse(css, { from: file })
|
||||
* const input = root.source.input
|
||||
* ```
|
||||
*/
|
||||
export default class Input {
|
||||
/**
|
||||
* Input CSS source.
|
||||
*
|
||||
* ```js
|
||||
* const input = postcss.parse('a{}', { from: file }).input
|
||||
* input.css //=> "a{}"
|
||||
* ```
|
||||
*/
|
||||
css: string
|
||||
|
||||
/**
|
||||
* The input source map passed from a compilation step before PostCSS
|
||||
* (for example, from Sass compiler).
|
||||
*
|
||||
* ```js
|
||||
* root.source.input.map.consumer().sources //=> ['a.sass']
|
||||
* ```
|
||||
*/
|
||||
map: PreviousMap
|
||||
|
||||
/**
|
||||
* The absolute path to the CSS source file defined
|
||||
* with the `from` option.
|
||||
*
|
||||
* ```js
|
||||
* const root = postcss.parse(css, { from: 'a.css' })
|
||||
* root.source.input.file //=> '/home/ai/a.css'
|
||||
* ```
|
||||
*/
|
||||
file?: string
|
||||
|
||||
/**
|
||||
* The unique ID of the CSS source. It will be created if `from` option
|
||||
* is not provided (because PostCSS does not know the file path).
|
||||
*
|
||||
* ```js
|
||||
* const root = postcss.parse(css)
|
||||
* root.source.input.file //=> undefined
|
||||
* root.source.input.id //=> "<input css 8LZeVF>"
|
||||
* ```
|
||||
*/
|
||||
id?: string
|
||||
|
||||
/**
|
||||
* The flag to indicate whether or not the source code has Unicode BOM.
|
||||
*/
|
||||
hasBOM: boolean
|
||||
|
||||
/**
|
||||
* @param css Input CSS source.
|
||||
* @param opts Process options.
|
||||
*/
|
||||
constructor(css: string, opts?: ProcessOptions)
|
||||
|
||||
/**
|
||||
* The CSS source identifier. Contains `Input#file` if the user
|
||||
* set the `from` option, or `Input#id` if they did not.
|
||||
*
|
||||
* ```js
|
||||
* const root = postcss.parse(css, { from: 'a.css' })
|
||||
* root.source.input.from //=> "/home/ai/a.css"
|
||||
*
|
||||
* const root = postcss.parse(css)
|
||||
* root.source.input.from //=> "<input css 1>"
|
||||
* ```
|
||||
*/
|
||||
get from(): string
|
||||
|
||||
/**
|
||||
* Reads the input source map and returns a symbol position
|
||||
* in the input source (e.g., in a Sass file that was compiled
|
||||
* to CSS before being passed to PostCSS).
|
||||
*
|
||||
* ```js
|
||||
* root.source.input.origin(1, 1) //=> { file: 'a.css', line: 3, column: 1 }
|
||||
* ```
|
||||
*
|
||||
* @param line Line in input CSS.
|
||||
* @param column Column in input CSS.
|
||||
*
|
||||
* @return Position in input source.
|
||||
*/
|
||||
origin(line: number, column: number): FilePosition | false
|
||||
|
||||
/**
|
||||
* Converts source offset to line and column.
|
||||
*
|
||||
* @param offset Source offset.
|
||||
*/
|
||||
fromOffset(offset: number): { line: number; col: number } | null
|
||||
}
|
||||
@@ -0,0 +1,148 @@
|
||||
import { Node, Program } from 'estree';
|
||||
import { SourceMap } from 'magic-string';
|
||||
interface BaseNode {
|
||||
start: number;
|
||||
end: number;
|
||||
type: string;
|
||||
children?: TemplateNode[];
|
||||
[prop_name: string]: any;
|
||||
}
|
||||
export interface Fragment extends BaseNode {
|
||||
type: 'Fragment';
|
||||
children: TemplateNode[];
|
||||
}
|
||||
export interface Text extends BaseNode {
|
||||
type: 'Text';
|
||||
data: string;
|
||||
}
|
||||
export interface MustacheTag extends BaseNode {
|
||||
type: 'MustacheTag';
|
||||
expression: Node;
|
||||
}
|
||||
export declare type DirectiveType = 'Action' | 'Animation' | 'Binding' | 'Class' | 'EventHandler' | 'Let' | 'Ref' | 'Transition';
|
||||
interface BaseDirective extends BaseNode {
|
||||
type: DirectiveType;
|
||||
expression: null | Node;
|
||||
name: string;
|
||||
modifiers: string[];
|
||||
}
|
||||
export interface Transition extends BaseDirective {
|
||||
type: 'Transition';
|
||||
intro: boolean;
|
||||
outro: boolean;
|
||||
}
|
||||
export declare type Directive = BaseDirective | Transition;
|
||||
export declare type TemplateNode = Text | MustacheTag | BaseNode | Directive | Transition;
|
||||
export interface Parser {
|
||||
readonly template: string;
|
||||
readonly filename?: string;
|
||||
index: number;
|
||||
stack: Node[];
|
||||
html: Node;
|
||||
css: Node;
|
||||
js: Node;
|
||||
meta_tags: {};
|
||||
}
|
||||
export interface Script extends BaseNode {
|
||||
type: 'Script';
|
||||
context: string;
|
||||
content: Program;
|
||||
}
|
||||
export interface Style extends BaseNode {
|
||||
type: 'Style';
|
||||
attributes: any[];
|
||||
children: any[];
|
||||
content: {
|
||||
start: number;
|
||||
end: number;
|
||||
styles: string;
|
||||
};
|
||||
}
|
||||
export interface Ast {
|
||||
html: TemplateNode;
|
||||
css: Style;
|
||||
instance: Script;
|
||||
module: Script;
|
||||
}
|
||||
export interface Warning {
|
||||
start?: {
|
||||
line: number;
|
||||
column: number;
|
||||
pos?: number;
|
||||
};
|
||||
end?: {
|
||||
line: number;
|
||||
column: number;
|
||||
};
|
||||
pos?: number;
|
||||
code: string;
|
||||
message: string;
|
||||
filename?: string;
|
||||
frame?: string;
|
||||
toString: () => string;
|
||||
}
|
||||
export declare type ModuleFormat = 'esm' | 'cjs';
|
||||
export declare type CssHashGetter = (args: {
|
||||
name: string;
|
||||
filename: string | undefined;
|
||||
css: string;
|
||||
hash: (input: string) => string;
|
||||
}) => string;
|
||||
export interface CompileOptions {
|
||||
format?: ModuleFormat;
|
||||
name?: string;
|
||||
filename?: string;
|
||||
generate?: 'dom' | 'ssr' | false;
|
||||
sourcemap?: object | string;
|
||||
outputFilename?: string;
|
||||
cssOutputFilename?: string;
|
||||
sveltePath?: string;
|
||||
dev?: boolean;
|
||||
accessors?: boolean;
|
||||
immutable?: boolean;
|
||||
hydratable?: boolean;
|
||||
legacy?: boolean;
|
||||
customElement?: boolean;
|
||||
tag?: string;
|
||||
css?: boolean;
|
||||
loopGuardTimeout?: number;
|
||||
namespace?: string;
|
||||
cssHash?: CssHashGetter;
|
||||
preserveComments?: boolean;
|
||||
preserveWhitespace?: boolean;
|
||||
}
|
||||
export interface ParserOptions {
|
||||
filename?: string;
|
||||
customElement?: boolean;
|
||||
}
|
||||
export interface Visitor {
|
||||
enter: (node: Node) => void;
|
||||
leave?: (node: Node) => void;
|
||||
}
|
||||
export interface AppendTarget {
|
||||
slots: Record<string, string>;
|
||||
slot_stack: string[];
|
||||
}
|
||||
export interface Var {
|
||||
name: string;
|
||||
export_name?: string;
|
||||
injected?: boolean;
|
||||
module?: boolean;
|
||||
mutated?: boolean;
|
||||
reassigned?: boolean;
|
||||
referenced?: boolean;
|
||||
referenced_from_script?: boolean;
|
||||
writable?: boolean;
|
||||
global?: boolean;
|
||||
internal?: boolean;
|
||||
initialised?: boolean;
|
||||
hoistable?: boolean;
|
||||
subscribable?: boolean;
|
||||
is_reactive_dependency?: boolean;
|
||||
imported?: boolean;
|
||||
}
|
||||
export interface CssResult {
|
||||
code: string;
|
||||
map: SourceMap;
|
||||
}
|
||||
export {};
|
||||
@@ -0,0 +1,122 @@
|
||||
import { Observable } from '../Observable';
|
||||
import { Operator } from '../Operator';
|
||||
import { Subscriber } from '../Subscriber';
|
||||
import { Subscription } from '../Subscription';
|
||||
import { Notification } from '../Notification';
|
||||
import { MonoTypeOperatorFunction, PartialObserver, SchedulerAction, SchedulerLike, TeardownLogic } from '../types';
|
||||
|
||||
/**
|
||||
*
|
||||
* Re-emits all notifications from source Observable with specified scheduler.
|
||||
*
|
||||
* <span class="informal">Ensure a specific scheduler is used, from outside of an Observable.</span>
|
||||
*
|
||||
* `observeOn` is an operator that accepts a scheduler as a first parameter, which will be used to reschedule
|
||||
* notifications emitted by the source Observable. It might be useful, if you do not have control over
|
||||
* internal scheduler of a given Observable, but want to control when its values are emitted nevertheless.
|
||||
*
|
||||
* Returned Observable emits the same notifications (nexted values, complete and error events) as the source Observable,
|
||||
* but rescheduled with provided scheduler. Note that this doesn't mean that source Observables internal
|
||||
* scheduler will be replaced in any way. Original scheduler still will be used, but when the source Observable emits
|
||||
* notification, it will be immediately scheduled again - this time with scheduler passed to `observeOn`.
|
||||
* An anti-pattern would be calling `observeOn` on Observable that emits lots of values synchronously, to split
|
||||
* that emissions into asynchronous chunks. For this to happen, scheduler would have to be passed into the source
|
||||
* Observable directly (usually into the operator that creates it). `observeOn` simply delays notifications a
|
||||
* little bit more, to ensure that they are emitted at expected moments.
|
||||
*
|
||||
* As a matter of fact, `observeOn` accepts second parameter, which specifies in milliseconds with what delay notifications
|
||||
* will be emitted. The main difference between {@link delay} operator and `observeOn` is that `observeOn`
|
||||
* will delay all notifications - including error notifications - while `delay` will pass through error
|
||||
* from source Observable immediately when it is emitted. In general it is highly recommended to use `delay` operator
|
||||
* for any kind of delaying of values in the stream, while using `observeOn` to specify which scheduler should be used
|
||||
* for notification emissions in general.
|
||||
*
|
||||
* ## Example
|
||||
* Ensure values in subscribe are called just before browser repaint.
|
||||
* ```ts
|
||||
* import { interval } from 'rxjs';
|
||||
* import { observeOn } from 'rxjs/operators';
|
||||
*
|
||||
* const intervals = interval(10); // Intervals are scheduled
|
||||
* // with async scheduler by default...
|
||||
* intervals.pipe(
|
||||
* observeOn(animationFrameScheduler), // ...but we will observe on animationFrame
|
||||
* ) // scheduler to ensure smooth animation.
|
||||
* .subscribe(val => {
|
||||
* someDiv.style.height = val + 'px';
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* @see {@link delay}
|
||||
*
|
||||
* @param {SchedulerLike} scheduler Scheduler that will be used to reschedule notifications from source Observable.
|
||||
* @param {number} [delay] Number of milliseconds that states with what delay every notification should be rescheduled.
|
||||
* @return {Observable<T>} Observable that emits the same notifications as the source Observable,
|
||||
* but with provided scheduler.
|
||||
*
|
||||
* @method observeOn
|
||||
* @owner Observable
|
||||
*/
|
||||
export function observeOn<T>(scheduler: SchedulerLike, delay: number = 0): MonoTypeOperatorFunction<T> {
|
||||
return function observeOnOperatorFunction(source: Observable<T>): Observable<T> {
|
||||
return source.lift(new ObserveOnOperator(scheduler, delay));
|
||||
};
|
||||
}
|
||||
|
||||
export class ObserveOnOperator<T> implements Operator<T, T> {
|
||||
constructor(private scheduler: SchedulerLike, private delay: number = 0) {
|
||||
}
|
||||
|
||||
call(subscriber: Subscriber<T>, source: any): TeardownLogic {
|
||||
return source.subscribe(new ObserveOnSubscriber(subscriber, this.scheduler, this.delay));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* We need this JSDoc comment for affecting ESDoc.
|
||||
* @ignore
|
||||
* @extends {Ignored}
|
||||
*/
|
||||
export class ObserveOnSubscriber<T> extends Subscriber<T> {
|
||||
/** @nocollapse */
|
||||
static dispatch(this: SchedulerAction<ObserveOnMessage>, arg: ObserveOnMessage) {
|
||||
const { notification, destination } = arg;
|
||||
notification.observe(destination);
|
||||
this.unsubscribe();
|
||||
}
|
||||
|
||||
constructor(destination: Subscriber<T>,
|
||||
private scheduler: SchedulerLike,
|
||||
private delay: number = 0) {
|
||||
super(destination);
|
||||
}
|
||||
|
||||
private scheduleMessage(notification: Notification<any>): void {
|
||||
const destination = this.destination as Subscription;
|
||||
destination.add(this.scheduler.schedule(
|
||||
ObserveOnSubscriber.dispatch,
|
||||
this.delay,
|
||||
new ObserveOnMessage(notification, this.destination)
|
||||
));
|
||||
}
|
||||
|
||||
protected _next(value: T): void {
|
||||
this.scheduleMessage(Notification.createNext(value));
|
||||
}
|
||||
|
||||
protected _error(err: any): void {
|
||||
this.scheduleMessage(Notification.createError(err));
|
||||
this.unsubscribe();
|
||||
}
|
||||
|
||||
protected _complete(): void {
|
||||
this.scheduleMessage(Notification.createComplete());
|
||||
this.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
export class ObserveOnMessage {
|
||||
constructor(public notification: Notification<any>,
|
||||
public destination: PartialObserver<any>) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
import { SvelteComponent } from './Component';
|
||||
export declare function dispatch_dev<T = any>(type: string, detail?: T): void;
|
||||
export declare function append_dev(target: Node, node: Node): void;
|
||||
export declare function insert_dev(target: Node, node: Node, anchor?: Node): void;
|
||||
export declare function detach_dev(node: Node): void;
|
||||
export declare function detach_between_dev(before: Node, after: Node): void;
|
||||
export declare function detach_before_dev(after: Node): void;
|
||||
export declare function detach_after_dev(before: Node): void;
|
||||
export declare function listen_dev(node: Node, event: string, handler: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions | EventListenerOptions, has_prevent_default?: boolean, has_stop_propagation?: boolean): () => void;
|
||||
export declare function attr_dev(node: Element, attribute: string, value?: string): void;
|
||||
export declare function prop_dev(node: Element, property: string, value?: any): void;
|
||||
export declare function dataset_dev(node: HTMLElement, property: string, value?: any): void;
|
||||
export declare function set_data_dev(text: any, data: any): void;
|
||||
export declare function validate_each_argument(arg: any): void;
|
||||
export declare function validate_slots(name: any, slot: any, keys: any): void;
|
||||
declare type Props = Record<string, any>;
|
||||
export interface SvelteComponentDev {
|
||||
$set(props?: Props): void;
|
||||
$on(event: string, callback: (event: any) => void): () => void;
|
||||
$destroy(): void;
|
||||
[accessor: string]: any;
|
||||
}
|
||||
/**
|
||||
* Base class for Svelte components with some minor dev-enhancements. Used when dev=true.
|
||||
*/
|
||||
export declare class SvelteComponentDev extends SvelteComponent {
|
||||
/**
|
||||
* @private
|
||||
* For type checking capabilities only.
|
||||
* Does not exist at runtime.
|
||||
* ### DO NOT USE!
|
||||
*/
|
||||
$$prop_def: Props;
|
||||
/**
|
||||
* @private
|
||||
* For type checking capabilities only.
|
||||
* Does not exist at runtime.
|
||||
* ### DO NOT USE!
|
||||
*/
|
||||
$$events_def: any;
|
||||
/**
|
||||
* @private
|
||||
* For type checking capabilities only.
|
||||
* Does not exist at runtime.
|
||||
* ### DO NOT USE!
|
||||
*/
|
||||
$$slot_def: any;
|
||||
constructor(options: {
|
||||
target: Element;
|
||||
anchor?: Element;
|
||||
props?: Props;
|
||||
hydrate?: boolean;
|
||||
intro?: boolean;
|
||||
$$inline?: boolean;
|
||||
});
|
||||
$capture_state(): void;
|
||||
$inject_state(): void;
|
||||
}
|
||||
export interface SvelteComponentTyped<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any> {
|
||||
$set(props?: Partial<Props>): void;
|
||||
$on<K extends Extract<keyof Events, string>>(type: K, callback: (e: Events[K]) => void): () => void;
|
||||
$destroy(): void;
|
||||
[accessor: string]: any;
|
||||
}
|
||||
/**
|
||||
* Base class to create strongly typed Svelte components.
|
||||
* This only exists for typing purposes and should be used in `.d.ts` files.
|
||||
*
|
||||
* ### Example:
|
||||
*
|
||||
* You have component library on npm called `component-library`, from which
|
||||
* you export a component called `MyComponent`. For Svelte+TypeScript users,
|
||||
* you want to provide typings. Therefore you create a `index.d.ts`:
|
||||
* ```ts
|
||||
* import { SvelteComponentTyped } from "svelte";
|
||||
* export class MyComponent extends SvelteComponentTyped<{foo: string}> {}
|
||||
* ```
|
||||
* Typing this makes it possible for IDEs like VS Code with the Svelte extension
|
||||
* to provide intellisense and to use the component like this in a Svelte file
|
||||
* with TypeScript:
|
||||
* ```svelte
|
||||
* <script lang="ts">
|
||||
* import { MyComponent } from "component-library";
|
||||
* </script>
|
||||
* <MyComponent foo={'bar'} />
|
||||
* ```
|
||||
*
|
||||
* #### Why not make this part of `SvelteComponent(Dev)`?
|
||||
* Because
|
||||
* ```ts
|
||||
* class ASubclassOfSvelteComponent extends SvelteComponent<{foo: string}> {}
|
||||
* const component: typeof SvelteComponent = ASubclassOfSvelteComponent;
|
||||
* ```
|
||||
* will throw a type error, so we need to seperate the more strictly typed class.
|
||||
*/
|
||||
export declare class SvelteComponentTyped<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any> extends SvelteComponentDev {
|
||||
/**
|
||||
* @private
|
||||
* For type checking capabilities only.
|
||||
* Does not exist at runtime.
|
||||
* ### DO NOT USE!
|
||||
*/
|
||||
$$prop_def: Props;
|
||||
/**
|
||||
* @private
|
||||
* For type checking capabilities only.
|
||||
* Does not exist at runtime.
|
||||
* ### DO NOT USE!
|
||||
*/
|
||||
$$events_def: Events;
|
||||
/**
|
||||
* @private
|
||||
* For type checking capabilities only.
|
||||
* Does not exist at runtime.
|
||||
* ### DO NOT USE!
|
||||
*/
|
||||
$$slot_def: Slots;
|
||||
constructor(options: {
|
||||
target: Element;
|
||||
anchor?: Element;
|
||||
props?: Props;
|
||||
hydrate?: boolean;
|
||||
intro?: boolean;
|
||||
$$inline?: boolean;
|
||||
});
|
||||
}
|
||||
export declare function loop_guard(timeout: any): () => void;
|
||||
export {};
|
||||
Reference in New Issue
Block a user