@ipld/dag-cbor
Advanced tools
Comparing version 6.0.14 to 6.0.15
'use strict'; | ||
var buffer = require('buffer'); | ||
var ipldGarbage = require('ipld-garbage'); | ||
@@ -12,3 +13,2 @@ var chai = require('chai'); | ||
'use strict'; | ||
const {encode, decode} = index; | ||
@@ -183,5 +183,5 @@ const {assert} = chai__default["default"]; | ||
test('encode and decode consistency with Uint8Array and Buffer fields', () => { | ||
const buffer = Buffer.from('some data'); | ||
const bytes = Uint8Array.from(buffer); | ||
const s1 = encode({ data: buffer }); | ||
const buffer$1 = buffer.Buffer.from('some data'); | ||
const bytes = Uint8Array.from(buffer$1); | ||
const s1 = encode({ data: buffer$1 }); | ||
const s2 = encode({ data: bytes }); | ||
@@ -200,6 +200,5 @@ same(s1, s2); | ||
assert.throws(() => { | ||
decode(Buffer.concat([ | ||
Buffer.from(serializedObj), | ||
Buffer.alloc(1) | ||
])); | ||
const big = new Uint8Array(serializedObj.length + 1); | ||
big.set(serializedObj, 0); | ||
decode(big); | ||
}, /too many terminals/); | ||
@@ -206,0 +205,0 @@ }); |
'use strict'; | ||
var buffer = require('buffer'); | ||
var ipldGarbage = require('ipld-garbage'); | ||
@@ -12,3 +13,2 @@ var chai = require('chai'); | ||
'use strict'; | ||
const {encode, decode} = index; | ||
@@ -183,5 +183,5 @@ const {assert} = chai__default["default"]; | ||
test('encode and decode consistency with Uint8Array and Buffer fields', () => { | ||
const buffer = Buffer.from('some data'); | ||
const bytes = Uint8Array.from(buffer); | ||
const s1 = encode({ data: buffer }); | ||
const buffer$1 = buffer.Buffer.from('some data'); | ||
const bytes = Uint8Array.from(buffer$1); | ||
const s1 = encode({ data: buffer$1 }); | ||
const s2 = encode({ data: bytes }); | ||
@@ -200,6 +200,5 @@ same(s1, s2); | ||
assert.throws(() => { | ||
decode(Buffer.concat([ | ||
Buffer.from(serializedObj), | ||
Buffer.alloc(1) | ||
])); | ||
const big = new Uint8Array(serializedObj.length + 1); | ||
big.set(serializedObj, 0); | ||
decode(big); | ||
}, /too many terminals/); | ||
@@ -206,0 +205,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
import { Buffer } from 'buffer'; | ||
import { garbage } from 'ipld-garbage'; | ||
@@ -194,6 +194,5 @@ import chai from 'chai'; | ||
assert.throws(() => { | ||
decode(Buffer.concat([ | ||
Buffer.from(serializedObj), | ||
Buffer.alloc(1) | ||
])); | ||
const big = new Uint8Array(serializedObj.length + 1); | ||
big.set(serializedObj, 0); | ||
decode(big); | ||
}, /too many terminals/); | ||
@@ -200,0 +199,0 @@ }); |
@@ -1,2 +0,2 @@ | ||
'use strict'; | ||
import { Buffer } from 'buffer'; | ||
import { garbage } from 'ipld-garbage'; | ||
@@ -194,6 +194,5 @@ import chai from 'chai'; | ||
assert.throws(() => { | ||
decode(Buffer.concat([ | ||
Buffer.from(serializedObj), | ||
Buffer.alloc(1) | ||
])); | ||
const big = new Uint8Array(serializedObj.length + 1); | ||
big.set(serializedObj, 0); | ||
decode(big); | ||
}, /too many terminals/); | ||
@@ -200,0 +199,0 @@ }); |
153
package.json
{ | ||
"name": "@ipld/dag-cbor", | ||
"version": "6.0.14", | ||
"version": "6.0.15", | ||
"description": "JS implementation of DAG-CBOR", | ||
@@ -13,10 +13,19 @@ "main": "./cjs/index.js", | ||
"build:types": "npm run build:copy && cd dist && tsc --build", | ||
"publish": "ipjs publish", | ||
"test:cjs": "npm run build:js && mocha dist/cjs/node-test/test-*.js && npm run test:cjs:browser", | ||
"test:node": "hundreds mocha test/test-*.js", | ||
"test:cjs:browser": "polendina --page --worker --serviceworker --cleanup dist/cjs/node-test/test-*.js", | ||
"test:esm": "npm run build:js && mocha dist/esm/node-test/test-*.js && npm run test:esm:browser", | ||
"test:node": "c8 --check-coverage --branches 100 --functions 100 --lines 100 mocha test/test-*.js", | ||
"test:cjs:browser": "polendina --page --worker --serviceworker --cleanup dist/cjs/browser-test/test-*.js", | ||
"test:esm:browser": "polendina --page --worker --serviceworker --cleanup dist/esm/browser-test/test-*.js", | ||
"test:ts": "npm run build:types && npm run test --prefix test/ts-use", | ||
"test": "npm run lint && npm run test:node && npm run test:cjs && npm run test:ts", | ||
"test": "npm run lint && npm run test:node && npm run test:esm && npm run test:ts", | ||
"test:ci": "npm run lint && npm run test:node && npm run test:esm && npm run test:cjs && npm run test:ts", | ||
"coverage": "c8 --reporter=html mocha test/test-*.js && npm_config_yes=true npx st -d coverage -p 8080" | ||
}, | ||
"keywords": [ | ||
"ipfs", | ||
"ipld", | ||
"multiformats" | ||
], | ||
"author": "Rod <rod@vagg.org> (http://r.va.gg/)", | ||
"license": "(Apache-2.0 AND MIT)", | ||
"exports": { | ||
@@ -27,32 +36,33 @@ "browser": "./esm/index.js", | ||
}, | ||
"license": "(Apache-2.0 AND MIT)", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ipld/js-dag-cbor.git" | ||
}, | ||
"keywords": [ | ||
"IPFS", | ||
"IPLD" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/ipld/js-dag-cbor/issues" | ||
}, | ||
"homepage": "https://github.com/ipld/js-dag-cbor", | ||
"dependencies": { | ||
"cborg": "^1.2.1", | ||
"multiformats": "^9.0.0" | ||
"cborg": "^1.5.4", | ||
"multiformats": "^9.5.4" | ||
}, | ||
"devDependencies": { | ||
"buffer": "^6.0.3", | ||
"c8": "^7.10.0", | ||
"chai": "^4.3.4", | ||
"hundreds": "^0.0.9", | ||
"ipjs": "^5.0.0", | ||
"ipld-garbage": "^4.0.1", | ||
"mocha": "^9.0.0", | ||
"polendina": "^1.1.0", | ||
"standard": "^16.0.3", | ||
"typescript": "^4.2.4" | ||
"ipjs": "^5.2.0", | ||
"ipld-garbage": "^4.0.10", | ||
"mocha": "^9.1.3", | ||
"polendina": "~2.0.1", | ||
"standard": "^16.0.4", | ||
"typescript": "~4.5.2" | ||
}, | ||
"standard": { | ||
"ignore": [ | ||
"dist" | ||
] | ||
}, | ||
"directories": { | ||
"test": "test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/ipld/js-dag-cbor.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/ipld/js-dag-cbor/issues" | ||
}, | ||
"homepage": "https://github.com/ipld/js-dag-cbor#readme", | ||
"typesVersions": { | ||
@@ -68,4 +78,89 @@ "*": { | ||
}, | ||
"author": "Mikeal Rogers <mikeal.rogers@gmail.com> (https://www.mikealrogers.com/)", | ||
"release": { | ||
"branches": [ | ||
"master" | ||
], | ||
"plugins": [ | ||
[ | ||
"@semantic-release/commit-analyzer", | ||
{ | ||
"preset": "conventionalcommits", | ||
"releaseRules": [ | ||
{ | ||
"breaking": true, | ||
"release": "major" | ||
}, | ||
{ | ||
"revert": true, | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "feat", | ||
"release": "minor" | ||
}, | ||
{ | ||
"type": "fix", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "chore", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "docs", | ||
"release": "patch" | ||
}, | ||
{ | ||
"type": "test", | ||
"release": "patch" | ||
}, | ||
{ | ||
"scope": "no-release", | ||
"release": false | ||
} | ||
] | ||
} | ||
], | ||
[ | ||
"@semantic-release/release-notes-generator", | ||
{ | ||
"preset": "conventionalcommits", | ||
"presetConfig": { | ||
"types": [ | ||
{ | ||
"type": "feat", | ||
"section": "Features" | ||
}, | ||
{ | ||
"type": "fix", | ||
"section": "Bug Fixes" | ||
}, | ||
{ | ||
"type": "chore", | ||
"section": "Trivial Changes" | ||
}, | ||
{ | ||
"type": "docs", | ||
"section": "Trivial Changes" | ||
}, | ||
{ | ||
"type": "test", | ||
"section": "Tests" | ||
} | ||
] | ||
} | ||
} | ||
], | ||
"@semantic-release/changelog", | ||
[ | ||
"@semantic-release/npm", | ||
{ | ||
"pkgRoot": "dist" | ||
} | ||
], | ||
"@semantic-release/github", | ||
"@semantic-release/git" | ||
] | ||
}, | ||
"browser": "./cjs/index.js" | ||
} | ||
} |
/* eslint-env mocha */ | ||
'use strict' | ||
import { Buffer } from 'buffer' | ||
import { garbage } from 'ipld-garbage' | ||
@@ -162,3 +163,5 @@ import chai from 'chai' | ||
// CBOR in streaming mode, not valid here | ||
decode(Buffer.concat([Buffer.from(serializedObj), Buffer.alloc(1)])) | ||
const big = new Uint8Array(serializedObj.length + 1) | ||
big.set(serializedObj, 0) | ||
decode(big) | ||
}, /too many terminals/) | ||
@@ -165,0 +168,0 @@ }) |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
47710
9
1248
1
Updatedcborg@^1.5.4
Updatedmultiformats@^9.5.4