Skip to content

Commit

Permalink
Use Nullish Coalescing Operator with Fastsearch (adityatelange#1033)
Browse files Browse the repository at this point in the history
  • Loading branch information
bentonw414 authored Sep 2, 2022
1 parent ca4e7e0 commit 32f9d01
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions assets/js/fastsearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ window.onload = function () {
};
if (params.fuseOpts) {
options = {
isCaseSensitive: params.fuseOpts.iscasesensitive ? params.fuseOpts.iscasesensitive : false,
includeScore: params.fuseOpts.includescore ? params.fuseOpts.includescore : false,
includeMatches: params.fuseOpts.includematches ? params.fuseOpts.includematches : false,
minMatchCharLength: params.fuseOpts.minmatchcharlength ? params.fuseOpts.minmatchcharlength : 1,
shouldSort: params.fuseOpts.shouldsort ? params.fuseOpts.shouldsort : true,
findAllMatches: params.fuseOpts.findallmatches ? params.fuseOpts.findallmatches : false,
keys: params.fuseOpts.keys ? params.fuseOpts.keys : ['title', 'permalink', 'summary', 'content'],
location: params.fuseOpts.location ? params.fuseOpts.location : 0,
threshold: params.fuseOpts.threshold ? params.fuseOpts.threshold : 0.4,
distance: params.fuseOpts.distance ? params.fuseOpts.distance : 100,
ignoreLocation: params.fuseOpts.ignorelocation ? params.fuseOpts.ignorelocation : true
isCaseSensitive: params.fuseOpts.iscasesensitive ?? false,
includeScore: params.fuseOpts.includescore ?? false,
includeMatches: params.fuseOpts.includematches ?? false,
minMatchCharLength: params.fuseOpts.minmatchcharlength ?? 1,
shouldSort: params.fuseOpts.shouldsort ?? true,
findAllMatches: params.fuseOpts.findallmatches ?? false,
keys: params.fuseOpts.keys ?? ['title', 'permalink', 'summary', 'content'],
location: params.fuseOpts.location ?? 0,
threshold: params.fuseOpts.threshold ?? 0.4,
distance: params.fuseOpts.distance ?? 100,
ignoreLocation: params.fuseOpts.ignorelocation ?? true
}
}
fuse = new Fuse(data, options); // build the index from the json file
Expand Down

0 comments on commit 32f9d01

Please sign in to comment.