AddressComparisonOptions型
リファレンスの説明と例は英語です。見出しと目次は日本語です。
Options for comparing addresses: what to normalize before comparing, whether to allow small typos, and whether every field must match exactly.
インポート
import type { AddressComparisonOptions } from "@johnmorrisdotca/address-plus";
定義
interface AddressComparisonOptions {
ignoreCase?: boolean;
ignorePunctuation?: boolean;
normalizeStreetTypes?: boolean;
normalizeDirections?: boolean;
normalizeStates?: boolean;
fuzzyMatching?: boolean;
strictPostalCode?: boolean;
requireExactMatch?: boolean;
}
メンバー
| 名前 | 型 | 説明 |
|---|---|---|
ignoreCase (省略可) | boolean | undefined | |
ignorePunctuation (省略可) | boolean | undefined | |
normalizeStreetTypes (省略可) | boolean | undefined | |
normalizeDirections (省略可) | boolean | undefined | |
normalizeStates (省略可) | boolean | undefined | |
fuzzyMatching (省略可) | boolean | undefined | |
strictPostalCode (省略可) | boolean | undefined | |
requireExactMatch (省略可) | boolean | undefined |
例
import { isSameAddress, parseLocation } from "@johnmorrisdotca/address-plus";
import type { AddressComparisonOptions } from "@johnmorrisdotca/address-plus";
const parsedAddress1=parseLocation("123 Main St, Anytown, NY 12345");
if (!parsedAddress1) throw new Error("The example address did not parse.");
const parsedAddress2=parseLocation("123 Main Stret, Anytown, NY 12345");
if (!parsedAddress2) throw new Error("The example address did not parse.");
console.log(isSameAddress(parsedAddress1, parsedAddress2, { fuzzyMatching: false }));
// → falsefalse出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。