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 · Parsing, formatting and shared types

GENERAL_DELIVERY_PATTERNSconstant

General delivery written alone or before a city.

Import it

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

Definition

const GENERAL_DELIVERY_PATTERNS: { readonly STANDARD: RegExp; readonly WITH_CITY: RegExp; } = {
    STANDARD: /^(?:general\s+delivery|gd|poste\s+restante)(?:\s+(?:stn\.?|station|succ\.?|succursale)\s+\S.*)?$/i,
    WITH_CITY: /^\s*general\s+delivery\s+([^,]+?)\s+([A-Za-z]{2})\b/i,
} as const

Members

NameTypeDescription
STANDARDRegExp
WITH_CITYRegExp

Examples

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

console.log(GENERAL_DELIVERY_PATTERNS.STANDARD.test("General Delivery"));
// → true
true

What it prints (run when this page was built)

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