utils-extend
Advanced tools
Comparing version 1.0.7 to 1.0.8
13
index.js
@@ -9,4 +9,8 @@ /** | ||
function isObject(value) { | ||
return toString.call(value) === '[object Object]'; | ||
} | ||
// And type check method: isFunction, isString, isNumber, isDate, isRegExp, isObject | ||
['Function', 'String', 'Number', 'Date', 'RegExp', 'Object'].forEach(function(item) { | ||
['Function', 'String', 'Number', 'Date', 'RegExp'].forEach(function(item) { | ||
exports['is' + item] = function(value) { | ||
@@ -36,4 +40,4 @@ return toString.call(value) === '[object ' + item + ']'; | ||
extend(target[key], value); | ||
} else if (exports.isObject(value)) { | ||
if (!exports.isObject(target[key])) { | ||
} else if (isObject(value)) { | ||
if (!isObject(target[key])) { | ||
target[key] = {}; | ||
@@ -53,2 +57,5 @@ } | ||
// fixed util.isObject | ||
exports.isObject = isObject; | ||
exports.extend = function() { | ||
@@ -55,0 +62,0 @@ var args = Array.prototype.slice.call(arguments, 0); |
{ | ||
"name": "utils-extend", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"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
8931
253