Reference · Flags of international organisations
isOrganisationIdfunction
True for one of the ids with a flag here, written exactly as this package writes it: "org:eu". Lower case is
required, and a country's code ("JP") is not an organisation's id; organisationId is the forgiving one.
Import it
import { isOrganisationId } from "@johnmorrisdotca/hata/organisations";
Definition
function isOrganisationId(value: unknown): value is OrganisationId
Parameters
| Name | Type | Description |
|---|---|---|
value | unknown | Anything. |
Returns
boolean
true when value is a string in ORGANISATION_IDS, and false for anything else, never throwing.
Examples
import { isOrganisationId } from "@johnmorrisdotca/hata/organisations";
console.log(isOrganisationId("org:eu")); // true
console.log(isOrganisationId("ORG:EU")); // false: see organisationId
console.log(isOrganisationId("EU")); // false: no ISO code is an id heretrue
false
falseWhat it prints (run when this page was built)