There was an error while loading. Please reload this page.
1 parent d6c6a7a commit eda8ea6Copy full SHA for eda8ea6
1 file changed
test/test.js
@@ -6,8 +6,16 @@ var util = require('util')
6
7
var createError = require('..')
8
9
-// eslint-disable-next-line node/no-deprecated-api
10
-var isError = typeof Error.isError === 'function' ? Error.isError : util.isError
+var isError = typeof Error.isError === 'function'
+ ? Error.isError
11
+ // eslint-disable-next-line node/no-deprecated-api
12
+ : typeof util.isError === 'function'
13
14
+ ? util.isError
15
+ // Fallback for Node.js v23: util.isError was removed in Node.js v23 (EOL), and Error.isError was introduced in Node.js v24
16
+ : function (err) {
17
+ return err instanceof Error
18
+ }
19
20
var itErrorIsError = typeof Error.isError === 'function'
21
? it
0 commit comments