Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
},
"homepage": "https://github.com/ipfs/js-datastore-level#readme",
"dependencies": {
"datastore-core": "^1.0.0",
"interface-datastore": "^0.8.0",
"datastore-core": "^1.1.0",
"interface-datastore": "^1.0.2",
"level": "^5.0.1"
},
"devDependencies": {
"aegir": "^21.9.0",
"aegir": "^22.0.0",
"chai": "^4.2.0",
"cids": "^0.8.0",
"dirty-chai": "^2.0.1",
Expand Down
16 changes: 11 additions & 5 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
'use strict'

const { Key, Errors, utils } = require('interface-datastore')
const { filter, map, take, sortAll } = utils
const {
Key, Errors, Adapter,
utils: {
filter, map, take, sortAll
}
} = require('interface-datastore')

/**
* A datastore backed by leveldb.
*/
class LevelDatastore {
class LevelDatastore extends Adapter {
constructor (path, opts) {
super()

let database

if (opts && opts.db) {
Expand Down Expand Up @@ -93,8 +99,8 @@ class LevelDatastore {
key: key.toString()
})
},
commit: () => {
return this.db.batch(ops)
commit: (options) => {
return this.db.batch(ops, options)
}
}
}
Expand Down