From 3158ffb6ef153c0e76f4a6b5b98e91a8315c197c Mon Sep 17 00:00:00 2001 From: Trevor Norris Date: Fri, 2 Aug 2013 12:52:34 -0700 Subject: [PATCH] util: add isPrimitive check --- lib/util.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/util.js b/lib/util.js index b59bae5067..1b168bfd94 100644 --- a/lib/util.js +++ b/lib/util.js @@ -505,6 +505,11 @@ function isFunction(arg) { } exports.isFunction = isFunction; +function isPrimitive(arg) { + return !(arg instanceof Object); +} +exports.isPrimitive = isPrimitive; + function isBuffer(arg) { return arg instanceof Buffer; }