Skip to content

Commit 6a9bdc2

Browse files
denkorolenkosmithad15
authored andcommitted
fix: rm WeakMap, we can't use it for key with type string (angular-redux#15)
1 parent 454127c commit 6a9bdc2

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

packages/form/source/state.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export abstract class State {
194194
() => Array.prototype.slice.call(object, 0)
195195
);
196196
}
197-
else if (object instanceof WeakMap || object instanceof Map) {
197+
else if (object instanceof Map) {
198198
return metaOperations(
199199
// Update map key
200200
(parent, key: number | string, value: K) => {
@@ -217,9 +217,7 @@ export abstract class State {
217217
},
218218

219219
// Clone
220-
() => object instanceof WeakMap
221-
? new WeakMap<string, any>(<any> object)
222-
: new Map<string, any>(<any> object)
220+
() => new Map<string, any>(<any> object)
223221
);
224222
}
225223
else if (object instanceof WeakSet || object instanceof Set) {

0 commit comments

Comments
 (0)