Created
August 24, 2017 03:47
-
-
Save brunoluiz/c10f1f521b5ac68297a9a3846c397128 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Joi = require('joi') | |
const ukzip = /^[A-Z]{1,2}[0-9]{1,2}[A-Z]{0,1} ?[0-9][A-Z]{2}$/i | |
module.exports = Joi.extend({ | |
name: 'number', | |
base: Joi.number().strict() | |
}, { | |
name: 'zipcode', | |
base: Joi.regex(ukzip).description('UK Zipcode') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment