Reference · French country module
isKnownFrenchPostcodefunction
Whether La Poste's base officielle des codes postaux lists a postcode: France, the overseas departments and collectivities and Monaco. The base is La Poste's (Licence Ouverte 2.0); a postcode created since it was copied is not in it, so an unknown one is a warning for a validator to give, not proof that it does not exist.
Import it
import { isKnownFrenchPostcode } from "@johnmorrisdotca/address-plus/fr";
Definition
function isKnownFrenchPostcode(postcode: string): boolean
Parameters
| Name | Type | Description |
|---|---|---|
postcode | string | The postcode. |
Returns
boolean
true when La Poste's base lists it.
Examples
import { isKnownFrenchPostcode } from "@johnmorrisdotca/address-plus/fr";
console.log(["75008", "75099", "98000", "00000"].map(isKnownFrenchPostcode));
// → [true,false,true,false][ true, false, true, false ]What it prints (run when this page was built)