daily pastebin goal
68%
SHARE
TWEET

Untitled

a guest Mar 21st, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top