@nyaomaru/divider
    Preparing search index...

    Function dividerLoop

    • Divides input into chunks of specified size with optional configuration.

      This function provides a way to split input into equal-sized chunks with additional control:

      • Can specify starting offset for the chunking
      • Can limit the maximum number of chunks produced
      • Supports both string and array inputs
      • When maxChunks is specified, remaining content is merged into the last chunk

      Type Parameters

      Parameters

      • input: T

        String or array of strings to divide into chunks

      • size: number

        Size of each chunk

      • Optionaloptions: O

        Configuration options for chunking behavior

      Returns DividerResult<T, O>

      Array of chunks based on input type and options

      dividerLoop("abcdef", 2) // returns ["ab", "cd", "ef"]
      dividerLoop("abcdef", 2, { maxChunks: 2 }) // returns ["ab", "cdef"]