Skip to content
💰 Joi validation for ISO 4217 currency codes.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
.travis.yml
index.js
package-lock.json
package.json
readme.md
test.js

readme.md

💰 joi-currency-code

npm Build Status XO code style

A Joi validator that validates whether a given input is a valid currency code, according to ISO 4217.

Installation

npm install joi-currency-code

Usage

const Joi = require('joi-currency-code')(require('joi'));

const schema = Joi.object({
  code: Joi.string().currency()
});

Joi.validate({
  code: 'aud'
}, schema); // succeeds

Joi.validate({
  code: 'fake-currency'
}, schema); // fails with ValidationError

Contributing

  • git clone git@github.com:hugomd/joi-currency-code.git
  • npm install
  • Make your changes
  • Open a pull request and ask for review ✌️
  • Optional: use emoji in your commits 🔥

Related Repositories

You can’t perform that action at this time.