diff options
Diffstat (limited to 'lib/util.js')
-rw-r--r-- | lib/util.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/util.js b/lib/util.js index dbadef8..b6691af 100644 --- a/lib/util.js +++ b/lib/util.js @@ -74,7 +74,10 @@ exports.getISODate = function getISODate(dateStr) { * the result will be untouched actual argument of the call. */ var valToArray = exports.valToArray = function valToArray(val) { - return (val instanceof Array) ? val : [val]; + var isArr = val && + val.constructor && + val.constructor.name === "Array"; + return isArr ? val : [val]; }; /** |