convert-to-ecmascript-compatible-varname
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -22,2 +22,5 @@ /** | ||
// Save original string for error messages and such. | ||
var original = str; | ||
// Camel-case dash-delimited things | ||
@@ -38,3 +41,3 @@ str = str.replace(/-+([a-z])/g, function($all, $1) { | ||
if (!str.match(X_VALID_ECMA51_VARNAME)) { | ||
throw new Error(util.format('The string "%s" cannot be converted into an ECMAScript 5.1-compatible variable name.', str)); | ||
throw new Error(util.format('The string "%s" cannot be converted into an ECMAScript 5.1-compatible variable name.', original)); | ||
} | ||
@@ -41,0 +44,0 @@ |
{ | ||
"name": "convert-to-ecmascript-compatible-varname", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Given a string of dash-delimited words, return a similar version of the string, but which is camel-cased and otherwise stripped of special characters, whitespace, etc. so that it is usable as an ECMAScript variable.", | ||
@@ -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
20954
124