Reference · French country module
parseFrenchPostcodefunction
Takes a postcode apart: the code of the department or territory its number belongs to, and the country it delivers
to (FR for France and its overseas departments, MC for Monaco, PF, NC and the other collectivities' own
codes), and whether La Poste's base lists it. A few postcodes serve a commune across a department's border; the
department reported is the one the number names.
Import it
import { parseFrenchPostcode } from "@johnmorrisdotca/address-plus/fr";
Definition
function parseFrenchPostcode(postcode: string): FrenchPostcode | null
Parameters
| Name | Type | Description |
|---|---|---|
postcode | string | The postcode, with or without spaces. |
Returns
FrenchPostcode | null
The parts, or null when it is not five digits.
Examples
import { parseFrenchPostcode } from "@johnmorrisdotca/address-plus/fr";
console.log(parseFrenchPostcode("98714"));
// → {"postcode":"98714","place":"987","country":"PF","known":true}{ postcode: '98714', place: '987', country: 'PF', known: true }What it prints (run when this page was built)