multiformats
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -67,2 +67,3 @@ 'use strict' | ||
;[code, cid] = parse(cid) | ||
if (code > 1) throw new Error(`Invalid CID version ${code}`) | ||
readonly(this, 'version', code) | ||
@@ -69,0 +70,0 @@ ;[code, cid] = parse(cid) |
{ | ||
"name": "multiformats", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Interface for multihash, multicodec, multibase and CID.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,3 +29,3 @@ /* globals before, describe, it */ | ||
describe('CID', () => { | ||
const { CID, multihash, multibase } = require('../basics') | ||
const { CID, multihash, multibase, varint } = require('../basics') | ||
multibase.add(require('../bases/base58')) | ||
@@ -364,2 +364,7 @@ multibase.add(require('../bases/base32')) | ||
}) | ||
test('invalid CID version', async () => { | ||
const encoded = varint.encode(18) | ||
await testThrow(() => new CID(encoded), 'Invalid CID version 18') | ||
}) | ||
}) |
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
56622
1495