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 · Ship signal flags (International Code of Signals)

isSignalIdfunction

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

Import it

import { isSignalId } from "@johnmorrisdotca/hata/signals";

Definition

function isSignalId(value: unknown): value is SignalId

Parameters

NameTypeDescription
valueunknown

Anything.

Returns

boolean

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

Examples

import { isSignalId } from "@johnmorrisdotca/hata/signals";

console.log(isSignalId("ics:a")); // true
console.log(isSignalId("A"));     // false: see signalId
true
false

What it prints (run when this page was built)

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