utils-extend
Advanced tools
Comparing version 1.0.2 to 1.0.3
16
index.js
@@ -21,2 +21,3 @@ var util = require('util'); | ||
value = source[key]; | ||
if (Array.isArray(value)) { | ||
@@ -29,3 +30,3 @@ if (!Array.isArray(target[key])) { | ||
} else if (isObject(value)) { | ||
if (!isObject(value)) { | ||
if (!isObject(target[key])) { | ||
target[key] = {}; | ||
@@ -45,4 +46,11 @@ } | ||
exports.extend = extend; | ||
exports.extend = function() { | ||
var args = Array.prototype.slice.call(arguments, 0); | ||
var target = args.shift(); | ||
args.forEach(function(item) { | ||
extend(target, item); | ||
}); | ||
}; | ||
exports.isObject = isObject; | ||
@@ -52,4 +60,2 @@ | ||
exports.noop = function() {}; | ||
exports.isFunction = function(value) { | ||
@@ -67,2 +73,4 @@ return typeof value === 'function'; | ||
exports.noop = function() {}; | ||
exports.unique = function(array) { | ||
@@ -69,0 +77,0 @@ var result = []; |
{ | ||
"name": "utils-extend", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Extend nodejs util api, and it is light weight and simple", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
4975
4
139
0
62