Skip to content

Commit

Permalink
fix: rm WeakMap, we can't use it for key with type string (angular-re…
Browse files Browse the repository at this point in the history
  • Loading branch information
denkorolenko authored and smithad15 committed Jul 9, 2018
1 parent 454127c commit 6a9bdc2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions packages/form/source/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export abstract class State {
() => Array.prototype.slice.call(object, 0)
);
}
else if (object instanceof WeakMap || object instanceof Map) {
else if (object instanceof Map) {
return metaOperations(
// Update map key
(parent, key: number | string, value: K) => {
Expand All @@ -217,9 +217,7 @@ export abstract class State {
},

// Clone
() => object instanceof WeakMap
? new WeakMap<string, any>(<any> object)
: new Map<string, any>(<any> object)
() => new Map<string, any>(<any> object)
);
}
else if (object instanceof WeakSet || object instanceof Set) {
Expand Down

0 comments on commit 6a9bdc2

Please sign in to comment.