Skip to content

Latest commit

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

ajv-locale-code

Adds a locale_code format to Ajv.

Install

npm i --save @socketkit/ajv-locale-code

Setup

importAjvfrom'ajv'importlocaleCodefrom'@socketkit/ajv-locale-code'constajv=newAjv()localeCode(ajv)

Usage

When defining your JSON schema, use the format keyword with ther value set to locale_code. For example

{
"type": "object",
"properties": {
"locale": {
"type": "string",
"format": "locale_code"
}
}
}

About

Ajv plugin for validating ISO-639-1 and ISO-3166-1 input types

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages