File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
lib/node_modules/@stdlib/_tools/scripts Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -206,8 +206,8 @@ function transformer( fileInfo, api ) {
206
206
// If the string literal is inside a NewExpression for an error, replace the string literal with the error message...
207
207
else if (
208
208
// Case: new Error( format( '...', ... ) )
209
- ( path . parent . parent . value . type === 'NewExpression' &&
210
- ERROR_NAMES . includes ( path . parent . parent . value . callee . name ) )
209
+ path . parent . parent . value . type === 'NewExpression' &&
210
+ ERROR_NAMES . indexOf ( path . parent . parent . value . callee . name ) !== - 1
211
211
) {
212
212
id = msg2id ( path . value . value ) ;
213
213
if ( id ) {
@@ -219,8 +219,8 @@ function transformer( fileInfo, api ) {
219
219
}
220
220
else if (
221
221
// Case: new Error( '...' )
222
- ( path . parent . value . type === 'NewExpression' &&
223
- ERROR_NAMES . includes ( path . parent . value . callee . name ) )
222
+ path . parent . value . type === 'NewExpression' &&
223
+ ERROR_NAMES . indexof ( path . parent . value . callee . name ) !== - 1
224
224
) {
225
225
id = msg2id ( path . value . value ) ;
226
226
if ( id ) {
You can’t perform that action at this time.
0 commit comments