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

ejson-extras

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ejson-extras - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"name": "ejson-extras",
"version": "1.0.1",
"version": "1.0.2",
"description": "Extends EJSON with additional types, including Qty (js-quantities) objects.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -12,2 +12,19 @@ Extends EJSON with additional types.

# Usage
```javascript
const EJSON = require('ejson');
require('ejson-extras');
const map1 = new Map().set('foo', 'bar').set('hello', 'world');
EJSON.stringify(map1); // '{"$type":"Map","$value":"[[\\"foo\\",\\"bar\\"],[\\"hello\\",\\"world\\"]]"}'
JSON.stringify(map1); // '{}'
const string = '{"$type":"Map","$value":"[[\\"hello\\",\\"world\\"]]"}';
EJSON.parse(string); // Map { 'hello' => 'world' }
const map2 = new Map().set('hello', 'world').set('foo', 'bar');
EJSON.equals(map1, map2); // true
```
# Creating a custom type

@@ -14,0 +31,0 @@

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