@ipld/dag-cbor
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -126,4 +126,9 @@ import cbor from 'borc' | ||
const deserialized = decoder.decodeFirst(data) | ||
return deserialized | ||
// borc will decode back-to-back objects into an implicit top-level array, we | ||
// strictly want to only see a single explicit top-level object | ||
const all = decoder.decodeAll(data) | ||
if (all.length !== 1) { | ||
throw new Error('Extraneous CBOR data found beyond initial top-level object') | ||
} | ||
return all[0] | ||
} | ||
@@ -130,0 +135,0 @@ |
{ | ||
"name": "@ipld/dag-cbor", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "JS implementation of dag-cbor", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18322
117