• Splits a given string into chunks of a specified size.

    Parameters

    • data: string

      The string to be split into chunks.

    • OptionalchunkSize: number | bigint = 32760

      The size of each chunk. Defaults to 32760. Can be a number or a bigint.

    Returns string[]

    An array of strings, where each string is a chunk of the original data.

    If chunkSize is 0.

    If data is not a string.

    If chunkSize is neither a number nor a bigint.