new license file version [CI SKIP]

This commit is contained in:
2023-03-15 13:43:57 +00:00
parent d8a3063735
commit 00359d25c1
5600 changed files with 523898 additions and 2 deletions

View File

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

View File

@@ -0,0 +1,44 @@
import { MonoTypeOperatorFunction } from '../types';
/**
* Emits only the last `count` values emitted by the source Observable.
*
* <span class="informal">Remembers the latest `count` values, then emits those
* only when the source completes.</span>
*
* ![](takeLast.png)
*
* `takeLast` returns an Observable that emits at most the last `count` values
* emitted by the source Observable. If the source emits fewer than `count`
* values then all of its values are emitted. This operator must wait until the
* `complete` notification emission from the source in order to emit the `next`
* values on the output Observable, because otherwise it is impossible to know
* whether or not more values will be emitted on the source. For this reason,
* all values are emitted synchronously, followed by the complete notification.
*
* ## Example
* Take the last 3 values of an Observable with many values
* ```ts
* import { range } from 'rxjs';
* import { takeLast } from 'rxjs/operators';
*
* const many = range(1, 100);
* const lastThree = many.pipe(takeLast(3));
* lastThree.subscribe(x => console.log(x));
* ```
*
* @see {@link take}
* @see {@link takeUntil}
* @see {@link takeWhile}
* @see {@link skip}
*
* @throws {ArgumentOutOfRangeError} When using `takeLast(i)`, it delivers an
* ArgumentOutOrRangeError to the Observer's `error` callback if `i < 0`.
*
* @param {number} count The maximum number of values to emit from the end of
* the sequence of values emitted by the source Observable.
* @return {Observable<T>} An Observable that emits at most the last count
* values emitted by the source Observable.
* @method takeLast
* @owner Observable
*/
export declare function takeLast<T>(count: number): MonoTypeOperatorFunction<T>;

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=Observer.js.map

View File

