isLegacy
isLegacy(
input):boolean
Tells whether text is an old 6-digit NIPOST postcode. A legacy postcode names an area, not
a building. Like parse, it applies the input limit before it normalises, so long text
cannot stall a server.
Parameters
Section titled “Parameters”string
Text from a user.
Returns
Section titled “Returns”boolean
True when the input is within the input limit and exactly 6 ASCII digits remain after normalisation.
Example
Section titled “Example”isLegacy('900 108'); // trueisLegacy('EK-01-A03-FK-01'); // falseUnofficial. Not made or endorsed by NIPOST.