Reference · Flags of international organisations
loadOrganisationFlagfunction
Any organisation's flag as an SVG string, loaded when it is asked for: each drawing is a module of its own
(@johnmorrisdotca/hata/organisations/<slug>), so a page carries the drawings it asks for and no others. The same string
organisationFlag gives for the European Union, and the drawing of each body taken from Wikimedia Commons.
Import it
import { loadOrganisationFlag } from "@johnmorrisdotca/hata/organisations";
Definition
function loadOrganisationFlag(id: string): Promise<string | null>
Parameters
| Name | Type | Description |
|---|---|---|
id | string | An organisation's id, in any case, with or without |
Returns
Promise<string | null>
The SVG string, or null when the id has no flag here.
Examples
import { loadOrganisationFlag } from "@johnmorrisdotca/hata/organisations";
console.log((await loadOrganisationFlag("org:caricom"))?.startsWith("<svg")); // true
console.log(await loadOrganisationFlag("org:xx")); // nulltrue
nullWhat it prints (run when this page was built)