リファレンス
ドイツのモジュール
import { … } from "@johnmorrisdotca/address-plus/de";
最小化と gzip 圧縮をしたサイズは 12.2 kB(読み込むものをすべて含み、esbuild で計測)
リファレンスの説明と例は英語です。見出しと目次は日本語です。
エクスポート
| 名前 | 種類 | 概要 |
|---|---|---|
compareGermanAddresses | 関数 | Compares two addresses in Germany field by field: who it is care of, the building, the flat and floor, the street, the house number, the place 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. |
DE_BUILDING_WORDS | 定数 | The words for a part of a building, which open the line the parser keeps whole as building (Hinterhaus, Haus B, Gebäude 4, Block C), in lower case. |
DE_COUNTRY_NAMES | 定数 | What a country at the end of an address may be called, in capitals with no umlauts: DEUTSCHLAND, GERMANY, ALLEMAGNE, BRD. |
DE_STATES | 定数 | The sixteen Länder of Germany, in order of their codes, each with its ISO 3166-2 code and its name in English and in Japanese. |
DE_STREET_OPENERS | 定数 | The words that begin a street's name with no suffix to end it (Am Markt, An der Weide, Zum alten Hof, Im Winkel), and the adjectives that begin one (Große Bleiche, Alte Dorfstraße), in lower case. |
DE_STREET_SUFFIXES | 定数 | What a street's name may end with, which makes the word the name ends in a thoroughfare (Hauptstraße, Berliner Str., Kastanienallee), in lower case with their spellings: strasse for straße, str for the abbreviation. |
DE_UNIT_TYPES | 定数 | The words for a flat or a room, which the parser reports as secUnitType in full, with the abbreviations it reads for each: `Whg. |
DeutschePostFormattingOptions | 型 | Options for formatDeutschePost. |
findGermanState | 関数 | Finds a Land of Germany by its code (BY, DE-BY) or its name in English, German or Japanese, without regard to letter case or umlauts written as ae, oe, ue. |
formatDeutschePost | 関数 | Writes an address in Germany as Deutsche Post asks: who it is care of (c/o), the part of the building, the flat and the floor, the street and its house number, then the postcode and the place, each on its own line, with no punctuation at the end of a line. |
FormattedAddress | 型 | A formatted address: its lines, and the same on one line. |
GermanAddressFields | 型 | The fields an address in Germany fills beside the shared ones. |
GermanPostcode | 型 | A postcode taken apart: the Land it is in, and whether GeoNames' list has it. |
GermanState | 型 | A Land of Germany in the tables: its code, its ISO 3166-2 code, and its name in English and in Japanese (from kuni, which takes them from Unicode CLDR and Wikidata). |
GermanStateCode | 型 | The code of one of the sixteen Länder of Germany, as ISO 3166-2:DE writes it after DE-. |
germany | 定数 | Germany's module, for parseLocation and validateAddress: pass it in countries, and an address that ends with Germany or Deutschland, or has a German street and its number and a postcode first on its last line, is read as German; country: "DE" reads any address as one. |
getStateFromGermanPostcode | 関数 | The Land a postcode is in, by its code: BY for 80331, BE for 10115. |
isKnownGermanPostcode | 関数 | Whether GeoNames' list for Germany has a postcode (its places include those of large firms, whose postcodes are their own). |
isValidGermanPostcode | 関数 | Whether a postcode follows Deutsche Post's shape: five digits. |
looksGerman | 関数 | Whether an address is surely German, with no hint: it ends with Germany, Deutschland or a code such as D-10115 before the place, or its last line begins with a postcode and a place (10115 Berlin) while the address has a street that ends in a German suffix (Hauptstraße, Kastanienallee, Am Markt) followed by its number, or a Postfach or a Packstation. |
ParsedAddress | 型 | What parseLocation returns: every part it found, each absent when the address has none. |
parseGermanAddress | 関数 | Parses an address in Germany into the parts Deutsche Post and DIN 5008 lay out: who it is care of (careOf, from c/o, `z. |
parseGermanPostcode | 関数 | Takes a postcode apart: the Land it is in, from GeoNames' list (a postcode with places in two Länder takes the one most are in), and whether the list has it. |
ParseOptions | 型 | Options for every parser: the country, strict postal codes, snake_case keys and the rest. |
validateGermanAddress | 関数 | Checks an address in Germany against Deutsche Post's postcode shape and GeoNames' list: the postcode is five digits and the list has it, and the place and the house number are given. |
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. |
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。