Reference · Flags a page registers itself
isCustomIdfunction
True for a string written as a custom flag's id, custom: and a slug; it says nothing of whether such a flag is registered (customFlag does).
Import it
import { isCustomId } from "@johnmorrisdotca/hata/custom";
Definition
function isCustomId(value: unknown): boolean
Parameters
| Name | Type | Description |
|---|---|---|
value | unknown | Anything. |
Returns
boolean
true for "custom:harbour-fc", false for anything else, never throwing.
Examples
import { isCustomId } from "@johnmorrisdotca/hata/custom";
console.log(isCustomId("custom:harbour-fc")); // true
console.log(isCustomId("JP")); // false
console.log(isCustomId("org:eu")); // falsetrue
false
falseWhat it prints (run when this page was built)