MCPcopy Create free account
hub / github.com/freecodexyz/free-code / validateUuid

Function validateUuid

src/utils/sessionStoragePortable.ts:26–29  ·  view source on GitHub ↗
(maybeUuid: unknown)

Source from the content-addressed store, hash-verified

24 /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i
25
26export function validateUuid(maybeUuid: unknown): UUID | null {
27 if (typeof maybeUuid !== 'string') return null
28 return uuidRegex.test(maybeUuid) ? (maybeUuid as UUID) : null
29}
30
31// ---------------------------------------------------------------------------
32// JSON string field extraction — no full parse, works on truncated lines

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected