Reference · French country module
LaPosteFormattingOptionstype
Options for formatLaPoste.
Import it
import type { LaPosteFormattingOptions } from "@johnmorrisdotca/address-plus/fr";
Definition
interface LaPosteFormattingOptions {
includeCountry?: boolean;
keepAccents?: boolean;
}
Members
| Name | Type | Description |
|---|---|---|
includeCountry (optional) | boolean | undefined | |
keepAccents (optional) | boolean | undefined |
Examples
import { formatLaPoste, parseFrenchAddress } from "@johnmorrisdotca/address-plus/fr";
import type { LaPosteFormattingOptions } from "@johnmorrisdotca/address-plus/fr";
const parsedAddress1=parseFrenchAddress("12 rue de la Paix, 75002 Paris");
if (!parsedAddress1) throw new Error("The example address did not parse.");
console.log(formatLaPoste(parsedAddress1, { includeCountry: true }).lines);
// → ["12 RUE DE LA PAIX","75002 PARIS","FRANCE"][ '12 RUE DE LA PAIX', '75002 PARIS', 'FRANCE' ]What it prints (run when this page was built)