CorreosFormattingOptionstype
Options for formatCorreos.
Import it
import type { CorreosFormattingOptions } from "@johnmorrisdotca/address-plus/es";
Definition
interface CorreosFormattingOptions {
includeCountry?: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
includeCountry (optional) | boolean | undefined |
Examples
import { formatCorreos, parseSpanishAddress } from "@johnmorrisdotca/address-plus/es";
import type { CorreosFormattingOptions } from "@johnmorrisdotca/address-plus/es";
const options: CorreosFormattingOptions = { includeCountry: true };
const parsedAddress1 = parseSpanishAddress("Calle de Alcalá, 42, 28014 Madrid");
if (!parsedAddress1) throw new Error("The example address did not parse.");
console.log(formatCorreos(parsedAddress1, options).lines);
// → ["Calle de Alcalá, 42","28014 Madrid","ESPAÑA"][ 'Calle de Alcalá, 42', '28014 Madrid', 'ESPAÑA' ]What it prints (run when this page was built)