Reference · Japanese addresses
JapaneseFormattingOptionstype
Options for formatJapanese.
Import it
import type { JapaneseFormattingOptions } from "@johnmorrisdotca/address-plus/jp";
Also exported from: @johnmorrisdotca/address-plus
Definition
interface JapaneseFormattingOptions {
blockStyle?: "hyphen" | "markers";
includePostalCode?: boolean;
multiline?: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
blockStyle (optional) | "hyphen" | "markers" | undefined | |
includePostalCode (optional) | boolean | undefined | |
multiline (optional) | boolean | undefined |
Examples
import { formatJapanese } from "@johnmorrisdotca/address-plus/jp";
import { parseLocation } from "@johnmorrisdotca/address-plus";
import type { JapaneseFormattingOptions } from "@johnmorrisdotca/address-plus/jp";
const parsedAddress1=parseLocation("〒100-0005 東京都千代田区丸の内1-2-3");
if (!parsedAddress1) throw new Error("The example address did not parse.");
console.log(formatJapanese(parsedAddress1, { blockStyle: "markers", includePostalCode: false }));
// → "東京都千代田区丸の内1丁目2番3号"東京都千代田区丸の内1丁目2番3号What it prints (run when this page was built)