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

FACILITY_DELIMITER_PATTERNSconstant

The ways a facility's name is set off from an address: in parentheses, before a delimiter, or as a trailing island.

Import it

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

Definition

const FACILITY_DELIMITER_PATTERNS: { readonly PARENTHETICAL: RegExp; readonly DELIMITED: RegExp; readonly TRAILING_ISLAND: RegExp; } = {
    PARENTHETICAL: /^(.*?)\s*\(([^)]+)\)\s*$/,
    DELIMITED: /^(.*?)\s*([:;|\u2013\u2014-])\s*(.+)$/,
    TRAILING_ISLAND: /^(.*?)(\s+)(\b.+\s+(?:Island|Isl\.?|Is\.?)\b.*)$/i,
} as const

Members

NameTypeDescription
PARENTHETICALRegExp
DELIMITEDRegExp
TRAILING_ISLANDRegExp

Examples

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

console.log(FACILITY_DELIMITER_PATTERNS.PARENTHETICAL.test("(City Hall)"));
// → 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.