Skip to the content

address-plusアドレスプラス

Parse, validate, format and compare addresses locally, add country modules and mount an optional native form field.

address-plus extends the parse-address style with typed results, validation, formatting and country modules. About the name

Contents

Reference · Parsing, formatting and shared types

FuzzyMatchOptionstype

Settings for fuzzy string matching: the lowest similarity that counts, the largest edit distance, and phonetic matching.

Import it

import type { FuzzyMatchOptions } from "@johnmorrisdotca/address-plus";

Definition

interface FuzzyMatchOptions {
    threshold: number;
    maxDistance: number;
    enableSoundex?: boolean;
    enableMetaphone?: boolean;
}

Members

NameTypeDescription
thresholdnumber
maxDistancenumber
enableSoundex (optional)boolean | undefined
enableMetaphone (optional)boolean | undefined

Examples

import type { FuzzyMatchOptions } from "@johnmorrisdotca/address-plus";

console.log(({ threshold: 0.8, maxDistance: 2 }).maxDistance);
// → 2
2

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/address-plus 1.7.0.