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

Function primitiveText

packages/query-devtools/src/explorerSearch.ts:37–50  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

35 * @returns Primitive text, or undefined for objects and functions.
36 */
37export function primitiveText(value: unknown): string | undefined {
38 if (value === null) return 'null'
39 switch (typeof value) {
40 case 'string':
41 case 'number':
42 case 'boolean':
43 case 'bigint':
44 case 'symbol':
45 case 'undefined':
46 return String(value)
47 default:
48 return undefined
49 }
50}
51
52/**
53 * Reads finite entries through native collection methods and own descriptors.

Callers 5

ExplorerFunction · 0.90
valueTextFunction · 0.90
searchEntriesFunction · 0.85
createSearchTextFunction · 0.85
visitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected