@@ -9,7 +9,7 @@ type IterableCollections = Map<any, any> | Set<any>
9
9
type WeakCollections = WeakMap < any , any > | WeakSet < any >
10
10
type MapTypes = Map < any , any > | WeakMap < any , any >
11
11
type SetTypes = Set < any > | WeakSet < any >
12
-
12
+ type instrumentationsType = Record < string , Function | number >
13
13
const toShallow = < T extends unknown > ( value : T ) : T => value
14
14
15
15
const getProto = < T extends CollectionTypes > ( v : T ) : any =>
@@ -228,7 +228,7 @@ function createReadonlyMethod(type: TriggerOpTypes): Function {
228
228
}
229
229
230
230
function createInstrumentations ( ) {
231
- const mutableInstrumentations : Record < string , Function > = {
231
+ const mutableInstrumentations : instrumentationsType = {
232
232
get ( this : MapTypes , key : unknown ) {
233
233
return get ( this , key )
234
234
} ,
@@ -243,7 +243,7 @@ function createInstrumentations() {
243
243
forEach : createForEach ( false , false )
244
244
}
245
245
246
- const shallowInstrumentations : Record < string , Function > = {
246
+ const shallowInstrumentations : instrumentationsType = {
247
247
get ( this : MapTypes , key : unknown ) {
248
248
return get ( this , key , false , true )
249
249
} ,
@@ -258,7 +258,7 @@ function createInstrumentations() {
258
258
forEach : createForEach ( false , true )
259
259
}
260
260
261
- const readonlyInstrumentations : Record < string , Function > = {
261
+ const readonlyInstrumentations : instrumentationsType = {
262
262
get ( this : MapTypes , key : unknown ) {
263
263
return get ( this , key , true )
264
264
} ,
@@ -275,7 +275,7 @@ function createInstrumentations() {
275
275
forEach : createForEach ( true , false )
276
276
}
277
277
278
- const shallowReadonlyInstrumentations : Record < string , Function > = {
278
+ const shallowReadonlyInstrumentations : instrumentationsType = {
279
279
get ( this : MapTypes , key : unknown ) {
280
280
return get ( this , key , true , true )
281
281
} ,
0 commit comments