Skip to content

Commit 56cc0d5

Browse files
authored
Update collectionHandlers.ts
1 parent fa6556a commit 56cc0d5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/reactivity/src/collectionHandlers.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type IterableCollections = Map<any, any> | Set<any>
99
type WeakCollections = WeakMap<any, any> | WeakSet<any>
1010
type MapTypes = Map<any, any> | WeakMap<any, any>
1111
type SetTypes = Set<any> | WeakSet<any>
12-
12+
type instrumentationsType = Record<string, Function | number>
1313
const toShallow = <T extends unknown>(value: T): T => value
1414

1515
const getProto = <T extends CollectionTypes>(v: T): any =>
@@ -228,7 +228,7 @@ function createReadonlyMethod(type: TriggerOpTypes): Function {
228228
}
229229

230230
function createInstrumentations() {
231-
const mutableInstrumentations: Record<string, Function> = {
231+
const mutableInstrumentations: instrumentationsType = {
232232
get(this: MapTypes, key: unknown) {
233233
return get(this, key)
234234
},
@@ -243,7 +243,7 @@ function createInstrumentations() {
243243
forEach: createForEach(false, false)
244244
}
245245

246-
const shallowInstrumentations: Record<string, Function> = {
246+
const shallowInstrumentations: instrumentationsType = {
247247
get(this: MapTypes, key: unknown) {
248248
return get(this, key, false, true)
249249
},
@@ -258,7 +258,7 @@ function createInstrumentations() {
258258
forEach: createForEach(false, true)
259259
}
260260

261-
const readonlyInstrumentations: Record<string, Function> = {
261+
const readonlyInstrumentations: instrumentationsType = {
262262
get(this: MapTypes, key: unknown) {
263263
return get(this, key, true)
264264
},
@@ -275,7 +275,7 @@ function createInstrumentations() {
275275
forEach: createForEach(true, false)
276276
}
277277

278-
const shallowReadonlyInstrumentations: Record<string, Function> = {
278+
const shallowReadonlyInstrumentations: instrumentationsType = {
279279
get(this: MapTypes, key: unknown) {
280280
return get(this, key, true, true)
281281
},

0 commit comments

Comments
 (0)