Reference · Military flags (naval ensigns, jacks and war flags)
militaryIdfunction
The id of a flag from an id written loosely: either case, with spaces around it, with or without mil:.
Import it
import { militaryId } from "@johnmorrisdotca/hata/military";
Definition
function militaryId(input: string): MilitaryId | null
Parameters
| Name | Type | Description |
|---|---|---|
input | string | "gb-white-ensign", " MIL:GB-White-Ensign ". |
Returns
MilitaryRecordId | null
The id as this package writes it, or null when the set has no such flag.
Examples
import { militaryId } from "@johnmorrisdotca/hata/military";
console.log(militaryId(" GB-White-Ensign ")); // "mil:gb-white-ensign"
console.log(militaryId("nobody")); // nullmil:gb-white-ensign
nullWhat it prints (run when this page was built)