Skip to content

Commit 722f53b

Browse files
committed
fix: backport remove instanceof
Backports #11 to the v1.x.x release line
1 parent b442488 commit 722f53b

File tree

5 files changed

+30
-1
lines changed

5 files changed

+30
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const { BlockstoreAdapter } = require('interface-blockstore')
2020
function cidToKey (cid) {
2121
const c = CID.asCID(cid)
2222

23-
if (!(c instanceof CID)) {
23+
if (!c) {
2424
throw errcode(new Error('Not a valid cid'), 'ERR_INVALID_CID')
2525
}
2626

types/src/index.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* @typedef {import('interface-blockstore').Query} Query
3+
* @typedef {import('interface-blockstore').KeyQuery} KeyQuery
4+
* @typedef {import('interface-blockstore').Pair} Pair
5+
* @typedef {import('interface-blockstore').Options} Options
6+
* @typedef {import('interface-datastore').Datastore} Datastore
7+
* @typedef {import('interface-blockstore').Blockstore} Blockstore
8+
*/
9+
/**
10+
* @implements {Blockstore}
11+
*/
12+
export class BlockstoreDatastoreAdapter extends BaseBlockstore implements Blockstore {
13+
/**
14+
* @param {Datastore} datastore
15+
*/
16+
constructor(datastore: Datastore);
17+
child: import("interface-datastore").Datastore;
18+
}
19+
export type Query = import('interface-blockstore').Query;
20+
export type KeyQuery = import('interface-blockstore').KeyQuery;
21+
export type Pair = import('interface-blockstore').Pair;
22+
export type Options = import('interface-blockstore').Options;
23+
export type Datastore = import('interface-datastore').Datastore;
24+
export type Blockstore = import('interface-blockstore').Blockstore;
25+
import { BaseBlockstore } from "blockstore-core/base";
26+
//# sourceMappingURL=index.d.ts.map

types/src/index.d.ts.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)