diff --git a/lib/search.js b/lib/search.js index 278f88f..e94b63c 100644 --- a/lib/search.js +++ b/lib/search.js @@ -47,10 +47,11 @@ export default class Searcher{ async findAllMatches(query, options){ try{ + let optionsValue = structuredClone(options) var startTime = process.hrtime(); - options.fields.push('hidden') + optionsValue.fields.push('hidden') debugPrint(options) - let results = this.miniSearch.search(query, options) + let results = this.miniSearch.search(query, optionsValue) var elapsed = this.parseHrtimeToSeconds(process.hrtime(startTime)); return { items: results,