Class ArrayUtils

Constructors

Properties

chunk: <T>(arr: T[], size: number) => T[][] = chunk

Split an array into smaller chunks

Type declaration

    • <T>(arr: T[], size: number): T[][]
    • Type Parameters

      • T

      Parameters

      • arr: T[]

        The array to split

      • size: number

        The size of each chunk

      Returns T[][]

      An array of chunks

join: <T extends unknown[]>(arr: T, options?: JoinOptions) => string = join

Join an array of strings with a limit

Type declaration

    • <T extends unknown[]>(arr: T, options?: JoinOptions): string
    • Type Parameters

      • T extends unknown[]

      Parameters

      • arr: T

        The array of strings to join

      • options: JoinOptions = {}

        The options to use

      Returns string

      The joined string

Methods

  • Parameters

    • arr: unknown[]

    Returns arr is boolean[]

  • Parameters

    • arr: unknown[]

    Returns arr is number[]

  • Parameters

    • arr: unknown[]

    Returns arr is Record<string, unknown>[]

  • Parameters

    • arr: unknown[]

    Returns arr is string[]