INNER CODE UNIT · TypeScript

isFunction

maplibre/maplibre-react-native · package/src/utils/index.ts:21

export function isFunction(fn: unknown): fn is Function {
  return typeof fn === "function";
}

export function isNumber(num: unknown): num is number {
  return typeof num === "number" && !Number.isNaN(num);
}

export function isUndefined(obj: unknown): obj is undefined {
  return typeof obj === "undefined";
}

export function isString(str: unknown): str is string {
  return typeof str === "string";
}

export function isBoolean(bool: unknown): bool is boolean {
  return typeof bool === "boolean";

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…