underscore-plus
Advanced tools
Comparing version 1.0.5 to 1.0.6
@@ -90,2 +90,3 @@ (function() { | ||
deepClone: function(object) { | ||
var _this = this; | ||
if (_.isArray(object)) { | ||
@@ -96,7 +97,5 @@ return object.map(function(value) { | ||
} else if (_.isObject(object)) { | ||
return plus.mapObject(object, (function(_this) { | ||
return function(key, value) { | ||
return [key, plus.deepClone(value)]; | ||
}; | ||
})(this)); | ||
return plus.mapObject(object, function(key, value) { | ||
return [key, plus.deepClone(value)]; | ||
}); | ||
} else { | ||
@@ -297,6 +296,9 @@ return object; | ||
} | ||
result = string.replace(/([A-Z])|(_)/g, function(m, letter, underscore) { | ||
result = string.replace(/([A-Z])|_+/g, function(match, letter) { | ||
if (letter == null) { | ||
letter = ''; | ||
} | ||
return " " + letter; | ||
}); | ||
return plus.capitalize(result); | ||
return plus.capitalize(result.trim()); | ||
}, | ||
@@ -315,8 +317,7 @@ undasherize: function(string) { | ||
string = string[0].toLowerCase() + string.slice(1); | ||
return string.replace(/([A-Z])|(-)/g, function(m, letter, dash) { | ||
if (letter) { | ||
return "_" + letter.toLowerCase(); | ||
} else { | ||
return "_"; | ||
return string.replace(/([A-Z])|-+/g, function(match, letter) { | ||
if (letter == null) { | ||
letter = ''; | ||
} | ||
return "_" + (letter.toLowerCase()); | ||
}); | ||
@@ -323,0 +324,0 @@ }, |
{ | ||
"name": "underscore-plus", | ||
"version": "1.0.5", | ||
"version": "1.0.6", | ||
"description": "Underscore plus additional utilities", | ||
@@ -5,0 +5,0 @@ "licenses": [ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
14236
415
0