immutable 5.0.0-beta.3 → 5.0.0-beta.4
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 +3 -3
- package/dist/es/Collection.js +74 -0
- package/dist/es/CollectionImpl.js +781 -0
- package/dist/es/Hash.js +259 -0
- package/dist/es/Immutable.js +73 -0
- package/dist/es/Iterator.js +105 -0
- package/dist/es/List.js +691 -0
- package/dist/es/Map.js +832 -0
- package/dist/es/Math.js +44 -0
- package/dist/es/Operations.js +952 -0
- package/dist/es/OrderedMap.js +194 -0
- package/dist/es/OrderedSet.js +90 -0
- package/dist/es/PairSorting.js +29 -0
- package/dist/es/Range.js +167 -0
- package/dist/es/Record.js +290 -0
- package/dist/es/Repeat.js +129 -0
- package/dist/es/Seq.js +396 -0
- package/dist/es/Set.js +277 -0
- package/dist/es/Stack.js +259 -0
- package/dist/es/TrieUtils.js +115 -0
- package/dist/es/fromJS.js +73 -0
- package/dist/es/functional/get.js +37 -0
- package/dist/es/functional/getIn.js +40 -0
- package/dist/es/functional/has.js +34 -0
- package/dist/es/functional/hasIn.js +31 -0
- package/dist/es/functional/merge.js +136 -0
- package/dist/es/functional/remove.js +55 -0
- package/dist/es/functional/removeIn.js +31 -0
- package/dist/es/functional/set.js +51 -0
- package/dist/es/functional/setIn.js +31 -0
- package/dist/es/functional/update.js +30 -0
- package/dist/es/functional/updateIn.js +93 -0
- package/dist/es/is.js +107 -0
- package/dist/es/methods/asImmutable.js +28 -0
- package/dist/es/methods/asMutable.js +30 -0
- package/dist/es/methods/deleteIn.js +30 -0
- package/dist/es/methods/getIn.js +30 -0
- package/dist/es/methods/hasIn.js +30 -0
- package/dist/es/methods/merge.js +78 -0
- package/dist/es/methods/mergeDeep.js +40 -0
- package/dist/es/methods/mergeDeepIn.js +36 -0
- package/dist/es/methods/mergeIn.js +35 -0
- package/dist/es/methods/setIn.js +30 -0
- package/dist/es/methods/toObject.js +35 -0
- package/dist/es/methods/update.js +32 -0
- package/dist/es/methods/updateIn.js +30 -0
- package/dist/es/methods/wasAltered.js +28 -0
- package/dist/es/methods/withMutations.js +30 -0
- package/dist/es/package.json.js +26 -0
- package/dist/es/predicates/isAssociative.js +31 -0
- package/dist/es/predicates/isCollection.js +30 -0
- package/dist/es/predicates/isImmutable.js +31 -0
- package/dist/es/predicates/isIndexed.js +30 -0
- package/dist/es/predicates/isKeyed.js +30 -0
- package/dist/es/predicates/isList.js +30 -0
- package/dist/es/predicates/isMap.js +30 -0
- package/dist/es/predicates/isOrdered.js +30 -0
- package/dist/es/predicates/isOrderedMap.js +31 -0
- package/dist/es/predicates/isOrderedSet.js +31 -0
- package/dist/es/predicates/isRecord.js +30 -0
- package/dist/es/predicates/isSeq.js +30 -0
- package/dist/es/predicates/isSet.js +30 -0
- package/dist/es/predicates/isStack.js +30 -0
- package/dist/es/predicates/isValueObject.js +32 -0
- package/dist/es/toJS.js +53 -0
- package/dist/es/utils/arrCopy.js +34 -0
- package/dist/es/utils/assertNotInfinite.js +33 -0
- package/dist/es/utils/coerceKeyPath.js +39 -0
- package/dist/es/utils/deepEqual.js +98 -0
- package/dist/es/utils/hasOwnProperty.js +26 -0
- package/dist/es/utils/invariant.js +28 -0
- package/dist/es/utils/isArrayLike.js +43 -0
- package/dist/es/utils/isDataStructure.js +38 -0
- package/dist/es/utils/isPlainObj.js +51 -0
- package/dist/es/utils/mixin.js +34 -0
- package/dist/es/utils/quoteString.js +32 -0
- package/dist/es/utils/shallowCopy.js +40 -0
- package/dist/immutable.d.ts +131 -14
- package/dist/immutable.js +1 -59
- package/dist/immutable.min.js +32 -32
- package/package.json +2 -3
- package/dist/immutable.es.js +0 -5965
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
var toString = Object.prototype.toString;
|
|
25
|
+
|
|
26
|
+
function isPlainObject(value) {
|
|
27
|
+
// The base prototype's toString deals with Argument objects and native namespaces like Math
|
|
28
|
+
if (
|
|
29
|
+
!value ||
|
|
30
|
+
typeof value !== 'object' ||
|
|
31
|
+
toString.call(value) !== '[object Object]'
|
|
32
|
+
) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var proto = Object.getPrototypeOf(value);
|
|
37
|
+
if (proto === null) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Iteratively going up the prototype chain is needed for cross-realm environments (differing contexts, iframes, etc)
|
|
42
|
+
var parentProto = proto;
|
|
43
|
+
var nextProto = Object.getPrototypeOf(proto);
|
|
44
|
+
while (nextProto !== null) {
|
|
45
|
+
parentProto = nextProto;
|
|
46
|
+
nextProto = Object.getPrototypeOf(parentProto);
|
|
47
|
+
}
|
|
48
|
+
return parentProto === proto;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default isPlainObject;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
function mixin(ctor, methods) {
|
|
25
|
+
var keyCopier = function (key) {
|
|
26
|
+
ctor.prototype[key] = methods[key];
|
|
27
|
+
};
|
|
28
|
+
Object.keys(methods).forEach(keyCopier);
|
|
29
|
+
Object.getOwnPropertySymbols &&
|
|
30
|
+
Object.getOwnPropertySymbols(methods).forEach(keyCopier);
|
|
31
|
+
return ctor;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default mixin;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
function quoteString(value) {
|
|
25
|
+
try {
|
|
26
|
+
return typeof value === 'string' ? JSON.stringify(value) : String(value);
|
|
27
|
+
} catch (_ignoreError) {
|
|
28
|
+
return JSON.stringify(value);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default quoteString;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MIT License
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2014-present, Lee Byron and other contributors.
|
|
5
|
+
*
|
|
6
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
* in the Software without restriction, including without limitation the rights
|
|
9
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
* furnished to do so, subject to the following conditions:
|
|
12
|
+
*
|
|
13
|
+
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
* copies or substantial portions of the Software.
|
|
15
|
+
*
|
|
16
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
* SOFTWARE.
|
|
23
|
+
*/
|
|
24
|
+
import arrCopy from './arrCopy.js';
|
|
25
|
+
import hasOwnProperty from './hasOwnProperty.js';
|
|
26
|
+
|
|
27
|
+
function shallowCopy(from) {
|
|
28
|
+
if (Array.isArray(from)) {
|
|
29
|
+
return arrCopy(from);
|
|
30
|
+
}
|
|
31
|
+
var to = {};
|
|
32
|
+
for (var key in from) {
|
|
33
|
+
if (hasOwnProperty.call(from, key)) {
|
|
34
|
+
to[key] = from[key];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return to;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default shallowCopy;
|
package/dist/immutable.d.ts
CHANGED
|
@@ -112,6 +112,11 @@ declare namespace Immutable {
|
|
|
112
112
|
{
|
|
113
113
|
[key in keyof R]: ContainObject<R[key]> extends true ? unknown : R[key];
|
|
114
114
|
}
|
|
115
|
+
: T extends MapOf<infer R>
|
|
116
|
+
? // convert MapOf to DeepCopy plain JS object
|
|
117
|
+
{
|
|
118
|
+
[key in keyof R]: ContainObject<R[key]> extends true ? unknown : R[key];
|
|
119
|
+
}
|
|
115
120
|
: T extends Collection.Keyed<infer KeyedKey, infer V>
|
|
116
121
|
? // convert KeyedCollection to DeepCopy plain JS object
|
|
117
122
|
{
|
|
@@ -841,9 +846,96 @@ declare namespace Immutable {
|
|
|
841
846
|
* not altered.
|
|
842
847
|
*/
|
|
843
848
|
function Map<K, V>(collection?: Iterable<[K, V]>): Map<K, V>;
|
|
849
|
+
function Map<R extends { [key in string | number | symbol]: unknown }>(
|
|
850
|
+
obj: R
|
|
851
|
+
): MapOf<R>;
|
|
844
852
|
function Map<V>(obj: { [key: string]: V }): Map<string, V>;
|
|
845
853
|
function Map<K extends string | symbol, V>(obj: { [P in K]?: V }): Map<K, V>;
|
|
846
854
|
|
|
855
|
+
/**
|
|
856
|
+
* Represent a Map constructed by an object
|
|
857
|
+
*
|
|
858
|
+
* @ignore
|
|
859
|
+
*/
|
|
860
|
+
interface MapOf<R extends { [key in string | number | symbol]: unknown }>
|
|
861
|
+
extends Map<keyof R, R[keyof R]> {
|
|
862
|
+
/**
|
|
863
|
+
* Returns the value associated with the provided key, or notSetValue if
|
|
864
|
+
* the Collection does not contain this key.
|
|
865
|
+
*
|
|
866
|
+
* Note: it is possible a key may be associated with an `undefined` value,
|
|
867
|
+
* so if `notSetValue` is not provided and this method returns `undefined`,
|
|
868
|
+
* that does not guarantee the key was not found.
|
|
869
|
+
*/
|
|
870
|
+
get<K extends keyof R>(key: K, notSetValue?: unknown): R[K];
|
|
871
|
+
get<NSV>(key: any, notSetValue: NSV): NSV;
|
|
872
|
+
|
|
873
|
+
// https://github.com/microsoft/TypeScript/pull/39094
|
|
874
|
+
getIn<P extends ReadonlyArray<string | number | symbol>>(
|
|
875
|
+
searchKeyPath: [...P],
|
|
876
|
+
notSetValue?: unknown
|
|
877
|
+
): RetrievePath<R, P>;
|
|
878
|
+
|
|
879
|
+
set<K extends keyof R>(key: K, value: R[K]): this;
|
|
880
|
+
|
|
881
|
+
update(updater: (value: this) => this): this;
|
|
882
|
+
update<K extends keyof R>(key: K, updater: (value: R[K]) => R[K]): this;
|
|
883
|
+
update<K extends keyof R, NSV extends R[K]>(
|
|
884
|
+
key: K,
|
|
885
|
+
notSetValue: NSV,
|
|
886
|
+
updater: (value: R[K]) => R[K]
|
|
887
|
+
): this;
|
|
888
|
+
|
|
889
|
+
// Possible best type is MapOf<Omit<R, K>> but Omit seems to broke other function calls
|
|
890
|
+
// and generate recursion error with other methods (update, merge, etc.) until those functions are defined in MapOf
|
|
891
|
+
delete<K extends keyof R>(
|
|
892
|
+
key: K
|
|
893
|
+
): Extract<R[K], undefined> extends never ? never : this;
|
|
894
|
+
remove<K extends keyof R>(
|
|
895
|
+
key: K
|
|
896
|
+
): Extract<R[K], undefined> extends never ? never : this;
|
|
897
|
+
|
|
898
|
+
toJS(): { [K in keyof R]: DeepCopy<R[K]> };
|
|
899
|
+
|
|
900
|
+
toJSON(): { [K in keyof R]: R[K] };
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
// Loosely based off of this work.
|
|
904
|
+
// https://github.com/immutable-js/immutable-js/issues/1462#issuecomment-584123268
|
|
905
|
+
|
|
906
|
+
/** @ignore */
|
|
907
|
+
type GetMapType<S> = S extends MapOf<infer T> ? T : S;
|
|
908
|
+
|
|
909
|
+
/** @ignore */
|
|
910
|
+
type Head<T extends ReadonlyArray<any>> = T extends [
|
|
911
|
+
infer H,
|
|
912
|
+
...Array<unknown>
|
|
913
|
+
]
|
|
914
|
+
? H
|
|
915
|
+
: never;
|
|
916
|
+
|
|
917
|
+
/** @ignore */
|
|
918
|
+
type Tail<T extends ReadonlyArray<any>> = T extends [unknown, ...infer I]
|
|
919
|
+
? I
|
|
920
|
+
: Array<never>;
|
|
921
|
+
|
|
922
|
+
/** @ignore */
|
|
923
|
+
type RetrievePathReducer<
|
|
924
|
+
T,
|
|
925
|
+
C,
|
|
926
|
+
L extends ReadonlyArray<any>
|
|
927
|
+
> = C extends keyof GetMapType<T>
|
|
928
|
+
? L extends []
|
|
929
|
+
? GetMapType<T>[C]
|
|
930
|
+
: RetrievePathReducer<GetMapType<T>[C], Head<L>, Tail<L>>
|
|
931
|
+
: never;
|
|
932
|
+
|
|
933
|
+
/** @ignore */
|
|
934
|
+
type RetrievePath<
|
|
935
|
+
R,
|
|
936
|
+
P extends ReadonlyArray<string | number | symbol>
|
|
937
|
+
> = P extends [] ? P : RetrievePathReducer<R, Head<P>, Tail<P>>;
|
|
938
|
+
|
|
847
939
|
interface Map<K, V> extends Collection.Keyed<K, V> {
|
|
848
940
|
/**
|
|
849
941
|
* The number of entries in this Map.
|
|
@@ -1061,16 +1153,17 @@ declare namespace Immutable {
|
|
|
1061
1153
|
*/
|
|
1062
1154
|
merge<KC, VC>(
|
|
1063
1155
|
...collections: Array<Iterable<[KC, VC]>>
|
|
1064
|
-
): Map<K | KC, V | VC>;
|
|
1156
|
+
): Map<K | KC, Exclude<V, VC> | VC>;
|
|
1065
1157
|
merge<C>(
|
|
1066
1158
|
...collections: Array<{ [key: string]: C }>
|
|
1067
|
-
): Map<K | string, V | C>;
|
|
1159
|
+
): Map<K | string, Exclude<V, C> | C>;
|
|
1160
|
+
|
|
1068
1161
|
concat<KC, VC>(
|
|
1069
1162
|
...collections: Array<Iterable<[KC, VC]>>
|
|
1070
|
-
): Map<K | KC, V | VC>;
|
|
1163
|
+
): Map<K | KC, Exclude<V, VC> | VC>;
|
|
1071
1164
|
concat<C>(
|
|
1072
1165
|
...collections: Array<{ [key: string]: C }>
|
|
1073
|
-
): Map<K | string, V | C>;
|
|
1166
|
+
): Map<K | string, Exclude<V, C> | C>;
|
|
1074
1167
|
|
|
1075
1168
|
/**
|
|
1076
1169
|
* Like `merge()`, `mergeWith()` returns a new Map resulting from merging
|
|
@@ -1090,10 +1183,14 @@ declare namespace Immutable {
|
|
|
1090
1183
|
*
|
|
1091
1184
|
* Note: `mergeWith` can be used in `withMutations`.
|
|
1092
1185
|
*/
|
|
1093
|
-
mergeWith(
|
|
1094
|
-
merger: (oldVal: V, newVal:
|
|
1095
|
-
...collections: Array<Iterable<[
|
|
1096
|
-
):
|
|
1186
|
+
mergeWith<KC, VC, VCC>(
|
|
1187
|
+
merger: (oldVal: V, newVal: VC, key: K) => VCC,
|
|
1188
|
+
...collections: Array<Iterable<[KC, VC]>>
|
|
1189
|
+
): Map<K | KC, V | VC | VCC>;
|
|
1190
|
+
mergeWith<C, CC>(
|
|
1191
|
+
merger: (oldVal: V, newVal: C, key: string) => CC,
|
|
1192
|
+
...collections: Array<{ [key: string]: C }>
|
|
1193
|
+
): Map<K | string, V | C | CC>;
|
|
1097
1194
|
|
|
1098
1195
|
/**
|
|
1099
1196
|
* Like `merge()`, but when two compatible collections are encountered with
|
|
@@ -1124,9 +1221,12 @@ declare namespace Immutable {
|
|
|
1124
1221
|
*
|
|
1125
1222
|
* Note: `mergeDeep` can be used in `withMutations`.
|
|
1126
1223
|
*/
|
|
1127
|
-
mergeDeep(
|
|
1128
|
-
...collections: Array<Iterable<[
|
|
1129
|
-
):
|
|
1224
|
+
mergeDeep<KC, VC>(
|
|
1225
|
+
...collections: Array<Iterable<[KC, VC]>>
|
|
1226
|
+
): Map<K | KC, V | VC>;
|
|
1227
|
+
mergeDeep<C>(
|
|
1228
|
+
...collections: Array<{ [key: string]: C }>
|
|
1229
|
+
): Map<K | string, V | C>;
|
|
1130
1230
|
|
|
1131
1231
|
/**
|
|
1132
1232
|
* Like `mergeDeep()`, but when two non-collections or incompatible
|
|
@@ -1594,15 +1694,32 @@ declare namespace Immutable {
|
|
|
1594
1694
|
*/
|
|
1595
1695
|
merge<KC, VC>(
|
|
1596
1696
|
...collections: Array<Iterable<[KC, VC]>>
|
|
1597
|
-
): OrderedMap<K | KC, V | VC>;
|
|
1697
|
+
): OrderedMap<K | KC, Exclude<V, VC> | VC>;
|
|
1598
1698
|
merge<C>(
|
|
1599
1699
|
...collections: Array<{ [key: string]: C }>
|
|
1600
|
-
): OrderedMap<K | string, V | C>;
|
|
1700
|
+
): OrderedMap<K | string, Exclude<V, C> | C>;
|
|
1701
|
+
|
|
1601
1702
|
concat<KC, VC>(
|
|
1602
1703
|
...collections: Array<Iterable<[KC, VC]>>
|
|
1603
|
-
): OrderedMap<K | KC, V | VC>;
|
|
1704
|
+
): OrderedMap<K | KC, Exclude<V, VC> | VC>;
|
|
1604
1705
|
concat<C>(
|
|
1605
1706
|
...collections: Array<{ [key: string]: C }>
|
|
1707
|
+
): OrderedMap<K | string, Exclude<V, C> | C>;
|
|
1708
|
+
|
|
1709
|
+
mergeWith<KC, VC, VCC>(
|
|
1710
|
+
merger: (oldVal: V, newVal: VC, key: K) => VCC,
|
|
1711
|
+
...collections: Array<Iterable<[KC, VC]>>
|
|
1712
|
+
): OrderedMap<K | KC, V | VC | VCC>;
|
|
1713
|
+
mergeWith<C, CC>(
|
|
1714
|
+
merger: (oldVal: V, newVal: C, key: string) => CC,
|
|
1715
|
+
...collections: Array<{ [key: string]: C }>
|
|
1716
|
+
): OrderedMap<K | string, V | C | CC>;
|
|
1717
|
+
|
|
1718
|
+
mergeDeep<KC, VC>(
|
|
1719
|
+
...collections: Array<Iterable<[KC, VC]>>
|
|
1720
|
+
): OrderedMap<K | KC, V | VC>;
|
|
1721
|
+
mergeDeep<C>(
|
|
1722
|
+
...collections: Array<{ [key: string]: C }>
|
|
1606
1723
|
): OrderedMap<K | string, V | C>;
|
|
1607
1724
|
|
|
1608
1725
|
// Sequence algorithms
|
package/dist/immutable.js
CHANGED
|
@@ -5905,64 +5905,7 @@
|
|
|
5905
5905
|
return isIndexed(v) ? v.toList() : isKeyed(v) ? v.toMap() : v.toSet();
|
|
5906
5906
|
}
|
|
5907
5907
|
|
|
5908
|
-
var version = "5.0.0-beta.
|
|
5909
|
-
|
|
5910
|
-
var Immutable = {
|
|
5911
|
-
version: version,
|
|
5912
|
-
|
|
5913
|
-
Collection: Collection,
|
|
5914
|
-
// Note: Iterable is deprecated
|
|
5915
|
-
Iterable: Collection,
|
|
5916
|
-
|
|
5917
|
-
Seq: Seq,
|
|
5918
|
-
Map: Map,
|
|
5919
|
-
OrderedMap: OrderedMap,
|
|
5920
|
-
List: List,
|
|
5921
|
-
Stack: Stack,
|
|
5922
|
-
Set: Set,
|
|
5923
|
-
OrderedSet: OrderedSet,
|
|
5924
|
-
PairSorting: PairSorting,
|
|
5925
|
-
|
|
5926
|
-
Record: Record,
|
|
5927
|
-
Range: Range,
|
|
5928
|
-
Repeat: Repeat,
|
|
5929
|
-
|
|
5930
|
-
is: is,
|
|
5931
|
-
fromJS: fromJS,
|
|
5932
|
-
hash: hash,
|
|
5933
|
-
|
|
5934
|
-
isImmutable: isImmutable,
|
|
5935
|
-
isCollection: isCollection,
|
|
5936
|
-
isKeyed: isKeyed,
|
|
5937
|
-
isIndexed: isIndexed,
|
|
5938
|
-
isAssociative: isAssociative,
|
|
5939
|
-
isOrdered: isOrdered,
|
|
5940
|
-
isValueObject: isValueObject,
|
|
5941
|
-
isPlainObject: isPlainObject,
|
|
5942
|
-
isSeq: isSeq,
|
|
5943
|
-
isList: isList,
|
|
5944
|
-
isMap: isMap,
|
|
5945
|
-
isOrderedMap: isOrderedMap,
|
|
5946
|
-
isStack: isStack,
|
|
5947
|
-
isSet: isSet,
|
|
5948
|
-
isOrderedSet: isOrderedSet,
|
|
5949
|
-
isRecord: isRecord,
|
|
5950
|
-
|
|
5951
|
-
get: get,
|
|
5952
|
-
getIn: getIn$1,
|
|
5953
|
-
has: has,
|
|
5954
|
-
hasIn: hasIn$1,
|
|
5955
|
-
merge: merge,
|
|
5956
|
-
mergeDeep: mergeDeep$1,
|
|
5957
|
-
mergeWith: mergeWith,
|
|
5958
|
-
mergeDeepWith: mergeDeepWith$1,
|
|
5959
|
-
remove: remove,
|
|
5960
|
-
removeIn: removeIn,
|
|
5961
|
-
set: set,
|
|
5962
|
-
setIn: setIn$1,
|
|
5963
|
-
update: update$1,
|
|
5964
|
-
updateIn: updateIn$1,
|
|
5965
|
-
};
|
|
5908
|
+
var version = "5.0.0-beta.4";
|
|
5966
5909
|
|
|
5967
5910
|
// Note: Iterable is deprecated
|
|
5968
5911
|
var Iterable = Collection;
|
|
@@ -5980,7 +5923,6 @@
|
|
|
5980
5923
|
exports.Seq = Seq;
|
|
5981
5924
|
exports.Set = Set;
|
|
5982
5925
|
exports.Stack = Stack;
|
|
5983
|
-
exports.default = Immutable;
|
|
5984
5926
|
exports.fromJS = fromJS;
|
|
5985
5927
|
exports.get = get;
|
|
5986
5928
|
exports.getIn = getIn$1;
|