-
-
Save shreyvijayvargiya/588592cbe88cf1e0d8bd99e7a44896b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const options = { keys: ['title', 'author.firstName'] } | |
// Create the Fuse index | |
const myIndex = Fuse.createIndex(options.keys, books) | |
// initialize Fuse with the index | |
const fuse = new Fuse(books, options, myIndex) | |
// Output | |
const list = [ | |
{ | |
"title": "Old Man's War", | |
"author": { | |
"firstName": "John", | |
"lastName": "Scalzi" | |
} | |
}, | |
{ | |
"title": "The Lock Artist", | |
"author": { | |
"firstName": "Steve", | |
"lastName": "Hamilton" | |
} | |
} | |
/*...*/ | |
] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment