joi-language-extension
v1.0.2
Published
A Joi extension for validation of ISO 639-1 language codes.
Downloads
2
Readme
Joi Language Extension
A Joi extension for validation of ISO 639-1 language codes.
Installation
npm install --save joi-language-extension
Usage
const BaseJoi = require('joi')
const JoiLanguageExtension = require('joi-language-extension')
const Joi = BaseJoi.extend(JoiLanguageExtension)
const schema = Joi.string().language()
const result = await schema.validate('ar')
console.log(result) // ar
Acknowledgment
This repo is almost entirely based on https://github.com/Tallysticks/joi-country-extension.