Skip to the content

address-plusアドレスプラス

Parse, validate, format and compare addresses locally, add country modules and mount an optional native form field.

address-plus extends the parse-address style with typed results, validation, formatting and country modules. About the name

Contents

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

NameTypeDescription
postcodestring

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)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/address-plus 1.7.0.