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 · Military flags (naval ensigns, jacks and war flags)

isMilitaryIdfunction

True for an id of this set, written exactly as this package writes it. A country's code ("JP") is not one.

Import it

import { isMilitaryId } from "@johnmorrisdotca/hata/military";

Definition

function isMilitaryId(value: unknown): value is MilitaryId

Parameters

NameTypeDescription
valueunknown

Anything.

Returns

boolean

true when value is a string in MILITARY_IDS, and false for anything else, never throwing.

Examples

import { isMilitaryId } from "@johnmorrisdotca/hata/military";

console.log(isMilitaryId("mil:us-navy-jack")); // true
console.log(isMilitaryId("US"));               // false
true
false

What it prints (run when this page was built)

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