util: add isPrimitive check

pull/5010/head
Trevor Norris 2013-08-02 12:52:34 -07:00
parent e772a7deaf
commit 3158ffb6ef
1 changed files with 5 additions and 0 deletions

View File

@ -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;
} }