Reference · Parsing, formatting and shared types
AddressValidationResulttype
What validateAddress returns.
Import it
import type { AddressValidationResult } from "@johnmorrisdotca/address-plus";
Definition
interface AddressValidationResult {
isValid: boolean;
confidence: number;
completeness: number;
errors: ValidationError[];
warnings: ValidationError[];
suggestions: string[];
parsedAddress: import("./parsed-address").ParsedAddress | null;
}
Members
| Name | Type | Description |
|---|---|---|
isValid | boolean | |
confidence | number | |
completeness | number | |
errors | ValidationError[] | |
warnings | ValidationError[] | |
suggestions | string[] | |
parsedAddress | ParsedAddress | null |
Examples
import { validateAddress } from "@johnmorrisdotca/address-plus";
import type { AddressValidationResult } from "@johnmorrisdotca/address-plus";
console.log(validateAddress("1600 Pennsylvania Ave NW, Washington, DC 20500").isValid);
// → truetrueWhat it prints (run when this page was built)