File tree 4 files changed +14
-5
lines changed
types/reflect.getprototypeof
4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change 2
2
3
3
var forEach = require ( 'for-each' ) ;
4
4
var callBind = require ( 'call-bind' ) ;
5
+ var gPO = require ( 'reflect.getprototypeof/polyfill' ) ( ) ;
5
6
6
7
var typedArrays = require ( 'available-typed-arrays' ) ( ) ;
7
8
@@ -10,7 +11,6 @@ var typedArrays = require('available-typed-arrays')();
10
11
11
12
/** @type {Object.<typeof typedArrays, ByteOffsetGetter> } */
12
13
var getters = { } ;
13
- var hasProto = require ( 'has-proto' ) ( ) ;
14
14
15
15
var gOPD = require ( 'gopd' ) ;
16
16
var oDP = Object . defineProperty ;
@@ -25,8 +25,8 @@ if (gOPD) {
25
25
var Proto = global [ typedArray ] . prototype ;
26
26
// @ts -expect-error TS can't guarantee the callback is invoked sync
27
27
var descriptor = gOPD ( Proto , 'byteOffset' ) ;
28
- if ( ! descriptor && hasProto ) {
29
- var superProto = Proto . __proto__ ; // eslint-disable-line no-proto
28
+ if ( ! descriptor ) {
29
+ var superProto = gPO ( Proto ) ;
30
30
// @ts -expect-error TS can't guarantee the callback is invoked sync
31
31
descriptor = gOPD ( superProto , 'byteOffset' ) ;
32
32
}
Original file line number Diff line number Diff line change 62
62
"for-each" : " ^0.3.3" ,
63
63
"gopd" : " ^1.0.1" ,
64
64
"has-proto" : " ^1.0.3" ,
65
- "is-typed-array" : " ^1.1.13"
65
+ "is-typed-array" : " ^1.1.13" ,
66
+ "reflect.getprototypeof" : " ^1.0.6"
66
67
},
67
68
"devDependencies" : {
68
69
"@arethetypeswrong/cli" : " ^0.17.0" ,
69
70
"@ljharb/eslint-config" : " ^21.1.1" ,
70
71
"@ljharb/tsconfig" : " ^0.2.0" ,
71
72
"@types/call-bind" : " ^1.0.5" ,
73
+ "@types/es-abstract" : " ^1.17.9" ,
72
74
"@types/for-each" : " ^0.3.3" ,
73
75
"@types/gopd" : " ^1.0.3" ,
74
76
"@types/is-callable" : " ^1.1.2" ,
107
109
},
108
110
"publishConfig" : {
109
111
"ignore" : [
110
- " .github/workflows"
112
+ " .github/workflows" ,
113
+ " types"
111
114
]
112
115
}
113
116
}
Original file line number Diff line number Diff line change 2
2
"extends" : " @ljharb/tsconfig" ,
3
3
"compilerOptions" : {
4
4
"target" : " ES2021" ,
5
+ "maxNodeModuleJsDepth" : 0 ,
5
6
},
6
7
"exclude" : [
7
8
" coverage" ,
Original file line number Diff line number Diff line change
1
+ declare module 'reflect.getprototypeof/polyfill' {
2
+ function getPolyfill ( ) : typeof Reflect . getPrototypeOf ;
3
+
4
+ export = getPolyfill ;
5
+ }
You can’t perform that action at this time.
0 commit comments