Options
All
  • Public
  • Public/Protected
  • All
Menu

Module check

Check Like Functions

checkIsArrayLike

  • checkIsArrayLike(arrayLike: unknown): boolean
  • name

    checkIsArrayLike

    since

    0.0.96

    Parameters

    • arrayLike: unknown

    Returns boolean

checkIsErrorLike

  • checkIsErrorLike(errorLike: unknown): boolean
  • name

    checkIsErrorLike

    description

    Check is value is error-like object.

    summary

    import { checkIsErrorLike } from "@corefunc/corefunc/check/is-error-like";

    since

    0.3.29

    example

    checkIsErrorLike(new Error("Smth is wrong")) ➜ true

    example

    checkIsErrorLike({ message: "Smth is wrong", name: "Error" }) ➜ true

    Parameters

    • errorLike: unknown

      Object to be checked.

    Returns boolean

checkIsObjectLike

  • checkIsObjectLike(value: any): boolean
  • name

    checkIsObjectLike

    description

    Checks if value is object-like. A value is object-like if it's not null and has a typeof result of "object".

    example

    checkIsObjectLike({}); ➜ true

    example

    checkIsObjectLike([1, 2, 3]); ➜ true

    example

    checkIsObjectLike(() => {}); ➜ false

    example

    checkIsObjectLike(null); ➜ false

    since

    0.0.1

    Parameters

    • value: any

      The value to check

    Returns boolean

    Returns true if value is object-like, else false

Check Type Functions

checkIsPrimitive

  • checkIsPrimitive(value: unknown): boolean
  • name

    checkIsPrimitive

    description

    Return true on boolean, string, number, BigInt, null, Symbol and undefined

    summary

    import { checkIsPrimitive } from "@corefunc/corefunc/check/is-primitive";

    Parameters

    • value: unknown

    Returns boolean

    Returns true if the given value is a primitive type. Otherwise, returns false.

checkIsTypedArray

  • checkIsTypedArray(value: any): boolean
  • name

    checkIsTypedArray

    description

    Checks if an array is typed.

    summary

    import { checkIsTypedArray } from '@corefunc/corefunc/check/is-typed-array';

    example

    checkIsTypedArray([]) ➜ false

    example

    checkIsTypedArray(new Int16Array(1)) ➜ true

    example

    checkIsTypedArray(new Float64Array(1)) ➜ true

    example

    checkIsTypedArray(new Uint32Array(1)) ➜ true

    since

    0.1.68

    Parameters

    • value: any

    Returns boolean

    Is typed array.

isIntPositive

  • isIntPositive(value: any): boolean
  • name

    isIntPositive

    description

    Is positive integer.

    summary

    import { isIntPositive } from "@corefunc/corefunc/check/is-int-positive";

    since

    0.3.41

    Parameters

    • value: any

      Number to check.

    Returns boolean

    • Is positive integer.

Other Functions

checkIsArrayKnown

  • checkIsArrayKnown<A>(array: A): array
  • name

    checkIsArrayKnown

    example

    const arrayOfStrings = ["A", "B", "C"]; const arrayOfNumbers = [1, 2, 3]; isArrayKnown<number[]>(arrayOfStrings); // TS2345: Argument of type 'string[]' is not assignable to parameter of type 'number[]'. // Type 'string' is not assignable to type 'number'. isArrayKnown<string[]>(arrayOfStrings); // OK isArrayKnown<number[]>(arrayOfNumbers); // OK isArrayKnown<string[]>(arrayOfNumbers); // TS2345: Argument of type 'number[]' is not assignable to parameter of type 'string[]'. // Type 'number' is not assignable to type 'string'.

    Type parameters

    • A: unknown[]

    Parameters

    • array: A

    Returns array

checkIsCallable

  • checkIsCallable(value: any): boolean
  • Parameters

    • value: any

    Returns boolean

checkIsFalsy

  • checkIsFalsy(value: any): boolean
  • Parameters

    • value: any

    Returns boolean

checkIsFunctionArrow

  • checkIsFunctionArrow<F>(callable: F): boolean
  • Type parameters

    • F: Function

    Parameters

    • callable: F

    Returns boolean

checkIsIterable

  • checkIsIterable(object: object): boolean
  • Parameters

    • object: object

    Returns boolean

checkIsKeyed

  • checkIsKeyed(value: any): boolean
  • Parameters

    • value: any

    Returns boolean

checkIsObjectPlain

  • checkIsObjectPlain(value: any): boolean
  • Checks if the value is created by the Object constructor.

    Parameters

    • value: any

    Returns boolean

checkIsSame

  • checkIsSame(value1: any, value2: any): boolean
  • Returns true if the values are the same value, false otherwise.

    Parameters

    • value1: any
    • value2: any

    Returns boolean

checkIsTimeStamp

  • checkIsTimeStamp(theDate: number | string): boolean
  • description

    Checks if value is an time stamp

    Parameters

    • theDate: number | string

    Returns boolean

checkIsTraversable

  • checkIsTraversable(value: any): boolean
  • name

    checkIsTraversable

    description

    Checks if value is traversable

    since

    0.0.1

    Parameters

    • value: any

      The value to check

    Returns boolean

checkIsTrueish

  • checkIsTrueish(value: any): boolean
  • Parameters

    • value: any

    Returns boolean

Generated using TypeDoc