joi-country

0.1.1 • Public • Published

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

Buy Me A Coffee

License

MIT license

Package Sidebar

Install

npm i joi-country

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

3.92 kB

Total Files

5

Last publish

Collaborators

  • truestbyheart