Skip to content

uuid ​

The string is a UUID of any version: 550e8400-e29b-41d4-a716-446655440000.

Signature ​

ts
function uuid(msg?: Message): Action<string>

Parameters ​

ParameterTypeDescription
msgMessageCustom error message

Error codes ​

CodeWhenDefault message
uuidNot a UUIDInvalid UUID

You can change the texts: see Messages & i18n.

Example ​

ts
const Params = object({ id: pipe(string(), uuid()) });

See also ​

  • brand — a separate type for IDs