Reference · Flags of international organisations
organisationIdfunction
The id of an organisation's flag, from an id written loosely: either case, with spaces around it. The org: may
be left off ("EU", " eu ").
Import it
import { organisationId } from "@johnmorrisdotca/hata/organisations";
Definition
function organisationId(input: string): OrganisationId | null
Parameters
| Name | Type | Description |
|---|---|---|
input | string | An id, with or without |
Returns
"org:eu" | "org:caricom" | "org:arab-league" | "org:cis" | "org:commonwealth" | "org:andean-community" | "org:oic" | null
The id as this package writes it ("org:eu"), or null when it is no id or the organisation has no flag here.
Examples
import { organisationId } from "@johnmorrisdotca/hata/organisations";
console.log(organisationId("ORG:EU")); // "org:eu"
console.log(organisationId(" eu ")); // "org:eu"
console.log(organisationId("org:xx")); // nullorg:eu
org:eu
nullWhat it prints (run when this page was built)