Advertisement
Guest User

Untitled

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