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
| Name | Type | Description |
|---|---|---|
value | unknown | 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 signalIdtrue
falseWhat it prints (run when this page was built)