Skip to content

redact

redact(code): string

Hides the unit of a postcode, so that a log shows the area but not the building. For a code without a unit, it returns the canonical form unchanged.

Postcode

A parsed postcode.

string

The canonical form, with ** in place of the unit.

const building = parse('EK-01-A03-FK-01');
if (building.ok) {
redact(building.value); // 'EK-01-A03-FK-**'
}

Unofficial. Not made or endorsed by NIPOST.