Reference · Parsing, formatting and shared types
BatchParseOptionstype
Options for the batch parsers: the parse options, plus whether to stop at the first error and whether to include the statistics.
Import it
import type { BatchParseOptions } from "@johnmorrisdotca/address-plus";
Definition
interface BatchParseOptions extends ParseOptions {
stopOnError?: boolean;
parallel?: boolean;
chunkSize?: number;
includeStats?: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
stopOnError (optional) | boolean | undefined | |
parallel (optional) | boolean | undefined | |
chunkSize (optional) | number | undefined | |
includeStats (optional) | boolean | undefined | |
country (optional) | "CA" | "US" | "JP" | "AU" | "GB" | "GY" | "IM" | "JE" | FrenchPostalCountry | "DE" | "GP" | "MQ" | "GF" | "RE" | "YT" | "auto" | undefined | |
countries (optional) | readonly CountryModule[] | undefined | |
normalize (optional) | boolean | undefined | |
validatePostalCode (optional) | boolean | undefined | |
language (optional) | "auto" | "en" | "fr" | undefined | |
extractFacilities (optional) | boolean | undefined | |
parseParenthetical (optional) | boolean | undefined | |
strict (optional) | boolean | undefined | |
useSnakeCase (optional) | boolean | undefined |
Examples
import { parseLocationsBatch } from "@johnmorrisdotca/address-plus";
import type { BatchParseOptions } from "@johnmorrisdotca/address-plus";
console.log(parseLocationsBatch(["123 Main St, Anytown, NY 12345"], { country: "US" }).stats.total);
// → 11What it prints (run when this page was built)