formatAddress関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Writes a parsed address back out as lines and as one line, with abbreviations or in full.
インポート
import { formatAddress } from "@johnmorrisdotca/address-plus";
定義
function formatAddress(address: ParsedAddress, options?: AddressFormattingOptions): FormattedAddress
引数
| 名前 | 型 | 説明 |
|---|---|---|
address | ParsedAddress | The address, as |
options (省略可) | AddressFormattingOptions | How to write it: abbreviated or in full, the letter case, the country (see
|
戻り値
FormattedAddress
The address as an array of lines and as one line.
例
import { formatAddress, parseLocation } from "@johnmorrisdotca/address-plus";
const parsedAddress1=parseLocation("123 Main Street, Anytown, NY 12345");
if (!parsedAddress1) throw new Error("The example address did not parse.");
console.log(formatAddress(parsedAddress1).singleLine);
// → "123 Main St, Anytown NY 12345"123 Main St, Anytown NY 12345出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。