Socket
Socket
Sign inDemoInstall

canonicalize

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.2 to 1.0.3

2

package.json
{
"name": "canonicalize",
"version": "1.0.2",
"version": "1.0.3",
"description": "JSON canonicalize function ",

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

@@ -7,16 +7,28 @@ [![Build Status](https://travis-ci.com/erdtman/canonicalize.svg?branch=master)](https://travis-ci.com/erdtman/canonicalize)

## Usage
### Normal Example
```js
JSON.canonicalize = require('canonicalize');
const json = {
"1": {"f": {"f": "hi","F": 5} ,"\n": 56.0},
"10": { },
"": "empty",
"a": { },
"111": [ {"e": "yes","E": "no" } ],
"A": { }
const json = {
"from_account": "543 232 625-3",
"to_account": "321 567 636-4",
"amount": 500,
"curency": "USD"
}
console.log(JSON.canonicalize(json));
// output: {"amount":500,"curency":"USD","from_account":"543 232 625-3","to_account":"321 567 636-4"}
```
### Crazy Example
```js
JSON.canonicalize = require('canonicalize');
const json = {
"1": {"f": {"f": "hi","F": 5} ,"\n": 56.0},
"10": { },
"": "empty",
"a": { },
"111": [ {"e": "yes","E": "no" } ],
"A": { }
}
console.log(JSON.canonicalize(json));
// output: {"":"empty","1":{"\n":56,"f":{"F":5,"f":"hi"}},"10":{},"111":[{"E":"no","e":"yes"}],"A":{},"a":{}}
```
## Install

@@ -23,0 +35,0 @@ ```

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc