Skip to content

is

A list of is functions.

  • isBoolean
  • isDate
  • isDef
  • isFunction
  • isNull
  • isNumber
  • isObject
  • isPresent
  • isPromise
  • isRegExp
  • isString
  • isUndefined

Type Declarations

Details
ts
/**
 * Check whether the value is defined (not `undefined`).
 */
export declare const isDef: <T = any>(val?: T) => val is T;
/**
 * Check whether the value is strictly `undefined`.
 */
export declare const isUndefined: (val: any) => val is undefined;
export declare const isBoolean: (val: any) => val is boolean;
export declare const isFunction: <T extends (...args: any[]) => any>(val: any) => val is T;
export declare const isNumber: (val: any) => val is number;
export declare const isString: (val: unknown) => val is string;
/**
 * Determines whether the given value is a **plain object**.
 *
 * That is, an object created by `{}` or `new Object()`.
 *
 * NOT an array, function, class instance, built-in object (like `Date` or `RegExp`), or `null`.
 */
export declare const isObject: (val: any) => val is object;
/**
 * Check whether the value is strictly `null`.
 */
export declare const isNull: (val: any) => val is null;
export declare const isRegExp: (val: any) => val is RegExp;
export declare const isDate: (val: any) => val is Date;
/**
 * Check whether the input is promise-like, which is non-nullable and has a `then` function property.
 */
export declare function isPromise(val: unknown): val is Promise<unknown>;
/**
 * Check whether the input is **NOT** null or undefined.
 */
export declare function isPresent<T>(value: T): value is NonNullable<T>;

Source

Source