MCPcopy Create free account
hub / github.com/TanStack/ai / valueToList

Function valueToList

examples/ts-react-native-chat/src/App.tsx:152–161  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

150}
151
152function valueToList(value: unknown): Array<string> {
153 if (Array.isArray(value)) {
154 return value
155 .map((item) => itemToString(item))
156 .filter((item): item is string => Boolean(item))
157 }
158
159 const item = itemToString(value)
160 return item ? [item] : []
161}
162
163function dedupeLabels(labels: Array<string>): Array<string> {
164 const seen = new Set<string>()

Callers 1

RecipeHeroFunction · 0.85

Calls 1

itemToStringFunction · 0.85

Tested by

no test coverage detected