Reference · Parsing, formatting and shared types
AddressParsertype
The shape of the default export: the four parsers parse-address's users call on one object.
Import it
import type { AddressParser } from "@johnmorrisdotca/address-plus";
Definition
interface AddressParser {
parseAddress(address: string, options?: ParseOptions): ParsedAddress | null;
parseInformalAddress(address: string, options?: ParseOptions): ParsedAddress | null;
parseIntersection(address: string, options?: ParseOptions): ParsedIntersection | null;
parseLocation(address: string, options?: ParseOptions): ParsedAddress | null;
}
Members
| Name | Type | Description |
|---|---|---|
parseAddress | (address: string, options?: ParseOptions): ParsedAddress | null | |
parseInformalAddress | (address: string, options?: ParseOptions): ParsedAddress | null | |
parseIntersection | (address: string, options?: ParseOptions): ParsedIntersection | null | |
parseLocation | (address: string, options?: ParseOptions): ParsedAddress | null |
Examples
import parser from "@johnmorrisdotca/address-plus";
import type { AddressParser } from "@johnmorrisdotca/address-plus";
console.log(Object.keys(parser));
// → ["parseLocation","parseIntersection","parseInformalAddress","parseAddress"][
'parseLocation',
'parseIntersection',
'parseInformalAddress',
'parseAddress'
]What it prints (run when this page was built)