mirror of https://github.com/nodejs/node.git
util: add isPrimitive check
parent
e772a7deaf
commit
3158ffb6ef
|
@ -505,6 +505,11 @@ function isFunction(arg) {
|
||||||
}
|
}
|
||||||
exports.isFunction = isFunction;
|
exports.isFunction = isFunction;
|
||||||
|
|
||||||
|
function isPrimitive(arg) {
|
||||||
|
return !(arg instanceof Object);
|
||||||
|
}
|
||||||
|
exports.isPrimitive = isPrimitive;
|
||||||
|
|
||||||
function isBuffer(arg) {
|
function isBuffer(arg) {
|
||||||
return arg instanceof Buffer;
|
return arg instanceof Buffer;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue