INNER CODE UNIT · TypeScript

isNumber

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

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";
}

export type NativeArg =
  | string

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…