Spec-Zone.ru › Valibot

isrc

Creates an ISRC validation action.

const Action = v.isrc<TInput, TMessage>(message);

Generics

  • TInput extends string
  • TMessage extends ErrorMessage<IsrcIssue<TInput>> | undefined

Parameters

  • message TMessage

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

  • Action IsrcAction<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

any, custom, string

Methods

pipe

Utils

isOfKind, isOfType

© Fabian Hiller
Licensed under the MIT License.
https://valibot.dev/api/isrc/

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API