8000 Deploy 8a11e5805af2ab40163ed531b0faccf559bccf82 to NPM branch · MULXCODE/immutable-js@7af37b7 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7af37b7

Browse files
author
Travis CI
committed
Deploy 8a11e58 to NPM branch
1 parent 1db9a88 commit 7af37b7

File tree

6 files changed

+67
-175
lines changed

6 files changed

+67
-175
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -618,7 +618,7 @@ Contribution
618618

619619
Use [Github issues](https://github.com/facebook/immutable-js/issues) for requests.
620620

621-
We actively welcome pull requests, learn how to [contribute](./.github/CONTRIBUTING.md).
621+
We actively welcome pull requests, learn how to [contribute](https://github.com/facebook/immutable-js/blob/master/.github/CONTRIBUTING.md).
622622

623623

624624
Changelog

dist/immutable-nonambient.d.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3008,10 +3008,13 @@
30083008
* * If a `Seq`, that same `Seq`.
30093009
* * If an `Collection`, a `Seq` of the same kind (Keyed, Indexed, or Set).
30103010
* * If an Array-like, an `Seq.Indexed`.
3011-
* * If an Object with an Iterator, an `Seq.Indexed`.
3012-
* * If an Iterator, an `Seq.Indexed`.
3011+
* * If an Iterable Object, an `Seq.Indexed`.
30133012
* * If an Object, a `Seq.Keyed`.
30143013
*
3014+
* Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`,
3015+
* which is usually not what you want. You should turn your Iterator Object into
3016+
* an iterable object by defining a Symbol.iterator (or @@iterator) method which
3017+
* returns `this`.
30153018
*/
30163019
export function Seq<S extends Seq<any, any>>(seq: S): S;
30173020
export function Seq<K, V>(collection: Collection.Keyed<K, V>): Seq.Keyed<K, V>;
@@ -3723,13 +3726,17 @@
37233726
*
37243727
* * If an `Collection`, that same `Collection`.
37253728
* * If an Array-like, an `Collection.Indexed`.
3726-
* * If an Object with an Iterator, an `Collection.Indexed`.
3727-
* * If an Iterator, an `Collection.Indexed`.
3729+
* * If an Object with an Iterator defined, an `Collection.Indexed`.
37283730
* * If an Object, an `Collection.Keyed`.
37293731
*
37303732
* This methods forces the conversion of Objects and Strings to Collections.
37313733
* If you want to ensure that a Collection of one item is returned, use
37323734
* `Seq.of`.
3735+
*
3736+
* Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`,
3737+
* which is usually not what you want. You should turn your Iterator Object into
3738+
* an iterable object by defining a Symbol.iterator (or @@iterator) method which
3739+
* returns `this`.
37333740
*/
37343741
export function Collection<I extends Collection<any, any>>(collection: I): I;
37353742
export function Collection<T>(collection: Iterable<T>): Collection.Indexed<T>;

dist/immutable.d.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3008,10 +3008,13 @@ declare module Immutable {
30083008
* * If a `Seq`, that same ` 6D40 Seq`.
30093009
* * If an `Collection`, a `Seq` of the same kind (Keyed, Indexed, or Set).
30103010
* * If an Array-like, an `Seq.Indexed`.
3011-
* * If an Object with an Iterator, an `Seq.Indexed`.
3012-
* * If an Iterator, an `Seq.Indexed`.
3011+
* * If an Iterable Object, an `Seq.Indexed`.
30133012
* * If an Object, a `Seq.Keyed`.
30143013
*
3014+
* Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`,
3015+
* which is usually not what you want. You should turn your Iterator Object into
3016+
* an iterable object by defining a Symbol.iterator (or @@iterator) method which
3017+
* returns `this`.
30153018
*/
30163019
export function Seq<S extends Seq<any, any>>(seq: S): S;
30173020
export function Seq<K, V>(collection: Collection.Keyed<K, V>): Seq.Keyed<K, V>;
@@ -3723,13 +3726,17 @@ declare module Immutable {
37233726
*
37243727
* * If an `Collection`, that same `Collection`.
37253728
* * If an Array-like, an `Collection.Indexed`.
3726-
* * If an Object with an Iterator, an `Collection.Indexed`.
3727-
* * If an Iterator, an `Collection.Indexed`.
3729+
* * If an Object with an Iterator defined, an `Collection.Indexed`.
37283730
* * If an Object, an `Collection.Keyed`.
37293731
*
37303732
* This methods forces the conversion of Objects and Strings to Collections.
37313733
* If you want to ensure that a Collection of one item is returned, use
37323734
* `Seq.of`.
3735+
*
3736+
* Note: An Iterator itself will be treated as an object, becoming a `Seq.Keyed`,
3737+
* which is usually not what you want. You should turn your Iterator Object into
3738+
* an iterable object by defining a Symbol.iterator (or @@iterator) method which
3739+
* returns `this`.
37333740
*/
37343741
export function Collection<I extends Collection<any, any>>(collection: I): I;
37353742
export function Collection<T>(collection: Iterable<T>): Collection.Indexed<T>;

dist/immutable.es.js

Lines changed: 6 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -583,63 +583,6 @@ var CollectionSeq = (function (IndexedSeq) {
583583
return CollectionSeq;
584584
}(IndexedSeq));
585585

586-
var IteratorSeq = (function (IndexedSeq) {
587-
function IteratorSeq(iterator) {
588-
this._iterator = iterator;
589-
this._iteratorCache = [];
590-
}
591-
592-
if ( IndexedSeq ) IteratorSeq.__proto__ = IndexedSeq;
593-
IteratorSeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype );
594-
IteratorSeq.prototype.constructor = IteratorSeq;
595-
596-
IteratorSeq.prototype.__iterateUncached = function __iterateUncached (fn, reverse) {
597-
var this$1 = this;
598-
599-
if (reverse) {
600-
return this.cacheResult().__iterate(fn, reverse);
601-
}
602-
var iterator = this._iterator;
603-
var cache = this._iteratorCache;
604-
var iterations = 0;
605-
while (iterations < cache.length) {
606-
if (fn(cache[iterations], iterations++, this$1) === false) {
607-
return iterations;
608-
}
609-
}
610-
var step;
611-
while (!(step = iterator.next()).done) {
612-
var val = step.value;
613-
cache[iterations] = val;
614-
if (fn(val, iterations++, this$1) === false) {
615-
break;
616-
}
617-
}
618-
return iterations;
619-
};
620-
621-
IteratorSeq.prototype.__iteratorUncached = function __iteratorUncached (type, reverse) {
622-
if (reverse) {
623-
return this.cacheResult().__iterator(type, reverse);
624-
}
625-
var iterator = this._iterator;
626-
var cache = this._iteratorCache;
627-
var iterations = 0;
628-
return new Iterator(function () {
629-
if (iterations >= cache.length) {
630-
var step = iterator.next();
631-
if (step.done) {
632-
return step;
633-
}
634-
cache[iterations] = step.value;
635-
}
636-
return iteratorValue(type, iterations, cache[iterations++]);
637-
});
638-
};
639-
640-
return IteratorSeq;
641-
}(IndexedSeq));
642-
643586
// # pragma Helper functions
644587

645588
function isSeq(maybeSeq) {
@@ -655,11 +598,9 @@ function emptySequence() {
655598
function keyedSeqFromValue(value) {
656599
var seq = Array.isArray(value)
657600
? new ArraySeq(value)
658-
: isIterator(value)
659-
? new IteratorSeq(value)
660-
: hasIterator(value)
661-
? new CollectionSeq(value)
662-
: undefined;
601+
: hasIterator(value)
602+
? new CollectionSeq(value)
603+
: undefined;
663604
if (seq) {
664605
return seq.fromEntrySeq();
665606
}
@@ -698,11 +639,9 @@ function seqFromValue(value) {
698639
function maybeIndexedSeqFromValue(value) {
699640
return isArrayLike(value)
700641
? new ArraySeq(value)
701-
: isIterator(value)
702-
? new IteratorSeq(value)
703-
: hasIterator(value)
704-
? new CollectionSeq(value)
705-
: undefined;
642+
: hasIterator(value)
643+
? new CollectionSeq(value)
644+
: undefined;
706645
}
707646

708647
/**

dist/immutable.js

Lines changed: 6 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -589,63 +589,6 @@
589589
return CollectionSeq;
590590
}(IndexedSeq));
591591

592-
var IteratorSeq = (function (IndexedSeq) {
593-
function IteratorSeq(iterator) {
594-
this._iterator = iterator;
595-
this._iteratorCache = [];
596-
}
597-
598-
if ( IndexedSeq ) IteratorSeq.__proto__ = IndexedSeq;
599-
IteratorSeq.prototype = Object.create( IndexedSeq && IndexedSeq.prototype );
600-
IteratorSeq.prototype.constructor = IteratorSeq;
601-
602-
IteratorSeq.prototype.__iterateUncached = function __iterateUncached (fn, reverse) {
603-
var this$1 = this;
604-
605-
if (reverse) {
606-
return this.cacheResult().__iterate(fn, reverse);
607-
}
608-
var iterator = this._iterator;
609-
var cache = this._iteratorCache;
610-
var iterations = 0;
611-
while (iterations < cache.length) {
612-
if (fn(cache[iterations], iterations++, this$1) === false) {
613-
return iterations;
614-
}
615-
}
616-
var step;
617-
while (!(step = iterator.next()).done) {
618-
var val = step.value;
619-
cache[iterations] = val;
620-
if (fn(val, iterations++, this$1) === false) {
621-
break;
622-
}
623-
}
624-
return iterations;
625-
};
626-
627-
IteratorSeq.prototype.__iteratorUncached = function __iteratorUncached (type, reverse) {
628-
if (reverse) {
629-
return this.cacheResult().__iterator(type, reverse);
630-
}
631-
var iterator = this._iterator;
632-
var cache = this._iteratorCache;
633-
var iterations = 0;
634-
return new Iterator(function () {
635-
if (iterations >= cache.length) {
636-
var step = iterator.next();
637-
if (step.done) {
638-
return step;
639-
}
640-
cache[iterations] = step.value;
641-
}
642-
return iteratorValue(type, iterations, cache[iterations++]);
643-
});
644-
};
645-
646-
return IteratorSeq;
647-
}(IndexedSeq));
648-
649592
// # pragma Helper functions
650593

651594
function isSeq(maybeSeq) {
@@ -661,11 +604,9 @@
661604
function keyedSeqFromValue(value) {
662605
var seq = Array.isArray(value)
663606
? new ArraySeq(value)
664-
: isIterator(value)
665-
? new IteratorSeq(value)
666-
: hasIterator(value)
667-
? new CollectionSeq(value)
668-
: undefined;
607+
: hasIterator(value)
608+
? new CollectionSeq(value)
609+
: undefined;
669610
if (seq) {
670611
return seq.fromEntrySeq();
671612
}
@@ -704,11 +645,9 @@
704645
function maybeIndexedSeqFromValue(value) {
705646
return isArrayLike(value)
706647
? new ArraySeq(value)
707-
: isIterator(value)
708-
? new IteratorSeq(value)
709-
: hasIterator(value)
710-
? new CollectionSeq(value)
711-
: undefined;
648+
: hasIterator(value)
649+
? new CollectionSeq(value)
650+
: undefined;
712651
}
713652

714653
/**

0 commit comments

Comments
 (0)
0