Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixed array bug

  • Loading branch information...
commit 432624efb03014d602f723ec09749732f93732cb 1 parent 50422e1
@zachwe zachwe authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/nowUtil.js
View
8 lib/nowUtil.js
@@ -50,7 +50,11 @@ var util = {
for (var i = 0, keys = Object.keys(obj), ii = keys.length; i < ii; i++) {
var key = keys[i];
if (obj[key] && typeof obj[key] === 'object') {
- target[key] = target[key] || {};
+ if(Array.isArray(obj[key])) {
+ target[key] = target[key] || [];
+ } else {
+ target[key] = target[key] || {};
+ }
util.extend(target[key], obj[key]);
} else {
target[key] = obj[key];
@@ -106,4 +110,4 @@ var util = {
}
};
-exports.nowUtil = util;
+exports.nowUtil = util;
Please sign in to comment.
Something went wrong with that request. Please try again.