(maybeUuid: unknown)
| 24 | /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i |
| 25 | |
| 26 | export 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 |
nothing calls this directly
no outgoing calls
no test coverage detected