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
| Name | Type | Description |
|---|---|---|
query | string | 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)