File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,10 @@ export function internalSpyOn<T, K extends string & keyof T>(
45
45
'cannot spyOn on a primitive value'
46
46
)
47
47
48
- let getMeta = ( ) : [ string | symbol | number , 'value' | 'get' | 'set' ] => {
48
+ let [ accessName , accessType ] = ( ( ) : [
49
+ string | symbol | number ,
50
+ 'value' | 'get' | 'set'
51
+ ] => {
49
52
if ( ! isType ( 'object' , methodName ) ) {
50
53
return [ methodName , 'value' ]
51
54
}
@@ -59,9 +62,7 @@ export function internalSpyOn<T, K extends string & keyof T>(
59
62
return [ methodName . setter , 'set' ]
60
63
}
61
64
throw new Error ( 'specify getter or setter to spy on' )
62
- }
63
-
64
- let [ accessName , accessType ] = getMeta ( )
65
+ } ) ( )
65
66
let objDescriptor = getDescriptor ( obj , accessName )
66
67
let proto = Object . getPrototypeOf ( obj )
67
68
let protoDescriptor = proto && getDescriptor ( proto , accessName )
You can’t perform that action at this time.
0 commit comments