Skip to content

Commit 0edbfbc

Browse files
committed
fix(Error.custom): improve ext argument detection
1 parent bf098bc commit 0edbfbc

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

error/custom.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
'use strict';
22

3-
var assign = require('../object/assign')
3+
var assign = require('../object/assign')
4+
, isObject = require('../object/is-object')
45

56
, captureStackTrace = Error.captureStackTrace;
67

78
exports = module.exports = function (message/*, code, ext*/) {
89
var err = new Error(message), code = arguments[1], ext = arguments[2];
910
if (ext == null) {
10-
if (code && (typeof code === 'object')) {
11+
if (isObject(code)) {
1112
ext = code;
1213
code = null;
1314
}

0 commit comments

Comments
 (0)