@@ -0,0 +1,56 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.readFile = readFile;
exports.readFileSync = readFileSync;
var _fs = _interopRequireDefault(require("fs"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
async function fsReadFileAsync(pathname, encoding) {
return new Promise((resolve, reject) => {
_fs.default.readFile(pathname, encoding, (error, contents) => {
if (error) {
reject(error);
return;
}
resolve(contents);
});
});
}
async function readFile(filepath, options = {}) {
const throwNotFound = options.throwNotFound === true;
try {
const content = await fsReadFileAsync(filepath, 'utf8');
return content;
} catch (error) {
if (throwNotFound === false && error.code === 'ENOENT') {
return null;
}
throw error;
}
}
function readFileSync(filepath, options = {}) {
const throwNotFound = options.throwNotFound === true;
try {
const content = _fs.default.readFileSync(filepath, 'utf8');
return content;
} catch (error) {
if (throwNotFound === false && error.code === 'ENOENT') {
return null;
}
throw error;
}
}
//# sourceMappingURL=readFile.js.map

View File

@@ -0,0 +1,62 @@
import { Observable } from '../Observable';
import { isArray } from '../util/isArray';
import { isFunction } from '../util/isFunction';
import { map } from '../operators/map';
const toString = (() => Object.prototype.toString)();
export function fromEvent(target, eventName, options, resultSelector) {
if (isFunction(options)) {
resultSelector = options;
options = undefined;
}
if (resultSelector) {
return fromEvent(target, eventName, options).pipe(map(args => isArray(args) ? resultSelector(...args) : resultSelector(args)));
}
return new Observable(subscriber => {
function handler(e) {
if (arguments.length > 1) {
subscriber.next(Array.prototype.slice.call(arguments));
}
else {
subscriber.next(e);
}
}
setupSubscription(target, eventName, handler, subscriber, options);
});
}
function setupSubscription(sourceObj, eventName, handler, subscriber, options) {
let unsubscribe;
if (isEventTarget(sourceObj)) {
const source = sourceObj;
sourceObj.addEventListener(eventName, handler, options);
unsubscribe = () => source.removeEventListener(eventName, handler, options);
}
else if (isJQueryStyleEventEmitter(sourceObj)) {
const source = sourceObj;
sourceObj.on(eventName, handler);
unsubscribe = () => source.off(eventName, handler);
}
else if (isNodeStyleEventEmitter(sourceObj)) {
const source = sourceObj;
sourceObj.addListener(eventName, handler);
unsubscribe = () => source.removeListener(eventName, handler);
}
else if (sourceObj && sourceObj.length) {
for (let i = 0, len = sourceObj.length; i < len; i++) {
setupSubscription(sourceObj[i], eventName, handler, subscriber, options);
}
}
else {
throw new TypeError('Invalid event target');
}
subscriber.add(unsubscribe);
}
function isNodeStyleEventEmitter(sourceObj) {
return sourceObj && typeof sourceObj.addListener === 'function' && typeof sourceObj.removeListener === 'function';
}
function isJQueryStyleEventEmitter(sourceObj) {
return sourceObj && typeof sourceObj.on === 'function' && typeof sourceObj.off === 'function';
}
function isEventTarget(sourceObj) {
return sourceObj && typeof sourceObj.addEventListener === 'function' && typeof sourceObj.removeEventListener === 'function';
}
//# sourceMappingURL=fromEvent.js.map

View File

@@ -0,0 +1,55 @@
import { Subject } from '../Subject';
import { Subscriber } from '../Subscriber';
import { Subscription } from '../Subscription';
import { Scheduler } from '../Scheduler';
import { TestMessage } from './TestMessage';
import { SubscriptionLog } from './SubscriptionLog';
import { SubscriptionLoggable } from './SubscriptionLoggable';
import { applyMixins } from '../util/applyMixins';
/**
* We need this JSDoc comment for affecting ESDoc.
* @ignore
* @extends {Ignored}
*/
export class HotObservable<T> extends Subject<T> implements SubscriptionLoggable {
public subscriptions: SubscriptionLog[] = [];
scheduler: Scheduler;
logSubscribedFrame: () => number;
logUnsubscribedFrame: (index: number) => void;
constructor(public messages: TestMessage[],
scheduler: Scheduler) {
super();
this.scheduler = scheduler;
}
/** @deprecated This is an internal implementation detail, do not use. */
_subscribe(subscriber: Subscriber<any>): Subscription {
const subject: HotObservable<T> = this;
const index = subject.logSubscribedFrame();
const subscription = new Subscription();
subscription.add(new Subscription(() => {
subject.logUnsubscribedFrame(index);
}));
subscription.add(super._subscribe(subscriber));
return subscription;
}
setup() {
const subject = this;
const messagesLength = subject.messages.length;
/* tslint:disable:no-var-keyword */
for (var i = 0; i < messagesLength; i++) {
(() => {
var message = subject.messages[i];
/* tslint:enable */
subject.scheduler.schedule(
() => { message.notification.observe(subject); },
message.frame
);
})();
}
}
}
applyMixins(HotObservable, [SubscriptionLoggable]);

View File

@@ -0,0 +1,49 @@
interface Style {
(string: string): string
}
export const options: {
enabled: boolean
}
export const reset: Style
export const bold: Style
export const dim: Style
export const italic: Style
export const underline: Style
export const inverse: Style
export const hidden: Style
export const strikethrough: Style
export const black: Style
export const red: Style
export const green: Style
export const yellow: Style
export const blue: Style
export const magenta: Style
export const cyan: Style
export const white: Style
export const gray: Style
export const bgBlack: Style
export const bgRed: Style
export const bgGreen: Style
export const bgYellow: Style
export const bgBlue: Style
export const bgMagenta: Style
export const bgCyan: Style
export const bgWhite: Style
export const blackBright: Style
export const redBright: Style
export const greenBright: Style
export const yellowBright: Style
export const blueBright: Style
export const magentaBright: Style
export const cyanBright: Style
export const whiteBright: Style
export const bgBlackBright: Style
export const bgRedBright: Style
export const bgGreenBright: Style
export const bgYellowBright: Style
export const bgBlueBright: Style
export const bgMagentaBright: Style
export const bgCyanBright: Style
export const bgWhiteBright: Style

View File

@@ -0,0 +1,44 @@
import { Observable } from '../Observable';
import { ObservableInput, SchedulerLike } from '../types';
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T>(v1: ObservableInput<T>, scheduler: SchedulerLike): Observable<T>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T>(v1: ObservableInput<T>, concurrent: number, scheduler: SchedulerLike): Observable<T>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, scheduler: SchedulerLike): Observable<T | T2>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, scheduler: SchedulerLike): Observable<T | T2 | T3>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, concurrent: number, scheduler: SchedulerLike): Observable<T | T2 | T3 | T4 | T5 | T6>;
export declare function merge<T>(v1: ObservableInput<T>): Observable<T>;
export declare function merge<T>(v1: ObservableInput<T>, concurrent?: number): Observable<T>;
export declare function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>): Observable<T | T2>;
export declare function merge<T, T2>(v1: ObservableInput<T>, v2: ObservableInput<T2>, concurrent?: number): Observable<T | T2>;
export declare function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>): Observable<T | T2 | T3>;
export declare function merge<T, T2, T3>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, concurrent?: number): Observable<T | T2 | T3>;
export declare function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>): Observable<T | T2 | T3 | T4>;
export declare function merge<T, T2, T3, T4>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, concurrent?: number): Observable<T | T2 | T3 | T4>;
export declare function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>): Observable<T | T2 | T3 | T4 | T5>;
export declare function merge<T, T2, T3, T4, T5>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, concurrent?: number): Observable<T | T2 | T3 | T4 | T5>;
export declare function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>): Observable<T | T2 | T3 | T4 | T5 | T6>;
export declare function merge<T, T2, T3, T4, T5, T6>(v1: ObservableInput<T>, v2: ObservableInput<T2>, v3: ObservableInput<T3>, v4: ObservableInput<T4>, v5: ObservableInput<T5>, v6: ObservableInput<T6>, concurrent?: number): Observable<T | T2 | T3 | T4 | T5 | T6>;
export declare function merge<T>(...observables: (ObservableInput<T> | number)[]): Observable<T>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T>(...observables: (ObservableInput<T> | SchedulerLike | number)[]): Observable<T>;
export declare function merge<T, R>(...observables: (ObservableInput<any> | number)[]): Observable<R>;
/** @deprecated use {@link scheduled} and {@link mergeAll} (e.g. `scheduled([ob1, ob2, ob3], scheduled).pipe(mergeAll())*/
export declare function merge<T, R>(...observables: (ObservableInput<any> | SchedulerLike | number)[]): Observable<R>;

