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

@ipld/dag-cbor

Package Overview
Dependencies
Maintainers
3
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ipld/dag-cbor - npm Package Compare versions

Comparing version 1.1.5 to 1.1.6

coverage/tmp/coverage-3583-1597877910293-0.json

6

index.js

@@ -13,3 +13,3 @@ import cbor from 'borc'

function tagCID (cid) {
const buffer = Uint8Array.from([...bytes.fromHex('00'), ...cid.buffer])
const buffer = Uint8Array.from([...bytes.fromHex('00'), ...cid.bytes])
return new cbor.Tagged(CID_CBOR_TAG, buffer)

@@ -66,5 +66,5 @@ }

// CIDv0
return new CID(0, 0x70, val)
return CID.create(0, 0x70, val)
}
return new CID(val)
return CID.from(val)
}

@@ -71,0 +71,0 @@ }

{
"name": "@ipld/dag-cbor",
"version": "1.1.5",
"version": "1.1.6",
"description": "JS implementation of dag-cbor",
"main": "src/index.js",
"type": "module",
"scripts": {
"build": "rollup --config rollup.config.js",
"prepublishOnly": "npm run build",
"lint": "standard",
"test:cjs": "npm run build && mocha dist/test/test-*.cjs",
"build": "npm_config_yes=true npx ipjs@latest build --tests",
"publish": "npm_config_yes=true npx ipjs@latest publish",
"test:cjs": "npm run build && mocha dist/cjs/node-test/test-*.js",
"test:node": "hundreds mocha test/test-*.js",
"test:browser": "polendina --cleanup test/test-*.js",
"test": "npm run lint && npm run test:node && npm run test:browser && npm run test:cjs",
"test:browser": "polendina --cleanup dist/cjs/node-test/test-*.js",
"test": "npm run lint && npm run test:node && npm run test:cjs && npm run test:browser",
"coverage": "c8 --reporter=html mocha test/test-*.js && npx st -d coverage -p 8080"
},
"exports": {
"require": "./dist/index.cjs",
"import": "./index.js"

@@ -39,8 +37,6 @@ },

"garbage": "0.0.0",
"globby": "^11.0.1",
"hundreds": "0.0.7",
"mocha": "^8.0.1",
"multiformats": "2.0.1",
"polendina": "^1.0.0",
"rollup": "^2.22.1",
"hundreds": "0.0.8",
"mocha": "^8.1.1",
"multiformats": "3.0.0",
"polendina": "^1.1.0",
"standard": "^14.3.4"

@@ -47,0 +43,0 @@ },

@@ -6,4 +6,4 @@ /* eslint-env mocha */

import dagCBOR from '../index.js'
import multiformats from 'multiformats/basics.js'
import base58 from 'multiformats/bases/base58.js'
import multiformats from 'multiformats/basics'
import base58 from 'multiformats/bases/base58'

@@ -23,10 +23,10 @@ const { CID, multicodec, multibase, bytes } = multiformats

someKey: 'someValue',
link: new CID('QmRgutAxd8t7oGkSm4wmeuByG6M51wcTso6cubDdQtuEfL'),
link: CID.from('QmRgutAxd8t7oGkSm4wmeuByG6M51wcTso6cubDdQtuEfL'),
links: [
new CID('QmRgutAxd8t7oGkSm4wmeuByG6M51wcTso6cubDdQtuEfL'),
new CID('QmRgutAxd8t7oGkSm4wmeuByG6M51wcTso6cubDdQtuEfL')
CID.from('QmRgutAxd8t7oGkSm4wmeuByG6M51wcTso6cubDdQtuEfL'),
CID.from('QmRgutAxd8t7oGkSm4wmeuByG6M51wcTso6cubDdQtuEfL')
],
nested: {
hello: 'world',
link: new CID('QmRgutAxd8t7oGkSm4wmeuByG6M51wcTso6cubDdQtuEfL')
link: CID.from('QmRgutAxd8t7oGkSm4wmeuByG6M51wcTso6cubDdQtuEfL')
},

@@ -100,4 +100,4 @@ bytes: Buffer.from('asdf')

// backing buffer must be pristine as some comparison libraries go that deep
const actual = new Uint8Array(deserializedObj.link.buffer.buffer).join(',')
const expected = obj.link.buffer.join(',')
const actual = new Uint8Array(deserializedObj.link.bytes.buffer).join(',')
const expected = obj.link.bytes.join(',')
same(actual, expected)

@@ -122,3 +122,3 @@ })

test('CIDv1', () => {
const cid = new CID('zdj7Wd8AMwqnhJGQCbFxBVodGSBG84TM7Hs1rcJuQMwTyfEDS')
const cid = CID.from('zdj7Wd8AMwqnhJGQCbFxBVodGSBG84TM7Hs1rcJuQMwTyfEDS')
const encoded = encode({ link: cid })

@@ -125,0 +125,0 @@ const decoded = decode(encoded)

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