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

findFrenchDepartmentfunction

Finds a department of France by its code (75, 2A, 971) or its name (Paris, Haute-Corse), without regard to letter case or accents.

Import it

import { findFrenchDepartment } from "@johnmorrisdotca/address-plus/fr";

Definition

function findFrenchDepartment(text: string): FrenchDepartment | null

Parameters

NameTypeDescription
textstring

The code or the name.

Returns

FrenchDepartment | null

The department, or null when nothing matches.

Examples

import { findFrenchDepartment } from "@johnmorrisdotca/address-plus/fr";

console.log(findFrenchDepartment("haute-corse")?.code);
// → "2B"
2B

What it prints (run when this page was built)

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