Skip to content

Commit

Permalink
fix: remove instanceof (#11)
Browse files Browse the repository at this point in the history
`instanceOf` is unreliable with esm/cjs dual publised modules.
  • Loading branch information
achingbrain authored Sep 17, 2021
1 parent d2893c8 commit 6b816cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { BaseBlockstore } from 'blockstore-core/base'
function cidToKey (cid) {
const c = CID.asCID(cid)

if (!(c instanceof CID)) {
if (!c) {
throw errcode(new Error('Not a valid cid'), 'ERR_INVALID_CID')
}

Expand Down

0 comments on commit 6b816cc

Please sign in to comment.