Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

json2php

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

json2php - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

10

lib/json2php.js

@@ -5,4 +5,6 @@ // Generated by CoffeeScript 2.7.0

make = function({linebreak = '', indent = ''} = {}) {
var nest, transform;
make = function({linebreak = '', indent = '', shortArraySyntax = false} = {}) {
var arrClose, arrOpen, nest, transform;
arrOpen = shortArraySyntax ? '[' : 'array(';
arrClose = shortArraySyntax ? ']' : ')';
nest = {

@@ -48,3 +50,3 @@ '[object Array]': function(obj, parentIndent) {

items = nest[objType](obj, nestIndent);
result = `array(${linebreak + nestIndent}${items.join(',' + (linebreak === '' ? ' ' : linebreak + nestIndent))}${linebreak + parentIndent})`;
result = `${arrOpen}${linebreak + nestIndent}${items.join(',' + (linebreak === '' ? ' ' : linebreak + nestIndent))}${linebreak + parentIndent}${arrClose}`;
break;

@@ -64,4 +66,4 @@ default:

module.exports = json2php;
// Not that good but usefull
// Not that good but useful
global.json2php = json2php;
}

2

package.json
{
"name": "json2php",
"version": "0.0.6",
"version": "0.0.7",
"description": "JSON to PHP converter",

@@ -5,0 +5,0 @@ "main": "lib/json2php.js",

@@ -75,15 +75,15 @@ json2php

```javascript
const printer = json2php.make({linebreak:'\n', indent:'\t'})
const printer = json2php.make({linebreak:'\n', indent:'\t', shortArraySyntax: true})
printer({one: 3, two: 20, three: [9, 3, 2]})
/* result:.
array(
[
'one' => 3,
'two' => 20,
'set' => array(
'set' => [
9,
3,
2
)
)
]
]
*/

@@ -112,2 +112,5 @@ ```

#### 0.0.7
* Add `shortArraySyntax` to pretty print options
#### 0.0.6

@@ -114,0 +117,0 @@ * Add pretty print capability via `json2php.make` (thanks to @stokesman)

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc