You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stricter validation. Postcodes are now checked against the per-position letter rules from BS 7666, and the whole string must match. These were accepted by 1.x and are now rejected:
text around a postcode, e.g. "GIR0AA nonsense"
letters not used in a given position, e.g. "Q1 1AA", "N7 7CA", "ZZ99 9ZZ"
Build targets ES2017 instead of ES5.
Features
Named isValid export: import { isValid } from "uk-postcode-validator" or const { isValid } = require("uk-postcode-validator"). The default export still works.
Surrounding whitespace and repeated spaces between the outward and inward codes are now accepted.