(query)
| 7 | let searchIndexPromise = undefined |
| 8 | |
| 9 | export const searchPages = (query) => { |
| 10 | if (!searchIndexPromise) { |
| 11 | searchIndexPromise = Promise.all([ |
| 12 | import('../searchIndex'), |
| 13 | import('flexsearch'), |
| 14 | ]).then(([{ indexData, documents }, { default: FlexSearch }]) => { |
| 15 | searchDocuments = documents |
| 16 | const search = new FlexSearch() |
| 17 | search.import(indexData) |
| 18 | return search |
| 19 | }) |
| 20 | } |
| 21 | |
| 22 | return searchIndexPromise.then((searchIndex) => |
| 23 | Guidebook.searchPages(guidebook, searchIndex, searchDocuments, query) |
| 24 | ) |
| 25 | } |
| 26 | |
| 27 | export const searchTextMatch = (id, query) => |
| 28 | Guidebook.searchTextMatch(guidebook, searchDocuments, id, query) |
nothing calls this directly
no outgoing calls
no test coverage detected