parseItalianAddress関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Parses an address in Italy into the parts Poste Italiane lays out: who it is care of (careOf), a building (building:
Palazzo Rossi), the street as written with its type (street: Via del Corso, V.le Monza), its civic number in
number (12, 12-14, or SNC for senza numero civico) with its letter or sub-number in numberExtension (the A of
12/A, bis), the staircase (staircase), the floor (floorType Piano and floor), the flat (secUnitType
Interno and secUnitNum), a Casella Postale, the frazione in locality, the place in city, the postcode (CAP) in
zip and the province's sigla in state (RM), as written or from the postcode.
インポート
import { parseItalianAddress } from "@johnmorrisdotca/address-plus/it";
定義
function parseItalianAddress(text: string, options?: ParseOptions): ParsedAddress | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
text | string | The address as one string; commas and line breaks both separate its parts. |
options (省略可) | ParseOptions |
|
戻り値
ParsedAddress | null
The parts found, with country IT, or null when the text is empty or holds nothing that makes it an
address.
例
import { parseItalianAddress } from "@johnmorrisdotca/address-plus/it";
console.log(parseItalianAddress("Via del Corso, 12/A, 00186 Roma RM"));
// → {"number":"12","numberExtension":"A","street":"Via del Corso","city":"Roma","state":"RM","zip":"00186","zipValid":true,"country":"IT"}{
number: '12',
numberExtension: 'A',
street: 'Via del Corso',
city: 'Roma',
state: 'RM',
zip: '00186',
zipValid: true,
country: 'IT'
}出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。