From 6a9bdc240e5b0e1e7eba9383697fa5f7cf382a43 Mon Sep 17 00:00:00 2001 From: denis-k Date: Mon, 27 Mar 2017 05:30:09 +0300 Subject: [PATCH] fix: rm WeakMap, we can't use it for key with type string (#15) --- packages/form/source/state.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/form/source/state.ts b/packages/form/source/state.ts index 43e441a3..2759ca07 100644 --- a/packages/form/source/state.ts +++ b/packages/form/source/state.ts @@ -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) => { @@ -217,9 +217,7 @@ export abstract class State { }, // Clone - () => object instanceof WeakMap - ? new WeakMap( object) - : new Map( object) + () => new Map( object) ); } else if (object instanceof WeakSet || object instanceof Set) {