Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Commit

Permalink
chore: linter
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias authored and achingbrain committed Apr 28, 2020
1 parent ac7235d commit b46f14c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,12 @@ class FsDatastore {
*/
query (q) {
// glob expects a POSIX path
let prefix = q.prefix || '**'
let pattern = path
const prefix = q.prefix || '**'
const pattern = path
.join(this.path, prefix, '*' + this.opts.extension)
.split(path.sep)
.join('/')
let files = glob.sync(pattern)
const files = glob.sync(pattern)
let it
if (!q.keysOnly) {
it = map(files, async (f) => {
Expand Down
8 changes: 4 additions & 4 deletions test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('FsDatastore', () => {

it('query', async () => {
const fs = new FsStore(path.join(__dirname, 'test-repo', 'blocks'))
let res = []
const res = []
for await (const q of fs.query({})) {
res.push(q)
}
Expand All @@ -138,9 +138,9 @@ describe('FsDatastore', () => {
const key = new Key('CIQGFTQ7FSI2COUXWWLOQ45VUM2GUZCGAXLWCTOKKPGTUWPXHBNIVOY')
const expected = fs.readFileSync(path.join(repodir, 'VO', key.toString() + '.data'))
const flatfs = await ShardingStore.open(fstore)
let res = await flatfs.get(key)
let queryResult = flatfs.query({})
let results = []
const res = await flatfs.get(key)
const queryResult = flatfs.query({})
const results = []
for await (const result of queryResult) results.push(result)
expect(results).to.have.length(23)
expect(res).to.be.eql(expected)
Expand Down

0 comments on commit b46f14c

Please sign in to comment.