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

@ipld/dag-json

Package Overview
Dependencies
Maintainers
3
Versions
75
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ipld/dag-json - npm Package Compare versions

Comparing version 3.0.11 to 3.0.12

coverage/tmp/coverage-3710-1595132506701-0.json

11

index.js
import json from 'fast-json-stable-stringify'
import isCircular from 'is-circular'
import isCircular from '@ipld/is-circular'
import transform from 'lodash.transform'

@@ -8,4 +8,5 @@

const _encode = obj => transform(obj, (result, value, key) => {
if (CID.isCID(value)) {
result[key] = { '/': value.toString() }
const cid = CID.asCID(value)
if (cid) {
result[key] = { '/': cid.toString() }
} else if (bytes.isBinary(value)) {

@@ -22,4 +23,4 @@ value = bytes.coerce(value)

const encode = obj => {
if (typeof obj === 'object' && !bytes.isBinary(obj) && !CID.isCID(obj) && obj) {
if (isCircular(obj)) throw new Error('Object contains circular references.')
if (typeof obj === 'object' && !bytes.isBinary(obj) && !CID.asCID(obj) && obj) {
if (isCircular(CID, obj)) throw new Error('Object contains circular references.')
obj = _encode(obj)

@@ -26,0 +27,0 @@ }

{
"name": "@ipld/dag-json",
"version": "3.0.11",
"version": "3.0.12",
"description": "JSON Directed Acrylic Graph for IPLD",

@@ -38,12 +38,12 @@ "main": "index.js",

"mocha": "^8.0.1",
"multiformats": "1.1.11",
"multiformats": "2.0.1",
"polendina": "^1.0.0",
"rollup": "^2.18.0",
"rollup": "^2.22.1",
"standard": "^14.3.4"
},
"dependencies": {
"@ipld/is-circular": "^1.0.3",
"fast-json-stable-stringify": "^2.1.0",
"is-circular": "^1.0.2",
"lodash.transform": "^4.6.0"
}
}

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