View File

@@ -0,0 +1,12 @@
const ArgumentOutOfRangeErrorImpl = (() => {
function ArgumentOutOfRangeErrorImpl() {
Error.call(this);
this.message = 'argument out of range';
this.name = 'ArgumentOutOfRangeError';
return this;
}
ArgumentOutOfRangeErrorImpl.prototype = Object.create(Error.prototype);
return ArgumentOutOfRangeErrorImpl;
})();
export const ArgumentOutOfRangeError = ArgumentOutOfRangeErrorImpl;
//# sourceMappingURL=ArgumentOutOfRangeError.js.map

View File

@@ -0,0 +1,4 @@
import { OperatorFunction, SchedulerLike } from '../types';
export declare function bufferTime<T>(bufferTimeSpan: number, scheduler?: SchedulerLike): OperatorFunction<T, T[]>;
export declare function bufferTime<T>(bufferTimeSpan: number, bufferCreationInterval: number | null | undefined, scheduler?: SchedulerLike): OperatorFunction<T, T[]>;
export declare function bufferTime<T>(bufferTimeSpan: number, bufferCreationInterval: number | null | undefined, maxBufferSize: number, scheduler?: SchedulerLike): OperatorFunction<T, T[]>;

View File

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

View File

@@ -0,0 +1,53 @@
declare namespace pLocate {
interface Options {
/**
Number of concurrently pending promises returned by `tester`. Minimum: `1`.
@default Infinity
*/
readonly concurrency?: number;
/**
Preserve `input` order when searching.
Disable this to improve performance if you don't care about the order.
@default true
*/
readonly preserveOrder?: boolean;
}
}
/**
Get the first fulfilled promise that satisfies the provided testing function.
@param input - An iterable of promises/values to test.
@param tester - This function will receive resolved values from `input` and is expected to return a `Promise<boolean>` or `boolean`.
@returns A `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`.
@example
```
import pathExists = require('path-exists');
import pLocate = require('p-locate');
const files = [
'unicorn.png',
'rainbow.png', // Only this one actually exists on disk
'pony.png'
];
(async () => {
const foundPath = await pLocate(files, file => pathExists(file));
console.log(foundPath);
//=> 'rainbow'
})();
```
*/
declare function pLocate<ValueType>(
input: Iterable<PromiseLike<ValueType> | ValueType>,
tester: (element: ValueType) => PromiseLike<boolean> | boolean,
options?: pLocate.Options
): Promise<ValueType | undefined>;
export = pLocate;

View File

@@ -0,0 +1,18 @@
/** PURE_IMPORTS_START _Subscriber PURE_IMPORTS_END */
import { Subscriber } from '../Subscriber';
export function canReportError(observer) {
while (observer) {
var _a = observer, closed_1 = _a.closed, destination = _a.destination, isStopped = _a.isStopped;
if (closed_1 || isStopped) {
return false;
}
else if (destination && destination instanceof Subscriber) {
observer = destination;
}
else {
observer = null;
}
}
return true;
}
//# sourceMappingURL=canReportError.js.map

View File

