Skip to content

Commit fd8965b

Browse files
committed
Better naming of variable
1 parent 7f24aaf commit fd8965b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/MiniSearch.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,7 +1326,7 @@ export default class MiniSearch<T = any> {
13261326
*/
13271327
search (query: Query, searchOptions: SearchOptions = {}): SearchResult[] {
13281328
const { searchOptions: globalSearchOptions } = this._options
1329-
const options = { ...globalSearchOptions, ...searchOptions }
1329+
const searchOptionsWithDefaults: SearchOptionsWithDefaults = { ...globalSearchOptions, ...searchOptions }
13301330

13311331
const rawResults = this.executeQuery(query, searchOptions)
13321332
const results = []
@@ -1347,15 +1347,14 @@ export default class MiniSearch<T = any> {
13471347
}
13481348

13491349
Object.assign(result, this._storedFields.get(docId))
1350-
if (options.filter == null || options.filter(result)) {
1350+
if (searchOptionsWithDefaults.filter == null || searchOptionsWithDefaults.filter(result)) {
13511351
results.push(result)
13521352
}
13531353
}
13541354

13551355
// If it's a wildcard query, and no document boost is applied, skip sorting
13561356
// the results, as all results have the same score of 1
1357-
if (query === MiniSearch.wildcard &&
1358-
options.boostDocument == null) {
1357+
if (query === MiniSearch.wildcard && searchOptionsWithDefaults.boostDocument == null) {
13591358
return results
13601359
}
13611360

0 commit comments

Comments
 (0)