| Server IP : 185.208.173.17 / Your IP : 87.236.161.98 Web Server : Microsoft-IIS/10.0 System : Windows NT SRV8576125506 10.0 build 26100 (Windows Server 2016) AMD64 User : IUSR ( 0) PHP Version : 7.4.13 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/inetpub/wwwroot/parsmega.nuxt/node_modules/rxjs/_esm2015/internal/operators/ |
Upload File : |
import { Subscriber } from '../Subscriber';
export function sequenceEqual(compareTo, comparator) {
return (source) => source.lift(new SequenceEqualOperator(compareTo, comparator));
}
export class SequenceEqualOperator {
constructor(compareTo, comparator) {
this.compareTo = compareTo;
this.comparator = comparator;
}
call(subscriber, source) {
return source.subscribe(new SequenceEqualSubscriber(subscriber, this.compareTo, this.comparator));
}
}
export class SequenceEqualSubscriber extends Subscriber {
constructor(destination, compareTo, comparator) {
super(destination);
this.compareTo = compareTo;
this.comparator = comparator;
this._a = [];
this._b = [];
this._oneComplete = false;
this.destination.add(compareTo.subscribe(new SequenceEqualCompareToSubscriber(destination, this)));
}
_next(value) {
if (this._oneComplete && this._b.length === 0) {
this.emit(false);
}
else {
this._a.push(value);
this.checkValues();
}
}
_complete() {
if (this._oneComplete) {
this.emit(this._a.length === 0 && this._b.length === 0);
}
else {
this._oneComplete = true;
}
this.unsubscribe();
}
checkValues() {
const { _a, _b, comparator } = this;
while (_a.length > 0 && _b.length > 0) {
let a = _a.shift();
let b = _b.shift();
let areEqual = false;
try {
areEqual = comparator ? comparator(a, b) : a === b;
}
catch (e) {
this.destination.error(e);
}
if (!areEqual) {
this.emit(false);
}
}
}
emit(value) {
const { destination } = this;
destination.next(value);
destination.complete();
}
nextB(value) {
if (this._oneComplete && this._a.length === 0) {
this.emit(false);
}
else {
this._b.push(value);
this.checkValues();
}
}
completeB() {
if (this._oneComplete) {
this.emit(this._a.length === 0 && this._b.length === 0);
}
else {
this._oneComplete = true;
}
}
}
class SequenceEqualCompareToSubscriber extends Subscriber {
constructor(destination, parent) {
super(destination);
this.parent = parent;
}
_next(value) {
this.parent.nextB(value);
}
_error(err) {
this.parent.error(err);
this.unsubscribe();
}
_complete() {
this.parent.completeB();
this.unsubscribe();
}
}
//# sourceMappingURL=sequenceEqual.js.map