flagAspect関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
A flag's width over its height, from its picture's viewBox, without loading the picture: 1.5 for Japan's 2:3, 2 for Canada's 1:2. For keeping a flag's box before its picture arrives.
インポート
import { flagAspect } from "@johnmorrisdotca/hata/names";
定義
function flagAspect(code: string): number | null
引数
| 名前 | 型 | 説明 |
|---|---|---|
code | string | A flag's code, in any case. |
戻り値
number | null
The aspect ratio, or null when the code has no flag here.
例
import { flagAspect } from "@johnmorrisdotca/hata/names";
console.log(flagAspect("CA")); // 2
console.log(flagAspect("CH")); // 12
1出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。