Summary
Lib and spec for taking address strings and changing common words to abbreviations. Address string is "32 SMITH STREET BELMONT NSW 2123"
return is "32 SMITH ST BELMONT NSW 2123"
It will handle prefix and suffix (street types)
It will not handle "32 STREET AVENUE" it would return "32 ST AVE"
Also has a separate function to split the address to multilines with your own delimineter.
Install/run
yarn install @globalx/address-abbreviations
Usage
import { abbreviateAddress, formatAddress } from '../src/abbreviate_address';
abbreviateAddress("32 SMITH STREET GATTON") # '32 SMITH ST GATTON'
formatAddress("32 SMITH ST GATTON QLD 4123", '|')) #'32 SMITH ST|GATTON QLD 4123'