immutable 5.0.0-beta.4 → 5.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/es/Collection.js +6 -1
- package/dist/es/CollectionImpl.js +11 -16
- package/dist/es/Hash.js +1 -0
- package/dist/es/Immutable.js +2 -2
- package/dist/es/Iterator.js +1 -0
- package/dist/es/List.js +7 -1
- package/dist/es/Map.js +4 -16
- package/dist/es/Math.js +1 -0
- package/dist/es/Operations.js +7 -6
- package/dist/es/OrderedMap.js +3 -1
- package/dist/es/OrderedSet.js +3 -1
- package/dist/es/PairSorting.js +1 -0
- package/dist/es/Range.js +16 -5
- package/dist/es/Record.js +3 -1
- package/dist/es/Repeat.js +5 -1
- package/dist/es/Seq.js +6 -1
- package/dist/es/Set.js +2 -0
- package/dist/es/Stack.js +2 -0
- package/dist/es/TrieUtils.js +2 -0
- package/dist/es/fromJS.js +1 -0
- package/dist/es/functional/get.js +1 -0
- package/dist/es/functional/getIn.js +1 -0
- package/dist/es/functional/has.js +1 -0
- package/dist/es/functional/hasIn.js +1 -0
- package/dist/es/functional/merge.js +1 -0
- package/dist/es/functional/remove.js +1 -0
- package/dist/es/functional/removeIn.js +1 -0
- package/dist/es/functional/set.js +1 -0
- package/dist/es/functional/setIn.js +1 -0
- package/dist/es/functional/update.js +1 -0
- package/dist/es/functional/updateIn.js +1 -0
- package/dist/es/is.js +1 -0
- package/dist/es/methods/asImmutable.js +1 -0
- package/dist/es/methods/asMutable.js +1 -0
- package/dist/es/methods/deleteIn.js +1 -0
- package/dist/es/methods/getIn.js +1 -0
- package/dist/es/methods/hasIn.js +1 -0
- package/dist/es/methods/merge.js +1 -0
- package/dist/es/methods/mergeDeep.js +1 -0
- package/dist/es/methods/mergeDeepIn.js +1 -0
- package/dist/es/methods/mergeIn.js +1 -0
- package/dist/es/methods/setIn.js +1 -0
- package/dist/es/methods/toObject.js +1 -0
- package/dist/es/methods/update.js +1 -0
- package/dist/es/methods/updateIn.js +1 -0
- package/dist/es/methods/wasAltered.js +1 -0
- package/dist/es/methods/withMutations.js +1 -0
- package/dist/es/package.json.js +2 -1
- package/dist/es/predicates/isAssociative.js +1 -0
- package/dist/es/predicates/isCollection.js +2 -0
- package/dist/es/predicates/isImmutable.js +1 -0
- package/dist/es/predicates/isIndexed.js +1 -0
- package/dist/es/predicates/isKeyed.js +1 -0
- package/dist/es/predicates/isList.js +1 -0
- package/dist/es/predicates/isMap.js +1 -0
- package/dist/es/predicates/isOrdered.js +1 -0
- package/dist/es/predicates/isOrderedMap.js +1 -0
- package/dist/es/predicates/isOrderedSet.js +1 -0
- package/dist/es/predicates/isRecord.js +1 -0
- package/dist/es/predicates/isSeq.js +1 -0
- package/dist/es/predicates/isSet.js +1 -0
- package/dist/es/predicates/isStack.js +1 -0
- package/dist/es/predicates/isValueObject.js +1 -0
- package/dist/es/toJS.js +1 -0
- package/dist/es/utils/arrCopy.js +3 -1
- package/dist/es/utils/assertNotInfinite.js +2 -1
- package/dist/es/utils/coerceKeyPath.js +2 -1
- package/dist/es/utils/deepEqual.js +2 -1
- package/dist/es/utils/hasOwnProperty.js +2 -1
- package/dist/es/utils/invariant.js +2 -1
- package/dist/es/utils/isArrayLike.js +2 -1
- package/dist/es/utils/isDataStructure.js +2 -1
- package/dist/es/utils/isPlainObj.js +2 -1
- package/dist/es/utils/mixin.js +5 -1
- package/dist/es/utils/quoteString.js +5 -1
- package/dist/es/utils/shallowCopy.js +2 -1
- package/dist/immutable.d.ts +14 -52
- package/dist/immutable.js +62 -40
- package/dist/immutable.js.flow +4 -2
- package/dist/immutable.min.js +2 -32
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/immutable-js/immutable-js/actions/workflows/ci.yml?query=branch%3Amain) [Chat on slack](https://immutable-js.slack.com)
|
|
4
4
|
|
|
5
|
-
[Read the docs](https://immutable-js.com) and eat your vegetables.
|
|
5
|
+
[Read the docs](https://immutable-js.com/docs/) and eat your vegetables.
|
|
6
6
|
|
|
7
7
|
Docs are automatically generated from [README.md][] and [immutable.d.ts][].
|
|
8
8
|
Please contribute! Also, don't miss the [wiki][] which contains articles on
|
|
@@ -86,7 +86,7 @@ map1.get('b') + ' vs. ' + map2.get('b'); // 2 vs. 50
|
|
|
86
86
|
|
|
87
87
|
Immutable.js has no dependencies, which makes it predictable to include in a Browser.
|
|
88
88
|
|
|
89
|
-
It's highly recommended to use a module bundler like [webpack](https://webpack.
|
|
89
|
+
It's highly recommended to use a module bundler like [webpack](https://webpack.js.org/),
|
|
90
90
|
[rollup](https://rollupjs.org/), or
|
|
91
91
|
[browserify](https://browserify.org/). The `immutable` npm module works
|
|
92
92
|
without any additional consideration. All examples throughout the documentation
|
package/dist/es/Collection.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -21,18 +22,20 @@
|
|
|
21
22
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
23
|
* SOFTWARE.
|
|
23
24
|
*/
|
|
24
|
-
import { Seq,
|
|
25
|
+
import { Seq, KeyedSeq, IndexedSeq, SetSeq } from './Seq.js';
|
|
25
26
|
import { isCollection } from './predicates/isCollection.js';
|
|
26
27
|
import { isKeyed } from './predicates/isKeyed.js';
|
|
27
28
|
import { isIndexed } from './predicates/isIndexed.js';
|
|
28
29
|
import { isAssociative } from './predicates/isAssociative.js';
|
|
29
30
|
|
|
30
31
|
var Collection = function Collection(value) {
|
|
32
|
+
// eslint-disable-next-line no-constructor-return
|
|
31
33
|
return isCollection(value) ? value : Seq(value);
|
|
32
34
|
};
|
|
33
35
|
|
|
34
36
|
var KeyedCollection = /*@__PURE__*/(function (Collection) {
|
|
35
37
|
function KeyedCollection(value) {
|
|
38
|
+
// eslint-disable-next-line no-constructor-return
|
|
36
39
|
return isKeyed(value) ? value : KeyedSeq(value);
|
|
37
40
|
}
|
|
38
41
|
|
|
@@ -45,6 +48,7 @@ var KeyedCollection = /*@__PURE__*/(function (Collection) {
|
|
|
45
48
|
|
|
46
49
|
var IndexedCollection = /*@__PURE__*/(function (Collection) {
|
|
47
50
|
function IndexedCollection(value) {
|
|
51
|
+
// eslint-disable-next-line no-constructor-return
|
|
48
52
|
return isIndexed(value) ? value : IndexedSeq(value);
|
|
49
53
|
}
|
|
50
54
|
|
|
@@ -57,6 +61,7 @@ var IndexedCollection = /*@__PURE__*/(function (Collection) {
|
|
|
57
61
|
|
|
58
62
|
var SetCollection = /*@__PURE__*/(function (Collection) {
|
|
59
63
|
function SetCollection(value) {
|
|
64
|
+
// eslint-disable-next-line no-constructor-return
|
|
60
65
|
return isCollection(value) && !isAssociative(value) ? value : SetSeq(value);
|
|
61
66
|
}
|
|
62
67
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -22,17 +23,15 @@
|
|
|
22
23
|
* SOFTWARE.
|
|
23
24
|
*/
|
|
24
25
|
import { Collection, KeyedCollection, IndexedCollection, SetCollection } from './Collection.js';
|
|
25
|
-
|
|
26
|
-
import { isCollection, IS_COLLECTION_SYMBOL } from './predicates/isCollection.js';
|
|
27
|
-
import { isAssociative } from './predicates/isAssociative.js';
|
|
26
|
+
import { IS_COLLECTION_SYMBOL } from './predicates/isCollection.js';
|
|
28
27
|
import { isKeyed, IS_KEYED_SYMBOL } from './predicates/isKeyed.js';
|
|
29
28
|
import { isIndexed, IS_INDEXED_SYMBOL } from './predicates/isIndexed.js';
|
|
30
|
-
import {
|
|
29
|
+
import { IS_ORDERED_SYMBOL, isOrdered } from './predicates/isOrdered.js';
|
|
31
30
|
import { is } from './is.js';
|
|
32
31
|
import { ensureSize, returnTrue, NOT_SET, resolveBegin, wrapIndex } from './TrieUtils.js';
|
|
33
32
|
import { hash } from './Hash.js';
|
|
34
33
|
import { imul, smi } from './Math.js';
|
|
35
|
-
import {
|
|
34
|
+
import { ITERATE_ENTRIES, ITERATE_KEYS, ITERATE_VALUES, ITERATOR_SYMBOL, Iterator } from './Iterator.js';
|
|
36
35
|
import arrCopy from './utils/arrCopy.js';
|
|
37
36
|
import assertNotInfinite from './utils/assertNotInfinite.js';
|
|
38
37
|
import deepEqual from './utils/deepEqual.js';
|
|
@@ -46,19 +45,12 @@ import { Set } from './Set.js';
|
|
|
46
45
|
import { OrderedSet } from './OrderedSet.js';
|
|
47
46
|
import { Stack } from './Stack.js';
|
|
48
47
|
import { Range } from './Range.js';
|
|
49
|
-
import { ArraySeq,
|
|
48
|
+
import { ArraySeq, IndexedSeq, KeyedSeq, SetSeq } from './Seq.js';
|
|
50
49
|
import { ToIndexedSequence, ToKeyedSequence, ToSetSequence, reify, concatFactory, filterFactory, partitionFactory, mapFactory, reverseFactory, sliceFactory, sortFactory, countByFactory, flatMapFactory, flattenFactory, FromEntriesSequence, groupByFactory, maxFactory, skipWhileFactory, takeWhileFactory, flipFactory, interposeFactory, zipWithFactory } from './Operations.js';
|
|
51
50
|
import { getIn } from './methods/getIn.js';
|
|
52
51
|
import { hasIn } from './methods/hasIn.js';
|
|
53
52
|
import { toObject } from './methods/toObject.js';
|
|
54
53
|
|
|
55
|
-
// Note: all of these methods are deprecated.
|
|
56
|
-
Collection.isIterable = isCollection;
|
|
57
|
-
Collection.isKeyed = isKeyed;
|
|
58
|
-
Collection.isIndexed = isIndexed;
|
|
59
|
-
Collection.isAssociative = isAssociative;
|
|
60
|
-
Collection.isOrdered = isOrdered;
|
|
61
|
-
|
|
62
54
|
Collection.Iterator = Iterator;
|
|
63
55
|
|
|
64
56
|
mixin(Collection, {
|
|
@@ -293,6 +285,7 @@ mixin(Collection, {
|
|
|
293
285
|
},
|
|
294
286
|
|
|
295
287
|
entrySeq: function entrySeq() {
|
|
288
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
296
289
|
var collection = this;
|
|
297
290
|
if (collection._cache) {
|
|
298
291
|
// We cache as an entries array, so we can just return the cache!
|
|
@@ -743,7 +736,8 @@ function hashCollection(collection) {
|
|
|
743
736
|
var ordered = isOrdered(collection);
|
|
744
737
|
var keyed = isKeyed(collection);
|
|
745
738
|
var h = ordered ? 1 : 0;
|
|
746
|
-
|
|
739
|
+
|
|
740
|
+
collection.__iterate(
|
|
747
741
|
keyed
|
|
748
742
|
? ordered
|
|
749
743
|
? function (v, k) {
|
|
@@ -760,7 +754,8 @@ function hashCollection(collection) {
|
|
|
760
754
|
h = (h + hash(v)) | 0;
|
|
761
755
|
}
|
|
762
756
|
);
|
|
763
|
-
|
|
757
|
+
|
|
758
|
+
return murmurHashOfSize(collection.size, h);
|
|
764
759
|
}
|
|
765
760
|
|
|
766
761
|
function murmurHashOfSize(size, h) {
|
|
@@ -778,4 +773,4 @@ function hashMerge(a, b) {
|
|
|
778
773
|
return (a ^ (b + 0x9e3779b9 + (a << 6) + (a >> 2))) | 0; // int
|
|
779
774
|
}
|
|
780
775
|
|
|
781
|
-
export { CollectionPrototype, IndexedCollectionPrototype };
|
|
776
|
+
export { Collection, CollectionPrototype, IndexedCollectionPrototype };
|
package/dist/es/Hash.js
CHANGED
package/dist/es/Immutable.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -65,9 +66,8 @@ export { update } from './functional/update.js';
|
|
|
65
66
|
export { updateIn } from './functional/updateIn.js';
|
|
66
67
|
export { version } from './package.json.js';
|
|
67
68
|
import { Collection } from './Collection.js';
|
|
68
|
-
export { Collection } from './Collection.js';
|
|
69
69
|
|
|
70
70
|
// Note: Iterable is deprecated
|
|
71
71
|
var Iterable = Collection;
|
|
72
72
|
|
|
73
|
-
export { Iterable };
|
|
73
|
+
export { Collection, Iterable };
|
package/dist/es/Iterator.js
CHANGED
package/dist/es/List.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
23
|
* SOFTWARE.
|
|
23
24
|
*/
|
|
24
|
-
import { wrapIndex, MASK, SHIFT, wholeSlice, DELETE,
|
|
25
|
+
import { wrapIndex, MASK, SHIFT, wholeSlice, DELETE, SetRef, OwnerID, SIZE, MakeRef, resolveEnd, resolveBegin } from './TrieUtils.js';
|
|
25
26
|
import { isList, IS_LIST_SYMBOL } from './predicates/isList.js';
|
|
26
27
|
import { IndexedCollection } from './Collection.js';
|
|
27
28
|
import { hasIterator, Iterator, iteratorDone, iteratorValue } from './Iterator.js';
|
|
@@ -41,20 +42,25 @@ var List = /*@__PURE__*/(function (IndexedCollection) {
|
|
|
41
42
|
function List(value) {
|
|
42
43
|
var empty = emptyList();
|
|
43
44
|
if (value === undefined || value === null) {
|
|
45
|
+
// eslint-disable-next-line no-constructor-return
|
|
44
46
|
return empty;
|
|
45
47
|
}
|
|
46
48
|
if (isList(value)) {
|
|
49
|
+
// eslint-disable-next-line no-constructor-return
|
|
47
50
|
return value;
|
|
48
51
|
}
|
|
49
52
|
var iter = IndexedCollection(value);
|
|
50
53
|
var size = iter.size;
|
|
51
54
|
if (size === 0) {
|
|
55
|
+
// eslint-disable-next-line no-constructor-return
|
|
52
56
|
return empty;
|
|
53
57
|
}
|
|
54
58
|
assertNotInfinite(size);
|
|
55
59
|
if (size > 0 && size < SIZE) {
|
|
60
|
+
// eslint-disable-next-line no-constructor-return
|
|
56
61
|
return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));
|
|
57
62
|
}
|
|
63
|
+
// eslint-disable-next-line no-constructor-return
|
|
58
64
|
return empty.withMutations(function (list) {
|
|
59
65
|
list.setSize(size);
|
|
60
66
|
iter.forEach(function (v, i) { return list.set(i, v); });
|
package/dist/es/Map.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -27,7 +28,7 @@ import { isMap, IS_MAP_SYMBOL } from './predicates/isMap.js';
|
|
|
27
28
|
import { isOrdered } from './predicates/isOrdered.js';
|
|
28
29
|
import { DELETE, NOT_SET, SetRef, MakeRef, MASK, SHIFT, SIZE, OwnerID } from './TrieUtils.js';
|
|
29
30
|
import { hash } from './Hash.js';
|
|
30
|
-
import {
|
|
31
|
+
import { iteratorDone, Iterator, iteratorValue } from './Iterator.js';
|
|
31
32
|
import { sortFactory } from './Operations.js';
|
|
32
33
|
import arrCopy from './utils/arrCopy.js';
|
|
33
34
|
import assertNotInfinite from './utils/assertNotInfinite.js';
|
|
@@ -47,6 +48,7 @@ import { OrderedMap } from './OrderedMap.js';
|
|
|
47
48
|
|
|
48
49
|
var Map = /*@__PURE__*/(function (KeyedCollection) {
|
|
49
50
|
function Map(value) {
|
|
51
|
+
// eslint-disable-next-line no-constructor-return
|
|
50
52
|
return value === undefined || value === null
|
|
51
53
|
? emptyMap()
|
|
52
54
|
: isMap(value) && !isOrdered(value)
|
|
@@ -62,20 +64,6 @@ var Map = /*@__PURE__*/(function (KeyedCollection) {
|
|
|
62
64
|
Map.prototype = Object.create( KeyedCollection && KeyedCollection.prototype );
|
|
63
65
|
Map.prototype.constructor = Map;
|
|
64
66
|
|
|
65
|
-
Map.of = function of () {
|
|
66
|
-
var keyValues = [], len = arguments.length;
|
|
67
|
-
while ( len-- ) keyValues[ len ] = arguments[ len ];
|
|
68
|
-
|
|
69
|
-
return emptyMap().withMutations(function (map) {
|
|
70
|
-
for (var i = 0; i < keyValues.length; i += 2) {
|
|
71
|
-
if (i + 1 >= keyValues.length) {
|
|
72
|
-
throw new Error('Missing value for key: ' + keyValues[i]);
|
|
73
|
-
}
|
|
74
|
-
map.set(keyValues[i], keyValues[i + 1]);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
|
|
79
67
|
Map.prototype.toString = function toString () {
|
|
80
68
|
return this.__toString('Map {', '}');
|
|
81
69
|
};
|
|
@@ -565,7 +553,7 @@ BitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate =
|
|
|
565
553
|
}
|
|
566
554
|
};
|
|
567
555
|
|
|
568
|
-
// eslint-disable-next-line no-unused-vars
|
|
556
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
569
557
|
ValueNode.prototype.iterate = function (fn, reverse) {
|
|
570
558
|
return fn(this.entry);
|
|
571
559
|
};
|
package/dist/es/Math.js
CHANGED
package/dist/es/Operations.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
* SOFTWARE.
|
|
23
24
|
*/
|
|
24
25
|
import { ensureSize, NOT_SET, wholeSlice, wrapIndex, resolveBegin, resolveEnd } from './TrieUtils.js';
|
|
25
|
-
import { KeyedCollection, IndexedCollection, SetCollection
|
|
26
|
+
import { KeyedCollection, Collection, IndexedCollection, SetCollection } from './Collection.js';
|
|
26
27
|
import { isCollection } from './predicates/isCollection.js';
|
|
27
28
|
import { isKeyed } from './predicates/isKeyed.js';
|
|
28
29
|
import { isIndexed } from './predicates/isIndexed.js';
|
|
@@ -449,16 +450,16 @@ function sliceFactory(collection, begin, end, useKeys) {
|
|
|
449
450
|
return collection;
|
|
450
451
|
}
|
|
451
452
|
|
|
452
|
-
|
|
453
|
-
var resolvedEnd = resolveEnd(end, originalSize);
|
|
454
|
-
|
|
455
|
-
// begin or end will be NaN if they were provided as negative numbers and
|
|
453
|
+
// begin or end can not be resolved if they were provided as negative numbers and
|
|
456
454
|
// this collection's size is unknown. In that case, cache first so there is
|
|
457
455
|
// a known size and these do not resolve to NaN.
|
|
458
|
-
if (
|
|
456
|
+
if (typeof originalSize === 'undefined' && (begin < 0 || end < 0)) {
|
|
459
457
|
return sliceFactory(collection.toSeq().cacheResult(), begin, end, useKeys);
|
|
460
458
|
}
|
|
461
459
|
|
|
460
|
+
var resolvedBegin = resolveBegin(begin, originalSize);
|
|
461
|
+
var resolvedEnd = resolveEnd(end, originalSize);
|
|
462
|
+
|
|
462
463
|
// Note: resolvedEnd is undefined when the original sequence's length is
|
|
463
464
|
// unknown and this slice did not supply an end and should contain all
|
|
464
465
|
// elements after resolvedBegin.
|
package/dist/es/OrderedMap.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -24,13 +25,14 @@
|
|
|
24
25
|
import { KeyedCollection } from './Collection.js';
|
|
25
26
|
import { IS_ORDERED_SYMBOL } from './predicates/isOrdered.js';
|
|
26
27
|
import { isOrderedMap } from './predicates/isOrderedMap.js';
|
|
27
|
-
import {
|
|
28
|
+
import { Map, emptyMap } from './Map.js';
|
|
28
29
|
import { emptyList } from './List.js';
|
|
29
30
|
import { DELETE, NOT_SET, SIZE } from './TrieUtils.js';
|
|
30
31
|
import assertNotInfinite from './utils/assertNotInfinite.js';
|
|
31
32
|
|
|
32
33
|
var OrderedMap = /*@__PURE__*/(function (Map) {
|
|
33
34
|
function OrderedMap(value) {
|
|
35
|
+
// eslint-disable-next-line no-constructor-return
|
|
34
36
|
return value === undefined || value === null
|
|
35
37
|
? emptyOrderedMap()
|
|
36
38
|
: isOrderedMap(value)
|
package/dist/es/OrderedSet.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -21,7 +22,7 @@
|
|
|
21
22
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
23
|
* SOFTWARE.
|
|
23
24
|
*/
|
|
24
|
-
import {
|
|
25
|
+
import { KeyedCollection, SetCollection } from './Collection.js';
|
|
25
26
|
import { IS_ORDERED_SYMBOL } from './predicates/isOrdered.js';
|
|
26
27
|
import { isOrderedSet } from './predicates/isOrderedSet.js';
|
|
27
28
|
import { IndexedCollectionPrototype } from './CollectionImpl.js';
|
|
@@ -31,6 +32,7 @@ import assertNotInfinite from './utils/assertNotInfinite.js';
|
|
|
31
32
|
|
|
32
33
|
var OrderedSet = /*@__PURE__*/(function (Set) {
|
|
33
34
|
function OrderedSet(value) {
|
|
35
|
+
// eslint-disable-next-line no-constructor-return
|
|
34
36
|
return value === undefined || value === null
|
|
35
37
|
? emptyOrderedSet()
|
|
36
38
|
: isOrderedSet(value)
|
package/dist/es/PairSorting.js
CHANGED
package/dist/es/Range.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -34,15 +35,23 @@ import deepEqual from './utils/deepEqual.js';
|
|
|
34
35
|
*/
|
|
35
36
|
var Range = /*@__PURE__*/(function (IndexedSeq) {
|
|
36
37
|
function Range(start, end, step) {
|
|
38
|
+
if ( step === void 0 ) step = 1;
|
|
39
|
+
|
|
37
40
|
if (!(this instanceof Range)) {
|
|
41
|
+
// eslint-disable-next-line no-constructor-return
|
|
38
42
|
return new Range(start, end, step);
|
|
39
43
|
}
|
|
40
44
|
invariant(step !== 0, 'Cannot step a Range by 0');
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
45
|
+
invariant(
|
|
46
|
+
start !== undefined,
|
|
47
|
+
'You must define a start value when using Range'
|
|
48
|
+
);
|
|
49
|
+
invariant(
|
|
50
|
+
end !== undefined,
|
|
51
|
+
'You must define an end value when using Range'
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
step = Math.abs(step);
|
|
46
55
|
if (end < start) {
|
|
47
56
|
step = -step;
|
|
48
57
|
}
|
|
@@ -52,8 +61,10 @@ var Range = /*@__PURE__*/(function (IndexedSeq) {
|
|
|
52
61
|
this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);
|
|
53
62
|
if (this.size === 0) {
|
|
54
63
|
if (EMPTY_RANGE) {
|
|
64
|
+
// eslint-disable-next-line no-constructor-return
|
|
55
65
|
return EMPTY_RANGE;
|
|
56
66
|
}
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
57
68
|
EMPTY_RANGE = this;
|
|
58
69
|
}
|
|
59
70
|
}
|
package/dist/es/Record.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -25,7 +26,7 @@ import { toJS } from './toJS.js';
|
|
|
25
26
|
import { KeyedCollection } from './Collection.js';
|
|
26
27
|
import { keyedSeqFromValue } from './Seq.js';
|
|
27
28
|
import { List } from './List.js';
|
|
28
|
-
import {
|
|
29
|
+
import { ITERATOR_SYMBOL, ITERATE_ENTRIES } from './Iterator.js';
|
|
29
30
|
import { isRecord, IS_RECORD_SYMBOL } from './predicates/isRecord.js';
|
|
30
31
|
import { CollectionPrototype } from './CollectionImpl.js';
|
|
31
32
|
import { DELETE } from './TrieUtils.js';
|
|
@@ -127,6 +128,7 @@ var Record = function Record(defaultValues, name) {
|
|
|
127
128
|
RecordType.displayName = name;
|
|
128
129
|
}
|
|
129
130
|
|
|
131
|
+
// eslint-disable-next-line no-constructor-return
|
|
130
132
|
return RecordType;
|
|
131
133
|
};
|
|
132
134
|
|
package/dist/es/Repeat.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -34,14 +35,17 @@ import deepEqual from './utils/deepEqual.js';
|
|
|
34
35
|
var Repeat = /*@__PURE__*/(function (IndexedSeq) {
|
|
35
36
|
function Repeat(value, times) {
|
|
36
37
|
if (!(this instanceof Repeat)) {
|
|
38
|
+
// eslint-disable-next-line no-constructor-return
|
|
37
39
|
return new Repeat(value, times);
|
|
38
40
|
}
|
|
39
41
|
this._value = value;
|
|
40
42
|
this.size = times === undefined ? Infinity : Math.max(0, times);
|
|
41
43
|
if (this.size === 0) {
|
|
42
44
|
if (EMPTY_REPEAT) {
|
|
45
|
+
// eslint-disable-next-line no-constructor-return
|
|
43
46
|
return EMPTY_REPEAT;
|
|
44
47
|
}
|
|
48
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
45
49
|
EMPTY_REPEAT = this;
|
|
46
50
|
}
|
|
47
51
|
}
|
|
@@ -118,7 +122,7 @@ var Repeat = /*@__PURE__*/(function (IndexedSeq) {
|
|
|
118
122
|
Repeat.prototype.equals = function equals (other) {
|
|
119
123
|
return other instanceof Repeat
|
|
120
124
|
? is(this._value, other._value)
|
|
121
|
-
: deepEqual(other);
|
|
125
|
+
: deepEqual(this, other);
|
|
122
126
|
};
|
|
123
127
|
|
|
124
128
|
return Repeat;
|
package/dist/es/Seq.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -30,12 +31,13 @@ import { isKeyed } from './predicates/isKeyed.js';
|
|
|
30
31
|
import { isAssociative } from './predicates/isAssociative.js';
|
|
31
32
|
import { isRecord } from './predicates/isRecord.js';
|
|
32
33
|
import { IS_ORDERED_SYMBOL } from './predicates/isOrdered.js';
|
|
33
|
-
import { Iterator, iteratorDone, iteratorValue,
|
|
34
|
+
import { Iterator, iteratorDone, iteratorValue, isEntriesIterable, isKeysIterable, hasIterator, getIterator, isIterator } from './Iterator.js';
|
|
34
35
|
import hasOwnProperty from './utils/hasOwnProperty.js';
|
|
35
36
|
import isArrayLike from './utils/isArrayLike.js';
|
|
36
37
|
|
|
37
38
|
var Seq = /*@__PURE__*/(function (Collection) {
|
|
38
39
|
function Seq(value) {
|
|
40
|
+
// eslint-disable-next-line no-constructor-return
|
|
39
41
|
return value === undefined || value === null
|
|
40
42
|
? emptySequence()
|
|
41
43
|
: isImmutable(value)
|
|
@@ -104,6 +106,7 @@ var Seq = /*@__PURE__*/(function (Collection) {
|
|
|
104
106
|
|
|
105
107
|
var KeyedSeq = /*@__PURE__*/(function (Seq) {
|
|
106
108
|
function KeyedSeq(value) {
|
|
109
|
+
// eslint-disable-next-line no-constructor-return
|
|
107
110
|
return value === undefined || value === null
|
|
108
111
|
? emptySequence().toKeyedSeq()
|
|
109
112
|
: isCollection(value)
|
|
@@ -128,6 +131,7 @@ var KeyedSeq = /*@__PURE__*/(function (Seq) {
|
|
|
128
131
|
|
|
129
132
|
var IndexedSeq = /*@__PURE__*/(function (Seq) {
|
|
130
133
|
function IndexedSeq(value) {
|
|
134
|
+
// eslint-disable-next-line no-constructor-return
|
|
131
135
|
return value === undefined || value === null
|
|
132
136
|
? emptySequence()
|
|
133
137
|
: isCollection(value)
|
|
@@ -160,6 +164,7 @@ var IndexedSeq = /*@__PURE__*/(function (Seq) {
|
|
|
160
164
|
|
|
161
165
|
var SetSeq = /*@__PURE__*/(function (Seq) {
|
|
162
166
|
function SetSeq(value) {
|
|
167
|
+
// eslint-disable-next-line no-constructor-return
|
|
163
168
|
return (
|
|
164
169
|
isCollection(value) && !isAssociative(value) ? value : IndexedSeq(value)
|
|
165
170
|
).toSetSeq();
|
package/dist/es/Set.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -35,6 +36,7 @@ import { OrderedSet } from './OrderedSet.js';
|
|
|
35
36
|
|
|
36
37
|
var Set = /*@__PURE__*/(function (SetCollection) {
|
|
37
38
|
function Set(value) {
|
|
39
|
+
// eslint-disable-next-line no-constructor-return
|
|
38
40
|
return value === undefined || value === null
|
|
39
41
|
? emptySet()
|
|
40
42
|
: isSet(value) && !isOrdered(value)
|
package/dist/es/Stack.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -34,6 +35,7 @@ import { withMutations } from './methods/withMutations.js';
|
|
|
34
35
|
|
|
35
36
|
var Stack = /*@__PURE__*/(function (IndexedCollection) {
|
|
36
37
|
function Stack(value) {
|
|
38
|
+
// eslint-disable-next-line no-constructor-return
|
|
37
39
|
return value === undefined || value === null
|
|
38
40
|
? emptyStack()
|
|
39
41
|
: isStack(value)
|
package/dist/es/TrieUtils.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @license
|
|
2
3
|
* MIT License
|
|
3
4
|
*
|
|
4
5
|
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
@@ -21,6 +22,7 @@
|
|
|
21
22
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
23
|
* SOFTWARE.
|
|
23
24
|
*/
|
|
25
|
+
// Used for setting prototype methods that IE8 chokes on.
|
|
24
26
|
var DELETE = 'delete';
|
|
25
27
|
|
|
26
28
|
// Constants describing the size of trie nodes.
|
package/dist/es/fromJS.js
CHANGED
package/dist/es/is.js
CHANGED