parseStreetType関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Takes the street type off the end of a street, abbreviated the USPS way.
インポート
import { parseStreetType } from "@johnmorrisdotca/address-plus";
定義
function parseStreetType(text: string, country?: "US" | "CA"): { type: string | undefined; remaining: string; }
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | The street text. |
country (省略可) | "CA" | "US" |
|
戻り値
{ type: string | undefined; remaining: string; }
The type's USPS abbreviation in lower case (undefined when there is none) and the text that remains.
例
import { parseStreetType } from "@johnmorrisdotca/address-plus";
console.log(parseStreetType("Main Street"));
// → {"type":"st","remaining":"Main"}{ type: 'st', remaining: 'Main' }出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。