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

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

NameTypeDescription
valueunknown

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 here
true
false
false

What it prints (run when this page was built)

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