Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * "Shortester" Polish postal code validator without regular expressions
- * Only 86 characters (when not couting the module export)!
- *
- * @params {string} code to validate
- * @author Marcin Gajda (and KevSlashNull)
- */
- v=c=>!!(c[4]&&+('1.'+c.slice(0,2)+c.slice(-3))&&' -_'.includes(c.slice(2,-3)))
- module.exports = v;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement