From cfeec8ca5044a69e09b72ad4444471f6f1efa70d Mon Sep 17 00:00:00 2001 From: achingbrain Date: Fri, 17 Sep 2021 11:20:16 +0200 Subject: [PATCH] fix: backport remove instanceof Backports https://github.com/ipfs/js-blockstore-datastore-adapter/pull/11 to the v1.x.x release line --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index e90fd80..0d86f67 100644 --- a/src/index.js +++ b/src/index.js @@ -20,7 +20,7 @@ const { BlockstoreAdapter } = require('interface-blockstore') 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') }