MCPcopy Create free account
hub / github.com/Devographics/Monorepo / parseValue

Function parseValue

api/src/graphql/string_or_array.ts:18–28  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

16 throw new TypeError('Value must be a string, a float, or an array of strings and/or floats')
17 },
18 parseValue(value: unknown): string | number | (string | number)[] {
19 if (
20 typeof value === 'string' ||
21 typeof value === 'number' ||
22 (Array.isArray(value) &&
23 value.every(item => typeof item === 'string' || typeof item === 'number'))
24 ) {
25 return value
26 }
27 throw new TypeError('Value must be a string, a float, or an array of strings and/or floats')
28 },
29 parseLiteral(ast: ValueNode): string | number | (string | number)[] {
30 if (ast.kind === Kind.STRING) {
31 return ast.value

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected