0.1.1 • Published 3 years ago

joi-country v0.1.1

Weekly downloads
50
License
MIT
Repository
github
Last release
3 years ago

joi-country

A simple joi extension to validate countries

Features

  • validates country strings

Installation

npm install joi-country

or

yarn add joi-country

Usage

const joi = require('joi');
const joi-country = require('joi-country');

const Joi = joi.extend(joi-counry);

const test2 = { country: 'ch' };

const schema = joi.object().keys({
    country: joi.string().country(),
})


const { value, error } = Joi.compile(schema)
    .prefs({ errors: { label: 'key' } })
    .validate(test2);

console.log({ value, error});

Support

it will a plus if we get enough donationation so I can continue creating small and meaningful packages

License

MIT license