• Split a list of nodes based on whether splitFunc returns true. If onlySplitOnFirstOccurrence is set to true in the options object, then there will be at most two segments returned.

    Parameters

    • nodes: Node[]
    • splitFunc: ((node) => boolean) = ...
        • (node): boolean
        • Parameters

          Returns boolean

    • Optional options: {
          onlySplitOnFirstOccurrence?: boolean;
      }
      • Optional onlySplitOnFirstOccurrence?: boolean

    Returns {
        segments: Node[][];
        separators: Node[];
    }

Generated using TypeDoc