diff --git a/lib/util.js b/lib/util.js index 1b168bfd945..5addac5c3aa 100644 --- a/lib/util.js +++ b/lib/util.js @@ -506,7 +506,12 @@ function isFunction(arg) { exports.isFunction = isFunction; function isPrimitive(arg) { - return !(arg instanceof Object); + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; } exports.isPrimitive = isPrimitive;