KoreaPostFormattingOptionstype
Options for formatKoreaPost.
Import it
import type { KoreaPostFormattingOptions } from "@johnmorrisdotca/address-plus/kr";
Definition
interface KoreaPostFormattingOptions {
includeCountry?: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
includeCountry (optional) | boolean | undefined |
Examples
import { formatKoreaPost, parseKoreanAddress } from "@johnmorrisdotca/address-plus/kr";
import type { KoreaPostFormattingOptions } from "@johnmorrisdotca/address-plus/kr";
const options: KoreaPostFormattingOptions = { includeCountry: true };
const parsedAddress1 = parseKoreanAddress("110 Sejong-daero, Jung-gu, Seoul 04524");
if (!parsedAddress1) throw new Error("The example address did not parse.");
console.log(formatKoreaPost(parsedAddress1, options).lines);
// → ["110 Sejong-daero","Jung-gu","Seoul 04524","SOUTH KOREA"][ '110 Sejong-daero', 'Jung-gu', 'Seoul 04524', 'SOUTH KOREA' ]What it prints (run when this page was built)