isOrganisationId関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
True for one of the ids with a flag here, written exactly as this package writes it: "org:eu". Lower case is
required, and a country's code ("JP") is not an organisation's id; organisationId is the forgiving one.
インポート
import { isOrganisationId } from "@johnmorrisdotca/hata/organisations";
定義
function isOrganisationId(value: unknown): value is OrganisationId
引数
| 名前 | 型 | 説明 |
|---|---|---|
value | unknown | Anything. |
戻り値
boolean
true when value is a string in ORGANISATION_IDS, and false for anything else, never throwing.
例
import { isOrganisationId } from "@johnmorrisdotca/hata/organisations";
console.log(isOrganisationId("org:eu")); // true
console.log(isOrganisationId("ORG:EU")); // false: see organisationId
console.log(isOrganisationId("EU")); // false: no ISO code is an id heretrue
false
false出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。