X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.config%2Fcoc%2Fextensions%2Fnode_modules%2Fcoc-prettier%2Fnode_modules%2Frxjs%2Fsrc%2Finternal%2Fobservable%2Fzip.ts;h=1f03caa30c84991b2db3a64adf005a83a6d07e24;hp=fbe0756573b1d6f49bd2c2d1dd2769e61c0795f4;hb=4d07c77cf4d78cab8639e13ddc3c22495e585b0b;hpb=b3950616b54221c40a7dab9099bda675007e5b6e diff --git a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/observable/zip.ts b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/observable/zip.ts index fbe07565..1f03caa3 100644 --- a/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/observable/zip.ts +++ b/.config/coc/extensions/node_modules/coc-prettier/node_modules/rxjs/src/internal/observable/zip.ts @@ -5,10 +5,8 @@ import { Operator } from '../Operator'; import { ObservableInput, PartialObserver, ObservedValueOf } from '../types'; import { Subscriber } from '../Subscriber'; import { Subscription } from '../Subscription'; -import { OuterSubscriber } from '../OuterSubscriber'; -import { InnerSubscriber } from '../InnerSubscriber'; -import { subscribeToResult } from '../util/subscribeToResult'; import { iterator as Symbol_iterator } from '../../internal/symbol/iterator'; +import { SimpleOuterSubscriber, SimpleInnerSubscriber, innerSubscribe } from '../innerSubscribe'; /* tslint:disable:max-line-length */ /** @deprecated resultSelector is no longer supported, pipe to map instead */ @@ -87,7 +85,7 @@ export function zip, R>( export class ZipOperator implements Operator { - resultSelector: (...values: Array) => R; + resultSelector?: (...values: Array) => R; constructor(resultSelector?: (...values: Array) => R) { this.resultSelector = resultSelector; @@ -104,17 +102,14 @@ export class ZipOperator implements Operator { * @extends {Ignored} */ export class ZipSubscriber extends Subscriber { - private values: any; - private resultSelector: (...values: Array) => R; private iterators: LookAheadIterator[] = []; private active = 0; constructor(destination: Subscriber, - resultSelector?: (...values: Array) => R, + private resultSelector?: (...values: Array) => R, values: any = Object.create(null)) { super(destination); - this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : null; - this.values = values; + this.resultSelector = (typeof resultSelector === 'function') ? resultSelector : undefined; } protected _next(value: any) { @@ -135,7 +130,7 @@ export class ZipSubscriber extends Subscriber { this.unsubscribe(); if (len === 0) { - this.destination.complete(); + this.destination.complete!(); return; } @@ -144,7 +139,7 @@ export class ZipSubscriber extends Subscriber { let iterator: ZipBufferIterator = iterators[i]; if (iterator.stillUnsubscribed) { const destination = this.destination as Subscription; - destination.add(iterator.subscribe(iterator, i)); + destination.add(iterator.subscribe()); } else { this.active--; // not an observable } @@ -154,7 +149,7 @@ export class ZipSubscriber extends Subscriber { notifyInactive() { this.active--; if (this.active === 0) { - this.destination.complete(); + this.destination.complete!(); } } @@ -184,7 +179,7 @@ export class ZipSubscriber extends Subscriber { } if (result.done) { - destination.complete(); + destination.complete!(); return; } @@ -194,23 +189,23 @@ export class ZipSubscriber extends Subscriber { if (this.resultSelector) { this._tryresultSelector(args); } else { - destination.next(args); + destination.next!(args); } if (shouldComplete) { - destination.complete(); + destination.complete!(); } } protected _tryresultSelector(args: any[]) { let result: any; try { - result = this.resultSelector.apply(this, args); + result = this.resultSelector!.apply(this, args); } catch (err) { - this.destination.error(err); + this.destination.error!(err); return; } - this.destination.next(result); + this.destination.next!(result); } } @@ -236,9 +231,9 @@ class StaticIterator implements LookAheadIterator { return result; } - hasCompleted() { + hasCompleted(): boolean { const nextResult = this.nextResult; - return nextResult && nextResult.done; + return Boolean(nextResult && nextResult.done); } } @@ -274,7 +269,7 @@ class StaticArrayIterator implements LookAheadIterator { * @ignore * @extends {Ignored} */ -class ZipBufferIterator extends OuterSubscriber implements LookAheadIterator { +class ZipBufferIterator extends SimpleOuterSubscriber implements LookAheadIterator { stillUnsubscribed = true; buffer: T[] = []; isComplete = false; @@ -296,7 +291,7 @@ class ZipBufferIterator extends OuterSubscriber implements LookAhead if (buffer.length === 0 && this.isComplete) { return { value: null, done: true }; } else { - return { value: buffer.shift(), done: false }; + return { value: buffer.shift()!, done: false }; } } @@ -313,18 +308,16 @@ class ZipBufferIterator extends OuterSubscriber implements LookAhead this.isComplete = true; this.parent.notifyInactive(); } else { - this.destination.complete(); + this.destination.complete!(); } } - notifyNext(outerValue: T, innerValue: any, - outerIndex: number, innerIndex: number, - innerSub: InnerSubscriber): void { + notifyNext(innerValue: any): void { this.buffer.push(innerValue); this.parent.checkIterators(); } - subscribe(value: any, index: number) { - return subscribeToResult(this, this.observable, this, index); + subscribe() { + return innerSubscribe(this.observable, new SimpleInnerSubscriber(this)); } }