Skip to the content

Hata旗

Load a native country or region flag, choose supported framing and keep each drawing’s source, author and licence.

Hata (旗) is Japanese for a flag. About the name

Contents

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

NameTypeDescription
inputstring

An id, with or without org:, in any case.

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")); // null
org:eu
org:eu
null

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/hata 1.31.0.