Reference · Military flags (naval ensigns, jacks and war flags)
militaryAspectfunction
A flag's width over its height, from its viewBox: 1.5 for the Self-Defense Force ensign's 3 to 2. For keeping a box before the picture is drawn.
Import it
import { militaryAspect } from "@johnmorrisdotca/hata/military";
Definition
function militaryAspect(id: string): number | null
Parameters
| Name | Type | Description |
|---|---|---|
id | string | A flag's id, in any case, with or without |
Returns
number | null
The aspect ratio, or null when the set has no such flag.
Examples
import { militaryAspect } from "@johnmorrisdotca/hata/military";
console.log(militaryAspect("mil:jp-jmsdf-ensign")); // 1.5
console.log(militaryAspect("mil:gb-white-ensign")); // 21.5
2What it prints (run when this page was built)