rxjs-rails 2.3.9 → 2.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rxjs/rails/version.rb +1 -1
- data/vendor/assets/javascripts/rx.aggregates.js +174 -204
- data/vendor/assets/javascripts/rx.aggregates.min.js +1 -1
- data/vendor/assets/javascripts/rx.all.compat.js +1626 -1528
- data/vendor/assets/javascripts/rx.all.compat.min.js +3 -3
- data/vendor/assets/javascripts/rx.all.js +1624 -1526
- data/vendor/assets/javascripts/rx.all.min.js +3 -3
- data/vendor/assets/javascripts/rx.async.compat.js +241 -0
- data/vendor/assets/javascripts/rx.async.compat.min.js +1 -1
- data/vendor/assets/javascripts/rx.async.js +241 -0
- data/vendor/assets/javascripts/rx.async.min.js +1 -1
- data/vendor/assets/javascripts/rx.backpressure.js +3 -3
- data/vendor/assets/javascripts/rx.backpressure.min.js +1 -1
- data/vendor/assets/javascripts/rx.binding.js +350 -378
- data/vendor/assets/javascripts/rx.binding.min.js +1 -1
- data/vendor/assets/javascripts/rx.coincidence.js +16 -21
- data/vendor/assets/javascripts/rx.compat.js +633 -683
- data/vendor/assets/javascripts/rx.compat.min.js +2 -2
- data/vendor/assets/javascripts/rx.js +633 -683
- data/vendor/assets/javascripts/rx.lite.compat.js +941 -1137
- data/vendor/assets/javascripts/rx.lite.compat.min.js +2 -2
- data/vendor/assets/javascripts/rx.lite.extras.js +58 -74
- data/vendor/assets/javascripts/rx.lite.extras.min.js +1 -1
- data/vendor/assets/javascripts/rx.lite.js +941 -1137
- data/vendor/assets/javascripts/rx.lite.min.js +2 -2
- data/vendor/assets/javascripts/rx.min.js +2 -2
- data/vendor/assets/javascripts/rx.time.js +182 -212
- data/vendor/assets/javascripts/rx.time.min.js +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ede904dde917b436ee0076d08869656a5313ee05
|
4
|
+
data.tar.gz: 05be0488209bd1bc630b2ed247abf1358df85068
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 495b47df07c77a48ec8c99799da1910e07ba96b850a2ad4d1b5fdbb73826b249cbce8c3f92d4989390aec21012c416fa402ccb97f2cc0bb5b2b4a50a8741470b
|
7
|
+
data.tar.gz: 66a5aa342b5df3c1d6ab47d9003ce6d805ef14dbc6b207fee1809075cee2edb59a504ab9a46a6b402611c8c845509f62fbbab965147220ce0ad9107be4513617
|
data/lib/rxjs/rails/version.rb
CHANGED
@@ -44,6 +44,7 @@
|
|
44
44
|
defaultComparer = helpers.defaultComparer,
|
45
45
|
identity = helpers.identity,
|
46
46
|
defaultSubComparer = helpers.defaultSubComparer,
|
47
|
+
isFunction = helpers.isFunction,
|
47
48
|
isPromise = helpers.isPromise,
|
48
49
|
observableFromPromise = Observable.fromPromise;
|
49
50
|
|
@@ -69,42 +70,40 @@
|
|
69
70
|
});
|
70
71
|
};
|
71
72
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
});
|
107
|
-
}
|
73
|
+
function extremaBy(source, keySelector, comparer) {
|
74
|
+
return new AnonymousObservable(function (observer) {
|
75
|
+
var hasValue = false, lastKey = null, list = [];
|
76
|
+
return source.subscribe(function (x) {
|
77
|
+
var comparison, key;
|
78
|
+
try {
|
79
|
+
key = keySelector(x);
|
80
|
+
} catch (ex) {
|
81
|
+
observer.onError(ex);
|
82
|
+
return;
|
83
|
+
}
|
84
|
+
comparison = 0;
|
85
|
+
if (!hasValue) {
|
86
|
+
hasValue = true;
|
87
|
+
lastKey = key;
|
88
|
+
} else {
|
89
|
+
try {
|
90
|
+
comparison = comparer(key, lastKey);
|
91
|
+
} catch (ex1) {
|
92
|
+
observer.onError(ex1);
|
93
|
+
return;
|
94
|
+
}
|
95
|
+
}
|
96
|
+
if (comparison > 0) {
|
97
|
+
lastKey = key;
|
98
|
+
list = [];
|
99
|
+
}
|
100
|
+
if (comparison >= 0) { list.push(x); }
|
101
|
+
}, observer.onError.bind(observer), function () {
|
102
|
+
observer.onNext(list);
|
103
|
+
observer.onCompleted();
|
104
|
+
});
|
105
|
+
});
|
106
|
+
}
|
108
107
|
|
109
108
|
function firstOnly(x) {
|
110
109
|
if (x.length === 0) {
|
@@ -235,22 +234,22 @@
|
|
235
234
|
});
|
236
235
|
};
|
237
236
|
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
237
|
+
/**
|
238
|
+
* Computes the sum of a sequence of values that are obtained by invoking an optional transform function on each element of the input sequence, else if not specified computes the sum on each item in the sequence.
|
239
|
+
* @example
|
240
|
+
* var res = source.sum();
|
241
|
+
* var res = source.sum(function (x) { return x.value; });
|
242
|
+
* @param {Function} [selector] A transform function to apply to each element.
|
243
|
+
* @param {Any} [thisArg] Object to use as this when executing callback.
|
244
|
+
* @returns {Observable} An observable sequence containing a single element with the sum of the values in the source sequence.
|
245
|
+
*/
|
246
|
+
observableProto.sum = function (keySelector, thisArg) {
|
247
|
+
return keySelector && isFunction(keySelector) ?
|
248
|
+
this.map(keySelector, thisArg).sum() :
|
249
|
+
this.aggregate(0, function (prev, curr) {
|
250
|
+
return prev + curr;
|
251
|
+
});
|
252
|
+
};
|
254
253
|
|
255
254
|
/**
|
256
255
|
* Returns the elements in an observable sequence with the minimum key value according to the specified comparer.
|
@@ -339,27 +338,25 @@
|
|
339
338
|
};
|
340
339
|
|
341
340
|
function sequenceEqualArray(first, second, comparer) {
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
if (!equal) {
|
355
|
-
observer.onNext(false);
|
356
|
-
observer.onCompleted();
|
357
|
-
}
|
358
|
-
}, observer.onError.bind(observer), function () {
|
359
|
-
observer.onNext(count === len);
|
341
|
+
return new AnonymousObservable(function (observer) {
|
342
|
+
var count = 0, len = second.length;
|
343
|
+
return first.subscribe(function (value) {
|
344
|
+
var equal = false;
|
345
|
+
try {
|
346
|
+
count < len && (equal = comparer(value, second[count++]));
|
347
|
+
} catch (e) {
|
348
|
+
observer.onError(e);
|
349
|
+
return;
|
350
|
+
}
|
351
|
+
if (!equal) {
|
352
|
+
observer.onNext(false);
|
360
353
|
observer.onCompleted();
|
361
|
-
}
|
354
|
+
}
|
355
|
+
}, observer.onError.bind(observer), function () {
|
356
|
+
observer.onNext(count === len);
|
357
|
+
observer.onCompleted();
|
362
358
|
});
|
359
|
+
});
|
363
360
|
}
|
364
361
|
|
365
362
|
/**
|
@@ -385,17 +382,17 @@
|
|
385
382
|
var subscription1 = first.subscribe(function (x) {
|
386
383
|
var equal, v;
|
387
384
|
if (qr.length > 0) {
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
385
|
+
v = qr.shift();
|
386
|
+
try {
|
387
|
+
equal = comparer(v, x);
|
388
|
+
} catch (e) {
|
389
|
+
observer.onError(e);
|
390
|
+
return;
|
391
|
+
}
|
392
|
+
if (!equal) {
|
393
|
+
observer.onNext(false);
|
394
|
+
observer.onCompleted();
|
395
|
+
}
|
399
396
|
} else if (doner) {
|
400
397
|
observer.onNext(false);
|
401
398
|
observer.onCompleted();
|
@@ -417,9 +414,9 @@
|
|
417
414
|
|
418
415
|
isPromise(second) && (second = observableFromPromise(second));
|
419
416
|
var subscription2 = second.subscribe(function (x) {
|
420
|
-
var equal
|
417
|
+
var equal;
|
421
418
|
if (ql.length > 0) {
|
422
|
-
v = ql.shift();
|
419
|
+
var v = ql.shift();
|
423
420
|
try {
|
424
421
|
equal = comparer(v, x);
|
425
422
|
} catch (exception) {
|
@@ -499,60 +496,60 @@
|
|
499
496
|
return elementAtOrDefault(this, index, true, defaultValue);
|
500
497
|
};
|
501
498
|
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
499
|
+
function singleOrDefaultAsync(source, hasDefault, defaultValue) {
|
500
|
+
return new AnonymousObservable(function (observer) {
|
501
|
+
var value = defaultValue, seenValue = false;
|
502
|
+
return source.subscribe(function (x) {
|
503
|
+
if (seenValue) {
|
504
|
+
observer.onError(new Error('Sequence contains more than one element'));
|
505
|
+
} else {
|
506
|
+
value = x;
|
507
|
+
seenValue = true;
|
508
|
+
}
|
509
|
+
}, observer.onError.bind(observer), function () {
|
510
|
+
if (!seenValue && !hasDefault) {
|
511
|
+
observer.onError(new Error(sequenceContainsNoElements));
|
512
|
+
} else {
|
513
|
+
observer.onNext(value);
|
514
|
+
observer.onCompleted();
|
515
|
+
}
|
516
|
+
});
|
517
|
+
});
|
518
|
+
}
|
522
519
|
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
520
|
+
/**
|
521
|
+
* Returns the only element of an observable sequence that satisfies the condition in the optional predicate, and reports an exception if there is not exactly one element in the observable sequence.
|
522
|
+
* @example
|
523
|
+
* var res = res = source.single();
|
524
|
+
* var res = res = source.single(function (x) { return x === 42; });
|
525
|
+
* @param {Function} [predicate] A predicate function to evaluate for elements in the source sequence.
|
526
|
+
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
527
|
+
* @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate.
|
528
|
+
*/
|
529
|
+
observableProto.single = function (predicate, thisArg) {
|
530
|
+
return predicate && isFunction(predicate) ?
|
531
|
+
this.where(predicate, thisArg).single() :
|
532
|
+
singleOrDefaultAsync(this, false);
|
533
|
+
};
|
537
534
|
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
535
|
+
/**
|
536
|
+
* Returns the only element of an observable sequence that matches the predicate, or a default value if no such element exists; this method reports an exception if there is more than one element in the observable sequence.
|
537
|
+
* @example
|
538
|
+
* var res = res = source.singleOrDefault();
|
539
|
+
* var res = res = source.singleOrDefault(function (x) { return x === 42; });
|
540
|
+
* res = source.singleOrDefault(function (x) { return x === 42; }, 0);
|
541
|
+
* res = source.singleOrDefault(null, 0);
|
542
|
+
* @memberOf Observable#
|
543
|
+
* @param {Function} predicate A predicate function to evaluate for elements in the source sequence.
|
544
|
+
* @param [defaultValue] The default value if the index is outside the bounds of the source sequence.
|
545
|
+
* @param {Any} [thisArg] Object to use as `this` when executing the predicate.
|
546
|
+
* @returns {Observable} Sequence containing the single element in the observable sequence that satisfies the condition in the predicate, or a default value if no such element exists.
|
547
|
+
*/
|
548
|
+
observableProto.singleOrDefault = function (predicate, defaultValue, thisArg) {
|
549
|
+
return predicate && isFunction(predicate) ?
|
550
|
+
this.where(predicate, thisArg).singleOrDefault(null, defaultValue) :
|
551
|
+
singleOrDefaultAsync(this, true, defaultValue);
|
552
|
+
};
|
556
553
|
function firstOrDefaultAsync(source, hasDefault, defaultValue) {
|
557
554
|
return new AnonymousObservable(function (observer) {
|
558
555
|
return source.subscribe(function (x) {
|
@@ -697,71 +694,26 @@
|
|
697
694
|
return findValue(this, predicate, thisArg, true);
|
698
695
|
};
|
699
696
|
|
700
|
-
function toSet(source, type) {
|
701
|
-
return new AnonymousObservable(function (observer) {
|
702
|
-
var s = new type();
|
703
|
-
return source.subscribe(
|
704
|
-
s.add.bind(s),
|
705
|
-
observer.onError.bind(observer),
|
706
|
-
function () {
|
707
|
-
observer.onNext(s);
|
708
|
-
observer.onCompleted();
|
709
|
-
});
|
710
|
-
});
|
711
|
-
}
|
712
697
|
if (!!root.Set) {
|
713
698
|
/**
|
714
699
|
* Converts the observable sequence to a Set if it exists.
|
715
700
|
* @returns {Observable} An observable sequence with a single value of a Set containing the values from the observable sequence.
|
716
701
|
*/
|
717
702
|
observableProto.toSet = function () {
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
703
|
+
var source = this;
|
704
|
+
return new AnonymousObservable(function (observer) {
|
705
|
+
var s = new root.Set();
|
706
|
+
return source.subscribe(
|
707
|
+
s.add.bind(s),
|
708
|
+
observer.onError.bind(observer),
|
709
|
+
function () {
|
710
|
+
observer.onNext(s);
|
711
|
+
observer.onCompleted();
|
712
|
+
});
|
713
|
+
});
|
729
714
|
};
|
730
715
|
}
|
731
716
|
|
732
|
-
function toMap(source, type, keySelector, elementSelector) {
|
733
|
-
return new AnonymousObservable(function (observer) {
|
734
|
-
var m = new type();
|
735
|
-
return source.subscribe(
|
736
|
-
function (x) {
|
737
|
-
var key;
|
738
|
-
try {
|
739
|
-
key = keySelector(x);
|
740
|
-
} catch (e) {
|
741
|
-
observer.onError(e);
|
742
|
-
return;
|
743
|
-
}
|
744
|
-
|
745
|
-
var element = x;
|
746
|
-
if (elementSelector) {
|
747
|
-
try {
|
748
|
-
element = elementSelector(x);
|
749
|
-
} catch (e) {
|
750
|
-
observer.onError(e);
|
751
|
-
return;
|
752
|
-
}
|
753
|
-
}
|
754
|
-
|
755
|
-
m.set(key, element);
|
756
|
-
},
|
757
|
-
observer.onError.bind(observer),
|
758
|
-
function () {
|
759
|
-
observer.onNext(m);
|
760
|
-
observer.onCompleted();
|
761
|
-
});
|
762
|
-
});
|
763
|
-
}
|
764
|
-
|
765
717
|
if (!!root.Map) {
|
766
718
|
/**
|
767
719
|
* Converts the observable sequence to a Map if it exists.
|
@@ -770,19 +722,37 @@
|
|
770
722
|
* @returns {Observable} An observable sequence with a single value of a Map containing the values from the observable sequence.
|
771
723
|
*/
|
772
724
|
observableProto.toMap = function (keySelector, elementSelector) {
|
773
|
-
|
774
|
-
|
775
|
-
|
725
|
+
var source = this;
|
726
|
+
return new AnonymousObservable(function (observer) {
|
727
|
+
var m = new root.Map();
|
728
|
+
return source.subscribe(
|
729
|
+
function (x) {
|
730
|
+
var key;
|
731
|
+
try {
|
732
|
+
key = keySelector(x);
|
733
|
+
} catch (e) {
|
734
|
+
observer.onError(e);
|
735
|
+
return;
|
736
|
+
}
|
776
737
|
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
738
|
+
var element = x;
|
739
|
+
if (elementSelector) {
|
740
|
+
try {
|
741
|
+
element = elementSelector(x);
|
742
|
+
} catch (e) {
|
743
|
+
observer.onError(e);
|
744
|
+
return;
|
745
|
+
}
|
746
|
+
}
|
747
|
+
|
748
|
+
m.set(key, element);
|
749
|
+
},
|
750
|
+
observer.onError.bind(observer),
|
751
|
+
function () {
|
752
|
+
observer.onNext(m);
|
753
|
+
observer.onCompleted();
|
754
|
+
});
|
755
|
+
});
|
786
756
|
};
|
787
757
|
}
|
788
758
|
|
@@ -1 +1 @@
|
|
1
|
-
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b,c){return new
|
1
|
+
(function(a){var b={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},c=b[typeof window]&&window||this,d=b[typeof exports]&&exports&&!exports.nodeType&&exports,e=b[typeof module]&&module&&!module.nodeType&&module,f=(e&&e.exports===d&&d,b[typeof global]&&global);!f||f.global!==f&&f.window!==f||(c=f),"function"==typeof define&&define.amd?define(["rx","exports"],function(b,d){return c.Rx=a(c,d,b),c.Rx}):"object"==typeof module&&module&&module.exports===d?module.exports=a(c,module.exports,require("./rx")):c.Rx=a(c,{},c.Rx)}).call(this,function(a,b,c,d){function e(a,b,c){return new p(function(d){var e=!1,f=null,g=[];return a.subscribe(function(a){var h,i;try{i=b(a)}catch(j){return void d.onError(j)}if(h=0,e)try{h=c(i,f)}catch(k){return void d.onError(k)}else e=!0,f=i;h>0&&(f=i,g=[]),h>=0&&g.push(a)},d.onError.bind(d),function(){d.onNext(g),d.onCompleted()})})}function f(a){if(0===a.length)throw new Error(z);return a[0]}function g(a,b,c){return new p(function(d){var e=0,f=b.length;return a.subscribe(function(a){var g=!1;try{f>e&&(g=c(a,b[e++]))}catch(h){return void d.onError(h)}g||(d.onNext(!1),d.onCompleted())},d.onError.bind(d),function(){d.onNext(e===f),d.onCompleted()})})}function h(a,b,c,d){if(0>b)throw new Error(y);return new p(function(e){var f=b;return a.subscribe(function(a){0===f&&(e.onNext(a),e.onCompleted()),f--},e.onError.bind(e),function(){c?(e.onNext(d),e.onCompleted()):e.onError(new Error(y))})})}function i(a,b,c){return new p(function(d){var e=c,f=!1;return a.subscribe(function(a){f?d.onError(new Error("Sequence contains more than one element")):(e=a,f=!0)},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(z))})})}function j(a,b,c){return new p(function(d){return a.subscribe(function(a){d.onNext(a),d.onCompleted()},d.onError.bind(d),function(){b?(d.onNext(c),d.onCompleted()):d.onError(new Error(z))})})}function k(a,b,c){return new p(function(d){var e=c,f=!1;return a.subscribe(function(a){e=a,f=!0},d.onError.bind(d),function(){f||b?(d.onNext(e),d.onCompleted()):d.onError(new Error(z))})})}function l(a,b,c,e){return new p(function(f){var g=0;return a.subscribe(function(d){var h;try{h=b.call(c,d,g,a)}catch(i){return void f.onError(i)}h?(f.onNext(e?g:d),f.onCompleted()):g++},f.onError.bind(f),function(){f.onNext(e?-1:d),f.onCompleted()})})}var m=c.Observable,n=m.prototype,o=c.CompositeDisposable,p=c.AnonymousObservable,q=(c.internals.isEqual,c.helpers),r=q.not,s=q.defaultComparer,t=q.identity,u=q.defaultSubComparer,v=q.isFunction,w=q.isPromise,x=m.fromPromise,y="Argument out of range",z="Sequence contains no elements.";return n.finalValue=function(){var a=this;return new p(function(b){var c,d=!1;return a.subscribe(function(a){d=!0,c=a},b.onError.bind(b),function(){d?(b.onNext(c),b.onCompleted()):b.onError(new Error(z))})})},n.aggregate=function(){var a,b,c;return 2===arguments.length?(a=arguments[0],b=!0,c=arguments[1]):c=arguments[0],b?this.scan(a,c).startWith(a).finalValue():this.scan(c).finalValue()},n.reduce=function(a){var b,c;return 2===arguments.length&&(c=!0,b=arguments[1]),c?this.scan(b,a).startWith(b).finalValue():this.scan(a).finalValue()},n.some=n.any=function(a,b){var c=this;return a?c.where(a,b).any():new p(function(a){return c.subscribe(function(){a.onNext(!0),a.onCompleted()},a.onError.bind(a),function(){a.onNext(!1),a.onCompleted()})})},n.isEmpty=function(){return this.any().map(r)},n.every=n.all=function(a,b){return this.where(function(b){return!a(b)},b).any().select(function(a){return!a})},n.contains=function(a,b){return b||(b=s),this.where(function(c){return b(c,a)}).any()},n.count=function(a,b){return a?this.where(a,b).count():this.aggregate(0,function(a){return a+1})},n.sum=function(a,b){return a&&v(a)?this.map(a,b).sum():this.aggregate(0,function(a,b){return a+b})},n.minBy=function(a,b){return b||(b=u),e(this,a,function(a,c){return-1*b(a,c)})},n.min=function(a){return this.minBy(t,a).select(function(a){return f(a)})},n.maxBy=function(a,b){return b||(b=u),e(this,a,b)},n.max=function(a){return this.maxBy(t,a).select(function(a){return f(a)})},n.average=function(a,b){return a?this.select(a,b).average():this.scan({sum:0,count:0},function(a,b){return{sum:a.sum+b,count:a.count+1}}).finalValue().select(function(a){if(0===a.count)throw new Error("The input sequence was empty");return a.sum/a.count})},n.sequenceEqual=function(a,b){var c=this;return b||(b=s),Array.isArray(a)?g(c,a,b):new p(function(d){var e=!1,f=!1,g=[],h=[],i=c.subscribe(function(a){var c,e;if(h.length>0){e=h.shift();try{c=b(e,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else f?(d.onNext(!1),d.onCompleted()):g.push(a)},d.onError.bind(d),function(){e=!0,0===g.length&&(h.length>0?(d.onNext(!1),d.onCompleted()):f&&(d.onNext(!0),d.onCompleted()))});w(a)&&(a=x(a));var j=a.subscribe(function(a){var c;if(g.length>0){var f=g.shift();try{c=b(f,a)}catch(i){return void d.onError(i)}c||(d.onNext(!1),d.onCompleted())}else e?(d.onNext(!1),d.onCompleted()):h.push(a)},d.onError.bind(d),function(){f=!0,0===h.length&&(g.length>0?(d.onNext(!1),d.onCompleted()):e&&(d.onNext(!0),d.onCompleted()))});return new o(i,j)})},n.elementAt=function(a){return h(this,a,!1)},n.elementAtOrDefault=function(a,b){return h(this,a,!0,b)},n.single=function(a,b){return a&&v(a)?this.where(a,b).single():i(this,!1)},n.singleOrDefault=function(a,b,c){return a&&v(a)?this.where(a,c).singleOrDefault(null,b):i(this,!0,b)},n.first=function(a,b){return a?this.where(a,b).first():j(this,!1)},n.firstOrDefault=function(a,b){return a?this.where(a).firstOrDefault(null,b):j(this,!0,b)},n.last=function(a,b){return a?this.where(a,b).last():k(this,!1)},n.lastOrDefault=function(a,b,c){return a?this.where(a,c).lastOrDefault(null,b):k(this,!0,b)},n.find=function(a,b){return l(this,a,b,!1)},n.findIndex=function(a,b){return l(this,a,b,!0)},a.Set&&(n.toSet=function(){var b=this;return new p(function(c){var d=new a.Set;return b.subscribe(d.add.bind(d),c.onError.bind(c),function(){c.onNext(d),c.onCompleted()})})}),a.Map&&(n.toMap=function(b,c){var d=this;return new p(function(e){var f=new a.Map;return d.subscribe(function(a){var d;try{d=b(a)}catch(g){return void e.onError(g)}var h=a;if(c)try{h=c(a)}catch(g){return void e.onError(g)}f.set(d,h)},e.onError.bind(e),function(){e.onNext(f),e.onCompleted()})})}),c});
|