MCPcopy Create free account
hub / github.com/FIND-Lab/AgentWard / parseValue

Function parseValue

core/commands.ts:50–56  ·  view source on GitHub ↗

Parse a raw string value into the appropriate type.

(raw: string)

Source from the content-addressed store, hash-verified

48
49/** Parse a raw string value into the appropriate type. */
50function parseValue(raw: string): unknown {
51 if (raw === "true") return true;
52 if (raw === "false") return false;
53 const num = Number(raw);
54 if (!Number.isNaN(num) && raw.trim() !== "") return num;
55 return raw;
56}
57
58/** Check that the parsed value matches the runtime type of the existing config field. */
59function isTypeCompatible(existing: unknown, parsed: unknown): boolean {

Callers 1

handleAgentWardCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected