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

capitalizeStreetNamefunction

Capitalizes a street name the way it is signed. A word written in mixed case is kept as written (O'Farrell, McKinley, d'Youville); a word all in lower case or all in capitals is title-cased, except a French particle written in lower case, which stays so (rue des Jardins).

Import it

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

Definition

function capitalizeStreetName(text: string): string

Parameters

NameTypeDescription
textstring

The street name.

Returns

string

The name capitalized.

Examples

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

console.log(capitalizeStreetName("o'brien"));
// → "O'Brien"
O'Brien

What it prints (run when this page was built)

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