MCPcopy Create free account
hub / github.com/OpenCoworkAI/open-codesign / parseLegacyPrimitive

Function parseLegacyPrimitive

packages/shared/src/editmode.ts:139–147  ·  view source on GitHub ↗
(raw: string)

Source from the content-addressed store, hash-verified

137}
138
139function parseLegacyPrimitive(raw: string): EditmodeTokenValue | null {
140 const text = raw.trim();
141 const stringValue = parseLegacyStringLiteral(text);
142 if (stringValue !== null) return stringValue;
143 if (text === 'true') return true;
144 if (text === 'false') return false;
145 if (/^-?\d+(?:\.\d+)?$/.test(text)) return Number(text);
146 return null;
147}
148
149function parseLegacyKey(raw: string): string | null {
150 const text = raw.trim();

Callers 1

Calls 1

parseLegacyStringLiteralFunction · 0.85

Tested by

no test coverage detected