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

STREET_TYPE_DETECTION_PATTERNconstant

Whether a text has a common street type in it, used to judge that a parse found a street.

Import it

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

Definition

const STREET_TYPE_DETECTION_PATTERN: RegExp = /\b(street|st|avenue|ave|road|rd|drive|dr|boulevard|blvd|lane|ln|court|ct|place|pl|way|highway|hwy|parkway|pkwy|circle|cir|terrace|ter|trail|trl)\b/i

Examples

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

console.log(STREET_TYPE_DETECTION_PATTERN.test("123 Main Street"));
// → 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.