New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@ipld/dag-cbor

Package Overview
Dependencies
Maintainers
4
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 6.0.15 to 7.0.0

15

cjs/browser-test/test-basics.js

@@ -74,6 +74,2 @@ 'use strict';

});
test('error on decoding undefined', () => {
assert.throws(() => decode(multiformats.bytes.fromHex('f7')), /\Wundefined\W.*not supported/);
assert.throws(() => decode(multiformats.bytes.fromHex('a2616161616162f7')), /\Wundefined\W.*not supported/);
});
test('error on encoding IEEE 754 specials', () => {

@@ -208,2 +204,13 @@ for (const special of [

});
test('sloppy decode: coerce undefined', () => {
let encoded = multiformats.bytes.fromHex('f7');
let decoded = decode(encoded);
same(null, decoded);
encoded = multiformats.bytes.fromHex('a26362617af763666f6f63626172');
decoded = decode(encoded);
same({
foo: 'bar',
baz: null
}, decoded);
});
});

@@ -72,3 +72,3 @@ 'use strict';

allowIndefinite: false,
allowUndefined: false,
coerceUndefinedToNull: true,
allowNaN: false,

@@ -75,0 +75,0 @@ allowInfinity: false,

@@ -74,6 +74,2 @@ 'use strict';

});
test('error on decoding undefined', () => {
assert.throws(() => decode(multiformats.bytes.fromHex('f7')), /\Wundefined\W.*not supported/);
assert.throws(() => decode(multiformats.bytes.fromHex('a2616161616162f7')), /\Wundefined\W.*not supported/);
});
test('error on encoding IEEE 754 specials', () => {

@@ -208,2 +204,13 @@ for (const special of [

});
test('sloppy decode: coerce undefined', () => {
let encoded = multiformats.bytes.fromHex('f7');
let decoded = decode(encoded);
same(null, decoded);
encoded = multiformats.bytes.fromHex('a26362617af763666f6f63626172');
decoded = decode(encoded);
same({
foo: 'bar',
baz: null
}, decoded);
});
});

@@ -70,6 +70,2 @@ import { Buffer } from 'buffer';

});
test('error on decoding undefined', () => {
assert.throws(() => decode(bytes.fromHex('f7')), /\Wundefined\W.*not supported/);
assert.throws(() => decode(bytes.fromHex('a2616161616162f7')), /\Wundefined\W.*not supported/);
});
test('error on encoding IEEE 754 specials', () => {

@@ -204,2 +200,13 @@ for (const special of [

});
test('sloppy decode: coerce undefined', () => {
let encoded = bytes.fromHex('f7');
let decoded = decode(encoded);
same(null, decoded);
encoded = bytes.fromHex('a26362617af763666f6f63626172');
decoded = decode(encoded);
same({
foo: 'bar',
baz: null
}, decoded);
});
});

@@ -47,3 +47,3 @@ import * as cborg from 'cborg';

allowIndefinite: false,
allowUndefined: false,
coerceUndefinedToNull: true,
allowNaN: false,

@@ -50,0 +50,0 @@ allowInfinity: false,

@@ -70,6 +70,2 @@ import { Buffer } from 'buffer';

});
test('error on decoding undefined', () => {
assert.throws(() => decode(bytes.fromHex('f7')), /\Wundefined\W.*not supported/);
assert.throws(() => decode(bytes.fromHex('a2616161616162f7')), /\Wundefined\W.*not supported/);
});
test('error on encoding IEEE 754 specials', () => {

@@ -204,2 +200,13 @@ for (const special of [

});
test('sloppy decode: coerce undefined', () => {
let encoded = bytes.fromHex('f7');
let decoded = decode(encoded);
same(null, decoded);
encoded = bytes.fromHex('a26362617af763666f6f63626172');
decoded = decode(encoded);
same({
foo: 'bar',
baz: null
}, decoded);
});
});

@@ -88,3 +88,3 @@ import * as cborg from 'cborg'

allowIndefinite: false,
allowUndefined: false,
coerceUndefinedToNull: true,
allowNaN: false,

@@ -91,0 +91,0 @@ allowInfinity: false,

{
"name": "@ipld/dag-cbor",
"version": "6.0.15",
"version": "7.0.0",
"description": "JS implementation of DAG-CBOR",

@@ -36,3 +36,3 @@ "main": "./cjs/index.js",

"dependencies": {
"cborg": "^1.5.4",
"cborg": "^1.6.0",
"multiformats": "^9.5.4"

@@ -39,0 +39,0 @@ },

@@ -83,8 +83,2 @@ /* eslint-env mocha */

test('error on decoding undefined', () => {
// encoded forms from the encode() test above
assert.throws(() => decode(bytes.fromHex('f7')), /\Wundefined\W.*not supported/)
assert.throws(() => decode(bytes.fromHex('a2616161616162f7')), /\Wundefined\W.*not supported/)
})
test('error on encoding IEEE 754 specials', () => {

@@ -176,2 +170,13 @@ for (const special of [NaN, Infinity, -Infinity]) {

})
test('sloppy decode: coerce undefined', () => {
// See https://github.com/ipld/js-dag-cbor/issues/44 for context on this
let encoded = bytes.fromHex('f7')
let decoded = decode(encoded)
same(null, decoded)
encoded = bytes.fromHex('a26362617af763666f6f63626172')
decoded = decode(encoded)
same({ foo: 'bar', baz: null }, decoded)
})
})
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