@@ -0,0 +1,29 @@
var serialOrdered = require('../serialOrdered.js');
// API
module.exports = ReadableSerialOrdered;
// expose sort helpers
module.exports.ascending = serialOrdered.ascending;
module.exports.descending = serialOrdered.descending;
/**
* Streaming wrapper to `asynckit.serialOrdered`
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} sortMethod - custom sort function
* @param {function} callback - invoked when all elements processed
* @returns {stream.Readable#}
*/
function ReadableSerialOrdered(list, iterator, sortMethod, callback)
{
if (!(this instanceof ReadableSerialOrdered))
{
return new ReadableSerialOrdered(list, iterator, sortMethod, callback);
}
// turn on object mode
ReadableSerialOrdered.super_.call(this, {objectMode: true});
this._start(serialOrdered, list, iterator, sortMethod, callback);
}

View File

@@ -0,0 +1,78 @@
/** PURE_IMPORTS_START tslib,_Subscriber,_Subject PURE_IMPORTS_END */
import * as tslib_1 from "tslib";
import { Subscriber } from '../Subscriber';
import { Subject } from '../Subject';
export function windowCount(windowSize, startWindowEvery) {
if (startWindowEvery === void 0) {
startWindowEvery = 0;
}
return function windowCountOperatorFunction(source) {
return source.lift(new WindowCountOperator(windowSize, startWindowEvery));
};
}
var WindowCountOperator = /*@__PURE__*/ (function () {
function WindowCountOperator(windowSize, startWindowEvery) {
this.windowSize = windowSize;
this.startWindowEvery = startWindowEvery;
}
WindowCountOperator.prototype.call = function (subscriber, source) {
return source.subscribe(new WindowCountSubscriber(subscriber, this.windowSize, this.startWindowEvery));
};
return WindowCountOperator;
}());
var WindowCountSubscriber = /*@__PURE__*/ (function (_super) {
tslib_1.__extends(WindowCountSubscriber, _super);
function WindowCountSubscriber(destination, windowSize, startWindowEvery) {
var _this = _super.call(this, destination) || this;
_this.destination = destination;
_this.windowSize = windowSize;
_this.startWindowEvery = startWindowEvery;
_this.windows = [new Subject()];
_this.count = 0;
destination.next(_this.windows[0]);
return _this;
}
WindowCountSubscriber.prototype._next = function (value) {
var startWindowEvery = (this.startWindowEvery > 0) ? this.startWindowEvery : this.windowSize;
var destination = this.destination;
var windowSize = this.windowSize;
var windows = this.windows;
var len = windows.length;
for (var i = 0; i < len && !this.closed; i++) {
windows[i].next(value);
}
var c = this.count - windowSize + 1;
if (c >= 0 && c % startWindowEvery === 0 && !this.closed) {
windows.shift().complete();
}
if (++this.count % startWindowEvery === 0 && !this.closed) {
var window_1 = new Subject();
windows.push(window_1);
destination.next(window_1);
}
};
WindowCountSubscriber.prototype._error = function (err) {
var windows = this.windows;
if (windows) {
while (windows.length > 0 && !this.closed) {
windows.shift().error(err);
}
}
this.destination.error(err);
};
WindowCountSubscriber.prototype._complete = function () {
var windows = this.windows;
if (windows) {
while (windows.length > 0 && !this.closed) {
windows.shift().complete();
}
}
this.destination.complete();
};
WindowCountSubscriber.prototype._unsubscribe = function () {
this.count = 0;
this.windows = null;
};
return WindowCountSubscriber;
}(Subscriber));
//# sourceMappingURL=windowCount.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"mapTo.js","sources":["../../../src/internal/operators/mapTo.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAoC3C,MAAM,UAAU,KAAK,CAAO,KAAQ;IAClC,OAAO,UAAC,MAAqB,IAAK,OAAA,MAAM,CAAC,IAAI,CAAC,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,EAArC,CAAqC,CAAC;AAC1E,CAAC;AAED;IAIE,uBAAY,KAAQ;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED,4BAAI,GAAJ,UAAK,UAAyB,EAAE,MAAW;QACzC,OAAO,MAAM,CAAC,SAAS,CAAC,IAAI,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACvE,CAAC;IACH,oBAAC;AAAD,CAAC,AAXD,IAWC;AAOD;IAAoC,2CAAa;IAI/C,yBAAY,WAA0B,EAAE,KAAQ;QAAhD,YACE,kBAAM,WAAW,CAAC,SAEnB;QADC,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;;IACrB,CAAC;IAES,+BAAK,GAAf,UAAgB,CAAI;QAClB,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACpC,CAAC;IACH,sBAAC;AAAD,CAAC,AAZD,CAAoC,UAAU,GAY7C"}