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 a page registers itself

isCustomIdfunction

True for a string written as a custom flag's id, custom: and a slug; it says nothing of whether such a flag is registered (customFlag does).

Import it

import { isCustomId } from "@johnmorrisdotca/hata/custom";

Definition

function isCustomId(value: unknown): boolean

Parameters

NameTypeDescription
valueunknown

Anything.

Returns

boolean

true for "custom:harbour-fc", false for anything else, never throwing.

Examples

import { isCustomId } from "@johnmorrisdotca/hata/custom";

console.log(isCustomId("custom:harbour-fc")); // true
console.log(isCustomId("JP"));                // false
console.log(isCustomId("org:eu"));            // false
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.