(maybeUuid: unknown)
| 10 | * @returns string as UUID or null if it is not valid |
| 11 | */ |
| 12 | export function validateUuid(maybeUuid: unknown): UUID | null { |
| 13 | // UUID format: 8-4-4-4-12 hex digits |
| 14 | if (typeof maybeUuid !== 'string') return null |
| 15 | |
| 16 | return uuidRegex.test(maybeUuid) ? (maybeUuid as UUID) : null |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * Generate a new agent ID with prefix for consistency with task IDs. |
no outgoing calls
no test coverage detected