stringify-object
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -54,3 +54,6 @@ /*global window */ | ||
var eol = objKeys.length - 1 === i ? '\n' : ',\n'; | ||
return pad + opts.indent + el + ': ' + stringifyObject(obj[el], opts, pad + opts.indent) + eol; | ||
// quote key if the first character is not `a-z` or | ||
// the rest contains something other than `a-z0-9_` | ||
var key = /^[^a-z]|\W+/ig.test(el) ? stringifyObject(el, opts) : el; | ||
return pad + opts.indent + key + ': ' + stringifyObject(obj[el], opts, pad + opts.indent) + eol; | ||
}).join('') + pad + '}'; | ||
@@ -57,0 +60,0 @@ } |
{ | ||
"name": "stringify-object", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Stringify an object using a custom indentation", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
3891
59