Skip to content

Commit

Permalink
Merge pull request #584 from mistermoe/handle-deprecation-warning
Browse files Browse the repository at this point in the history
Handle deprecation warning
  • Loading branch information
fergiemcdowall committed Jul 7, 2022
2 parents 7b08390 + 075bbd0 commit 1523a31
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions dist/search-index-3.1.2.js → dist/search-index-3.1.3.js

Large diffs are not rendered by default.

File renamed without changes.

Large diffs are not rendered by default.

File renamed without changes.
4 changes: 2 additions & 2 deletions dist/search-index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "search-index",
"version": "3.1.2",
"version": "3.1.3",
"description": "A network resilient, persistent full-text search library for the browser and Node.js",
"keywords": [
"search",
Expand Down
10 changes: 5 additions & 5 deletions src/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = (ops, cache, queue) => {
)

const _PUT = (docs, putOptions) => {
cache.reset()
cache.clear()

putOptions = Object.assign(ops, putOptions)

Expand All @@ -36,7 +36,7 @@ module.exports = (ops, cache, queue) => {
}

const _PUT_RAW = (docs, ids, dontStoreValue) => {
cache.reset()
cache.clear()
return Promise.all(
docs.map((doc, i) =>
ops.fii.STORE.put(['DOC_RAW', ids[i]], dontStoreValue ? {} : doc)
Expand All @@ -54,7 +54,7 @@ module.exports = (ops, cache, queue) => {

const _DELETE = _ids =>
ops.fii.DELETE(_ids).then(result => {
cache.reset()
cache.clear()
const deleted = result.filter(d => d.status === 'DELETED')
return Promise.all([
Promise.all(deleted.map(r => ops.fii.STORE.del(['DOC_RAW', r._id]))),
Expand All @@ -65,7 +65,7 @@ module.exports = (ops, cache, queue) => {
const _FLUSH = () =>
ops.fii.STORE.clear()
.then(() => {
cache.reset()
cache.clear()
const timestamp = Date.now()
return ops.fii.STORE.batch([
{ type: 'put', key: ['~CREATED'], value: timestamp },
Expand All @@ -80,7 +80,7 @@ module.exports = (ops, cache, queue) => {
FLUSH: _FLUSH,
// TODO: IMPORT needs a test
IMPORT: index => {
cache.reset()
cache.clear()
return Promise.resolve(ops.fii.IMPORT(index))
},
PUT: (docs, pops) => queue.add(() => _PUT(docs, pops)),
Expand Down

0 comments on commit 1523a31

Please sign in to comment.