8000 Deploy af28e9beb3b34859615a811dd1009bf56d19f258 to NPM branch · MULXCODE/immutable-js@2a231d6 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit 2a231d6

Browse files
author
Travis CI
committed
Deploy af28e9b to NPM branch
1 parent 2d479e6 commit 2a231d6

File tree

3 files changed

+40
-30
lines changed

3 files changed

+40
-30
lines changed

dist/immutable.es.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2070,6 +2070,9 @@ function mergeWith(merger) {
20702070
var iters = [], len = arguments.length - 1;
20712071
while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ];
20722072

2073+
if (typeof merger !== 'function') {
2074+
throw new TypeError('Invalid merger function: ' + merger);
2075+
}
20732076
return mergeIntoKeyedWith(this, iters, merger);
20742077
}
20752078

@@ -2149,9 +2152,11 @@ function mergeWithSources(collection, sources, merger) {
21492152
);
21502153
}
21512154
if (isImmutable(collection)) {
2152-
return collection.mergeWith
2155+
return typeof merger === 'function' && collection.mergeWith
21532156
? collection.mergeWith.apply(collection, [ merger ].concat( sources ))
2154-
: collection.concat.apply(collection, sources);
2157+
: collection.merge
2158+
? collection.merge.apply(collection, sources)
2159+
: collection.concat.apply(collection, sources);
21552160
}
21562161
var isArray = Array.isArray(collection);
21572162
var merged = collection;

dist/immutable.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2076,6 +2076,9 @@
20762076
var iters = [], len = arguments.length - 1;
20772077
while ( len-- > 0 ) iters[ len ] = arguments[ len + 1 ];
20782078

2079+
if (typeof merger !== 'function') {
2080+
throw new TypeError('Invalid merger function: ' + merger);
2081+
}
20792082
return mergeIntoKeyedWith(this, iters, merger);
20802083
}
20812084

@@ -2155,9 +2158,11 @@
21552158
);
21562159
}
21572160
if (isImmutable(collection)) {
2158-
return collection.mergeWith
2161+
return typeof merger === 'function' && collection.mergeWith
21592162
? collection.mergeWith.apply(collection, [ merger ].concat( sources ))
2160-
: collection.concat.apply(collection, sources);
2163+
: collection.merge
2164+
? collection.merge.apply(collection, sources)
2165+
: collection.concat.apply(collection, sources);
21612166
}
21622167
var isArray = Array.isArray(collection);
21632168
var merged = collection;

0 commit comments

Comments
 (0)
0