Skip to content

Commit 722930c

Browse files
authored
chore: fix types (#308)
The types had typos
1 parent 731cba2 commit 722930c

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

src/types.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,12 @@ export interface Stat {
6060
}
6161

6262
export interface Blockstore {
63-
open: () => Promise<Void>
63+
open: () => Promise<void>
6464

6565
/**
6666
* Query the store
6767
*/
68-
query: (Query, options?: DatastoreOptions) => AsyncIterable<Block>
68+
query: (query: Query, options?: DatastoreOptions) => AsyncIterable<Block>
6969

7070
/**
7171
* Query the store, returning only keys
@@ -100,7 +100,7 @@ export interface Blockstore {
100100
/**
101101
* Delete a block from the store
102102
*/
103-
delete: (cid: CID, options?: DatastoreOptions) => Promise<Void>
103+
delete: (cid: CID, options?: DatastoreOptions) => Promise<void>
104104

105105
/**
106106
* Delete a block from the store
@@ -110,7 +110,7 @@ export interface Blockstore {
110110
/**
111111
* Close the store
112112
*/
113-
close: () => Promise<Void>
113+
close: () => Promise<void>
114114
}
115115

116116
export interface Config {

test/blockstore-test.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ module.exports = (repo) => {
6666
it('does not write an identity block', async () => {
6767
const identityBlock = new Block(identityData, identityCID)
6868
await repo.blocks.put(identityBlock)
69-
const cids = await all(repo.blocks.query({
70-
keysOnly: true
71-
}))
69+
const cids = await all(repo.blocks.queryKeys({}))
7270
const rawCID = new CID(1, 'raw', identityCID.multihash)
7371
expect(cids).to.not.deep.include(rawCID)
7472
})
@@ -116,9 +114,7 @@ module.exports = (repo) => {
116114
const blocks = [new Block(d, new CID(1, 'raw', hash)), new Block(identityData, identityCID)]
117115
const put = await all(repo.blocks.putMany(blocks))
118116
expect(put).to.deep.equal(blocks)
119-
const cids = await all(repo.blocks.query({
120-
keysOnly: true
121-
}))
117+
const cids = await all(repo.blocks.queryKeys({}))
122118
expect(cids).to.deep.include(new CID(1, 'raw', hash))
123119
expect(cids).to.not.deep.include(new CID(1, 'raw', identityCID.multihash))
124120
})
@@ -500,9 +496,7 @@ module.exports = (repo) => {
500496
})
501497

502498
it('returns only keys', async () => {
503-
const cids = await all(repo.blocks.query({
504-
keysOnly: true
505-
}))
499+
const cids = await all(repo.blocks.queryKeys({}))
506500

507501
expect(cids.length).to.be.greaterThan(0)
508502

0 commit comments

Comments
 (0)