MCPcopy Create free account
hub / github.com/dabbott/react-native-express / searchPages

Function searchPages

utils/search.js:9–25  ·  view source on GitHub ↗
(query)

Source from the content-addressed store, hash-verified

7let searchIndexPromise = undefined
8
9export 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
27export const searchTextMatch = (id, query) =>
28 Guidebook.searchTextMatch(guidebook, searchDocuments, id, query)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected