Comparing version 0.0.8 to 0.0.9
@@ -5,3 +5,3 @@ // Generated by CoffeeScript 2.7.0 | ||
make = function({linebreak = '', indent = '', shortArraySyntax = false} = {}) { | ||
make = function({linebreak = '', indent = '', shortArraySyntax = false, stripSpaces = false} = {}) { | ||
var arrClose, arrOpen, nest, transform; | ||
@@ -26,3 +26,3 @@ arrOpen = shortArraySyntax ? '[' : 'array('; | ||
value = obj[key]; | ||
results.push(transform(key, parentIndent) + ' => ' + transform(value, parentIndent)); | ||
results.push(transform(key, parentIndent) + (stripSpaces ? '=>' : ' => ') + transform(value, parentIndent)); | ||
} | ||
@@ -51,3 +51,3 @@ return results; | ||
items = nest[objType](obj, nestIndent); | ||
result = `${arrOpen}${linebreak + nestIndent}${items.join(',' + (linebreak === '' ? ' ' : linebreak + nestIndent))}${linebreak + parentIndent}${arrClose}`; | ||
result = `${arrOpen}${linebreak + nestIndent}${items.join(',' + (linebreak === '' && !stripSpaces ? ' ' : linebreak + nestIndent))}${linebreak + parentIndent}${arrClose}`; | ||
break; | ||
@@ -54,0 +54,0 @@ default: |
{ | ||
"name": "json2php", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"description": "JSON to PHP converter", | ||
@@ -24,6 +24,2 @@ "main": "lib/json2php.js", | ||
"email": "daniel.zahariev@gmail.com" | ||
}, | ||
{ | ||
"name": "Bozhidar Dryanovski", | ||
"email": "bozhidar.dryanovski@gmail.com" | ||
} | ||
@@ -30,0 +26,0 @@ ], |
@@ -127,3 +127,3 @@ json2php | ||
#### 0.0.8 | ||
#### 0.0.9 | ||
* Add `stripSpaces` to pretty print options (thanks to @noahtallen) | ||
@@ -130,0 +130,0 @@ |
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
10815