Skip to content

fix: backport remove instanceof #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}

Expand Down
26 changes: 26 additions & 0 deletions types/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* @typedef {import('interface-blockstore').Query} Query
* @typedef {import('interface-blockstore').KeyQuery} KeyQuery
* @typedef {import('interface-blockstore').Pair} Pair
* @typedef {import('interface-blockstore').Options} Options
* @typedef {import('interface-datastore').Datastore} Datastore
* @typedef {import('interface-blockstore').Blockstore} Blockstore
*/
/**
* @implements {Blockstore}
*/
export class BlockstoreDatastoreAdapter extends BaseBlockstore implements Blockstore {
/**
* @param {Datastore} datastore
*/
constructor(datastore: Datastore);
child: import("interface-datastore").Datastore;
}
export type Query = import('interface-blockstore').Query;
export type KeyQuery = import('interface-blockstore').KeyQuery;
export type Pair = import('interface-blockstore').Pair;
export type Options = import('interface-blockstore').Options;
export type Datastore = import('interface-datastore').Datastore;
export type Blockstore = import('interface-blockstore').Blockstore;
import { BaseBlockstore } from "blockstore-core/base";
//# sourceMappingURL=index.d.ts.map
1 change: 1 addition & 0 deletions types/src/index.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading