Skip to content

Commit 6b816cc

Browse files
authored
fix: remove instanceof (#11)
`instanceOf` is unreliable with esm/cjs dual publised modules.
1 parent d2893c8 commit 6b816cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { BaseBlockstore } from 'blockstore-core/base'
1818
function cidToKey (cid) {
1919
const c = CID.asCID(cid)
2020

21-
if (!(c instanceof CID)) {
21+
if (!c) {
2222
throw errcode(new Error('Not a valid cid'), 'ERR_INVALID_CID')
2323
}
2424

0 commit comments

Comments
 (0)