unitedKingdom定数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The United Kingdom's module, for parseLocation and validateAddress: pass it in countries, and an address with a
British postcode (or ending with the United Kingdom or a nation) is read as British; country: "GB" reads any
address as one. It reads Jersey (JE), Guernsey (GY) and the Isle of Man (IM) too.
インポート
import { unitedKingdom } from "@johnmorrisdotca/address-plus/gb";
定義
const unitedKingdom: CountryModule = {
code: "GB",
codes: ["GB", "JE", "GY", "IM"],
name: "United Kingdom",
detect: looksBritish,
parse: parseUKAddress,
validate: validateUKAddress,
format: (address) => formatRoyalMail(address),
compare: compareUKAddresses,
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
code | string | |
codes | readonly string[] | |
name | string | |
detect | (address: string): boolean | |
parse | (address: string, options?: ParseOptions): ParsedAddress | null | |
validate | (address: ParsedAddress, options?: ValidationOptions): CountryValidation | |
format | (address: ParsedAddress): FormattedAddress | |
compare | (first: ParsedAddress, second: ParsedAddress): CountryComparison |
例
import { parseLocation } from "@johnmorrisdotca/address-plus";
import { unitedKingdom } from "@johnmorrisdotca/address-plus/gb";
console.log(parseLocation("221B Baker Street, London NW1 6XE", { countries: [unitedKingdom] })?.number);
// → "221B"221B出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。