formatCanadaPost関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Writes a parsed address the way Canada Post asks: capitals, the unit before the civic number joined by a hyphen, and the postal code two spaces after the province.
インポート
import { formatCanadaPost } from "@johnmorrisdotca/address-plus";
定義
function formatCanadaPost(address: ParsedAddress, options?: CanadaPostFormattingOptions): FormattedAddress
引数
| 名前 | 型 | 説明 |
|---|---|---|
address | ParsedAddress | The address, as |
options (省略可) | CanadaPostFormattingOptions | Canada Post settings (see |
戻り値
FormattedAddress
The address as lines and as one line.
例
import { formatCanadaPost, parseLocation } from "@johnmorrisdotca/address-plus";
const parsedAddress1=parseLocation("100 Queen Street West, Toronto, Ontario M5H 2N2");
if (!parsedAddress1) throw new Error("The example address did not parse.");
console.log(formatCanadaPost(parsedAddress1).lines);
// → ["100 QUEEN ST W","TORONTO ON M5H 2N2"][ '100 QUEEN ST W', 'TORONTO ON M5H 2N2' ]出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。