parseInformalAddress関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Reads an address written loosely, as a fallback when parseLocation finds no street address: a description such as
Downtown near City Hall is kept whole as the street, with any ZIP code after it.
インポート
import { parseInformalAddress } from "@johnmorrisdotca/address-plus";
定義
function parseInformalAddress(address: string, options?: ParseOptions): ParsedAddress | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
address | string | The address as one string. |
options (省略可) | ParseOptions | How to parse (see |
戻り値
ParsedAddress | null
The street and the ZIP code it could find, or null when the text is empty.
例
import { parseInformalAddress } from "@johnmorrisdotca/address-plus";
console.log(parseInformalAddress("Downtown near City Hall, Springfield IL 62701"));
// → {"street":"Downtown near City Hall","zip":"62701","country":"US"}{ street: 'Downtown near City Hall', zip: '62701', country: 'US' }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。