• Filters sliding windows of elements in the array based on a predicate function.

    Type Parameters

    • T

      The type of elements in the items array.

    Parameters

    • items: T[]

      The array of items to process.

    • fn: ((items, start, collection) => boolean)

      The function to test each sliding window.

        • (items, start, collection): boolean
        • Parameters

          • items: T[]
          • start: number
          • collection: T[]

          Returns boolean

    • Optional options: {
          increments: undefined | number;
          start: undefined | number;
          windowSize: undefined | number;
      } = {}

      The options for sliding window (start index, window size, and increments).

      • increments: undefined | number
      • start: undefined | number
      • windowSize: undefined | number

    Returns T[][]

    • An array of sliding windows that pass the test implemented by the provided function.

Generated using TypeDoc