From 361dbd84a6e53fcd91286b21142be4685db78986 Mon Sep 17 00:00:00 2001 From: denis-k Date: Mon, 13 Mar 2017 09:59:06 +0100 Subject: [PATCH] fix: rm WeakMap, we can't use it for key with type string --- source/state.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/state.ts b/source/state.ts index 43e441a..2759ca0 100644 --- a/source/state.ts +++ b/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) {