Skip to content
This repository was archived by the owner on Sep 30, 2023. It is now read-only.

Commit ed8bd99

Browse files
authored
Merge pull request #33 from orbitdb/feat/options
Feat/options
2 parents 6d8b5f8 + 5725479 commit ed8bd99

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"author": "shamb0t",
1515
"license": "MIT",
1616
"dependencies": {
17-
"orbit-db-store": "~2.7.0",
17+
"orbit-db-store": "~3.0.0",
1818
"p-map": "~1.1.1"
1919
},
2020
"devDependencies": {},

src/DocumentStore.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DocumentStore extends Store {
2929
}
3030
const mapper = e => this._index.get(e)
3131
const filter = e => caseSensitive
32-
? e.indexOf(key) !== -1
32+
? e.indexOf(key) !== -1
3333
: search(e)
3434

3535
return Object.keys(this._index._index)
@@ -64,27 +64,27 @@ class DocumentStore extends Store {
6464
.then(() => this.saveSnapshot())
6565
}
6666

67-
put (doc) {
67+
put (doc, options = {}) {
6868
if (!doc[this.options.indexBy])
6969
throw new Error(`The provided document doesn't contain field '${this.options.indexBy}'`)
7070

7171
return this._addOperation({
7272
op: 'PUT',
7373
key: doc[this.options.indexBy],
7474
value: doc
75-
})
75+
}, options)
7676
}
7777

78-
del (key) {
78+
del (key, options = {}) {
7979
if (!this._index.get(key))
8080
throw new Error(`No entry with key '${key}' in the database`)
8181

8282
return this._addOperation({
8383
op: 'DEL',
8484
key: key,
8585
value: null
86-
})
86+
}, options)
8787
}
8888
}
8989

90-
module.exports = DocumentStore
90+
module.exports = DocumentStore

0 commit comments

Comments
 (0)