MCPcopy Create free account
hub / github.com/TanStack/query / getDataSearchText

Function getDataSearchText

packages/query-devtools/src/Devtools.tsx:122–130  ·  view source on GitHub ↗
(data: unknown, deadline = Infinity)

Source from the content-addressed store, hash-verified

120 * @returns The search text, or undefined if it isn't built and the deadline has passed.
121 */
122const getDataSearchText = (data: unknown, deadline = Infinity) => {
123 if (typeof data !== 'object' || data === null) return createSearchText(data)
124 let text = dataSearchTexts.get(data)
125 if (text === undefined && performance.now() < deadline) {
126 text = createSearchText(data)
127 dataSearchTexts.set(data, text)
128 }
129 return text
130}
131
132/**
133 * Checks whether data contains the term. Missing data never matches.

Callers 2

matchesDataFunction · 0.85
prepareFunction · 0.85

Calls 2

createSearchTextFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected