Joi Currency Plugin
A Joi plugin that validates if the string is an ISO 3166 currency code.
Installing
npm install joi-currency --save
Usage
const Joi = ; // require this plugin as Joi const product = id: 'k1773y' name: 'Hello Kitty Backpack' price: 125 currency: 'XYZ' ; const schema = Joiobject; var result = schema; // check and throw if there is an error (there is)if resulterror throw resulterror; // Joi Error// object is available at `result.value`