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

Function getDataSearchText

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

Source from the content-addressed store, hash-verified

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