isrc
Creates an ISRC validation action.
const Action = v.isrc<TInput, TMessage>(message);
Generics
TInputextends stringTMessageextends ErrorMessage<IsrcIssue<TInput>> | undefined
Parameters
messageTMessage
Explanation
With isrc you can validate the formatting of a string. If the input is not an ISRC, you can use message to customize the error message.
This action supports both compact (CCXXXYYNNNNN) and hyphenated (CC-XXX-YY-NNNNN) formats.
Returns
ActionIsrcAction<TInput, TMessage>
Examples
The following examples show how isrc can be used.
ISRC schema
Schema to validate an ISRC.
const IsrcSchema = v.pipe(v.string(), v.isrc('The ISRC is badly formatted.'));
// Valid ISRC formats:
// 'USRC17607839'
// 'US-RC1-76-07839'
Related
The following APIs can be combined with isrc.
Schemas
Methods
Utils
© Fabian Hiller
Licensed under the MIT License.
https://valibot.dev/api/isrc/