From 56cc0d57bf693d36de8d355478b2aea5f250e9aa Mon Sep 17 00:00:00 2001 From: jackZ <53945162+jackZmym@users.noreply.github.com> Date: Thu, 1 Sep 2022 16:08:48 +0800 Subject: [PATCH] Update collectionHandlers.ts --- packages/reactivity/src/collectionHandlers.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/reactivity/src/collectionHandlers.ts b/packages/reactivity/src/collectionHandlers.ts index 09365f96021..bea173cd8a6 100644 --- a/packages/reactivity/src/collectionHandlers.ts +++ b/packages/reactivity/src/collectionHandlers.ts @@ -9,7 +9,7 @@ type IterableCollections = Map | Set type WeakCollections = WeakMap | WeakSet type MapTypes = Map | WeakMap type SetTypes = Set | WeakSet - +type instrumentationsType = Record const toShallow = (value: T): T => value const getProto = (v: T): any => @@ -228,7 +228,7 @@ function createReadonlyMethod(type: TriggerOpTypes): Function { } function createInstrumentations() { - const mutableInstrumentations: Record = { + const mutableInstrumentations: instrumentationsType = { get(this: MapTypes, key: unknown) { return get(this, key) }, @@ -243,7 +243,7 @@ function createInstrumentations() { forEach: createForEach(false, false) } - const shallowInstrumentations: Record = { + const shallowInstrumentations: instrumentationsType = { get(this: MapTypes, key: unknown) { return get(this, key, false, true) }, @@ -258,7 +258,7 @@ function createInstrumentations() { forEach: createForEach(false, true) } - const readonlyInstrumentations: Record = { + const readonlyInstrumentations: instrumentationsType = { get(this: MapTypes, key: unknown) { return get(this, key, true) }, @@ -275,7 +275,7 @@ function createInstrumentations() { forEach: createForEach(true, false) } - const shallowReadonlyInstrumentations: Record = { + const shallowReadonlyInstrumentations: instrumentationsType = { get(this: MapTypes, key: unknown) { return get(this, key, true, true) },