リファレンス
フランスのモジュール
import { … } from "@johnmorrisdotca/address-plus/fr";
最小化と gzip 圧縮をしたサイズは 9.3 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
compareFrenchAddresses | 関数 | Compares two addresses in France field by field: the delivery point, the building, the number and its extension, the type and name of the street, the lieu-dit, the box, the commune and the postcode. |
CountryComparison | 型 | What a country module's comparer returns: whether the two addresses are the same delivery point, and every field that differs once both are in the same form (letter case, punctuation, a street type written out or abbreviated). |
CountryDifference | 型 | One way two addresses differ, as a country module's comparer reports it: the field, and its value in each address after both were put in the same form. |
CountryModule | 型 | A country's address module: its codes, how to tell its addresses apart, and its parser, validator, formatter and comparer. |
CountryValidation | 型 | What a country module's validator returns: the errors and the warnings it found. |
findFrenchDepartment | 関数 | Finds a department of France by its code (75, 2A, 971) or its name (Paris, Haute-Corse), without regard to letter case or accents. |
formatLaPoste | 関数 | Writes an address in France as La Poste's specification asks (SP 8855): the person it is care of, then the line of the apartment, the floor and the staircase, the line of the entrance and the building, the number and street, the lieu-dit and the box, then the postcode, the commune and its CEDEX, each on its own line, in capitals without accents or punctuation. |
FormattedAddress | 型 | A formatted address: its lines, and the same on one line. |
FR_BUILDING_WORDS | 定数 | The words that open the line naming a building, a residence or a zone (La Poste's third line), which the parser keeps whole as building (Résidence Les Lilas, Bâtiment A, Zone industrielle Nord, ZAC des Prés), with their abbreviations. |
FR_COLLECTIVITIES | 定数 | The overseas collectivities that have postcodes in La Poste's base: each with its code, its ISO 3166-1 country code and its name. |
FR_DEPARTMENTS | 定数 | The 101 departments of France, in order of their codes, each with its code (75, 2A, 971), its name and its region's. |
FR_NUMBER_EXTENSIONS | 定数 | The words that may follow the number as its indice de répétition: bis, ter, quater and the rest of the Latin series. |
FR_STREET_TYPES | 定数 | The types of voie the parser takes off the front of a street's name and reports, in full, as type (rue de la Paix is street de la Paix, type Rue), with the abbreviations it reads for each. |
FR_UNIT_TYPES | 定数 | The types of the part of a building that an address names below the number: an apartment or a door, which the parser reports as secUnitType and secUnitNum, with the abbreviations it reads for each. |
france | 定数 | France's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with France (or Monaco or an overseas territory), holds CEDEX, or has a French type of voie and a postcode first on its last line is read as French; country: "FR" reads any address as one, and so does the code of an overseas department or collectivity. |
FrenchAddressFields | 型 | The fields an address in France fills beside the shared ones. |
FrenchCollectivity | 型 | An overseas collectivity of France in the tables: its code (987), the ISO 3166-1 country code an address in it reads as (PF) and its name. |
FrenchDepartment | 型 | A department of France in the tables: its code (75, 2A, 971), its name and its region's, from INSEE's Code officiel géographique. |
FrenchPostalCountry | 型 | The country an address in La Poste's base belongs to: FR for France (the metropolis and the overseas departments), MC for Monaco, and the ISO 3166-1 code of an overseas collectivity (PM, BL, MF, WF, PF, NC), which is French but has a country code of its own and is listed apart by the Universal Postal Union. |
FrenchPostcode | 型 | A postcode taken apart: the code of the department or territory its number belongs to, the country it delivers to, and whether La Poste's base has it. |
getDepartmentFromFrenchPostcode | 関数 | The department a postcode's number belongs to, by its code: 75 for 75008, 2B for 20200, 971 for 97100. |
isKnownFrenchPostcode | 関数 | Whether La Poste's base officielle des codes postaux lists a postcode: France, the overseas departments and collectivities and Monaco. |
isValidFrenchPostcode | 関数 | Whether a postcode follows La Poste's shape: five digits. |
LaPosteFormattingOptions | 型 | Options for formatLaPoste. |
looksFrench | 関数 | Whether an address is surely French, with no hint: it ends with France, an overseas department, Monaco or one of the collectivities, or holds CEDEX beside a postcode, or its last line begins with a postcode whose number names a department, a collectivity or Monaco, followed by a commune (75008 Paris), while the address has a French type of voie (rue, avenue, chemin) at the start of a street, a BP, a TSA or a lieu-dit. |
ParsedAddress | 型 | What parseLocation returns: every part it found, each absent when the address has none. |
parseFrenchAddress | 関数 | Parses an address in France (or Monaco, or an overseas department or collectivity, which are written the same way) into the parts La Poste's norm names: who it is care of (careOf), an apartment or a door (secUnitType, secUnitNum), a floor, a staircase, an entrance, the building or residence (building), the number with its extension (numberExtension: bis, ter, a letter), the type of voie in full in type and its name in street (rue de la Paix is Rue and de la Paix), a lieu-dit, a box (BP 12, CS 30001), the commune in city with its arrondissement and CEDEX, and the postcode in zip with the department's code in state. |
parseFrenchPostcode | 関数 | 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. |
ParseOptions | 型 | Options for every parser: the country, strict postal codes, snake_case keys and the rest. |
validateFrenchAddress | 関数 | Checks an address in France against La Poste's postcode shape and the tables: the postcode is five digits, its number names a department, a collectivity or Monaco, and La Poste's base officielle lists it. |
ValidationError | 型 | One finding of a validator: the field it is about, its code, a message, and how serious it is. |
ValidationOptions | 型 | Options for the validators: which parts an address must have, which kinds are allowed, and whether a postal code that does not match its region is an error. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。