File tree Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Expand file tree Collapse file tree 1 file changed +1
-18
lines changed Original file line number Diff line number Diff line change @@ -45,8 +45,7 @@ export default createRule("no-extra-lookaround-assertions", {
45
45
assertion : LookaroundAssertion ,
46
46
) {
47
47
for ( const alternative of assertion . alternatives ) {
48
- const nested = at (
49
- alternative . elements ,
48
+ const nested = alternative . elements . at (
50
49
assertion . kind === "lookahead"
51
50
? // The last positive lookahead assertion within
52
51
// a lookahead assertion is the same without the assertion.
@@ -99,19 +98,3 @@ export default createRule("no-extra-lookaround-assertions", {
99
98
} )
100
99
} ,
101
100
} )
102
-
103
- // TODO After dropping support for Node < v16.6.0 we can use native `.at()`.
104
- /**
105
- * `.at()` polyfill
106
- * see https://github.com/tc39/proposal-relative-indexing-method#polyfill
107
- */
108
- function at < T > ( array : T [ ] , n : number ) {
109
- // ToInteger() abstract op
110
- let num = Math . trunc ( n ) || 0
111
- // Allow negative indexing from the end
112
- if ( num < 0 ) num += array . length
113
- // OOB access is guaranteed to return undefined
114
- if ( num < 0 || num >= array . length ) return undefined
115
- // Otherwise, this is just normal property access
116
- return array [ num ]
117
- }
You can’t perform that action at this time.
0 commit comments