Prelude API
    Preparing search index...

    Function histogram

    • Performs a histogram-based diff between two arrays of strings. This algorithm is optimized for performance on large inputs by:

      1. Identifying unique matching lines between both arrays
      2. Using those unique matches as anchors to divide the diff problem
      3. Applying Myers diff algorithm to the smaller segments between anchors

      Parameters

      • sourceLines: string[]

        Source array of strings to compare

      • targetLines: string[]

        Target array of strings to compare against

      Returns L.Diff.T[]

      Array of diff operations (added, deleted, unchanged) representing the changes