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 · /in

findIndianStatefunction

Finds a state or union territory of India by its code (KA, IN-KA) or its name in English, ignoring accents, & for and, and letter case.

Import it

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

Definition

function findIndianState(query: string): PostcodeRegion | undefined

Parameters

NameTypeDescription
querystring

The state's code or name.

Returns

PostcodeRegion | undefined

The state, or undefined when none has that code or name.

Examples

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

console.log([findIndianState("ka")?.name, findIndianState("Jammu & Kashmir")?.code, findIndianState("xx")]);
// → ["Karnataka","JK",null]
[ 'Karnataka', 'JK', undefined ]

What it prints (run when this page was built)

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