formatKoreaPostfunction
Writes an address in South Korea as Korea Post asks. An address in Hangul is written from the province down on one line, with the floor and the unit after the road and the dong in brackets, and the postcode on a line of its own; one in Latin letters is written from the unit up, each of the unit, the road, the district and the province and postcode on its own line.
Import it
import { formatKoreaPost } from "@johnmorrisdotca/address-plus/kr";
Definition
function formatKoreaPost(address: ParsedAddress, options?: KoreaPostFormattingOptions): FormattedAddress
Parameters
| Name | Type | Description |
|---|---|---|
address | ParsedAddress | The address as |
options (optional) | KoreaPostFormattingOptions | Whether to add the country (see |
Returns
FormattedAddress
The lines, the same on one line, the delivery line and the last line.
Examples
import { formatKoreaPost, parseKoreanAddress } from "@johnmorrisdotca/address-plus/kr";
const parsedAddress1 = parseKoreanAddress("서울 중구 세종대로 110 3층 (태평로1가) 04524");
if (!parsedAddress1) throw new Error("The example address did not parse.");
console.log(formatKoreaPost(parsedAddress1).lines);
// → ["서울특별시 중구 세종대로 110, 3층 (태평로1가)","04524"][ '서울특별시 중구 세종대로 110, 3층 (태평로1가)', '04524' ]What it prints (run when this page was built)