Function backTrace

  • Creates an array of backtraced differences.

    Type Parameters

    • T

      The type of elements in the arrays.

    Parameters

    • A: T[]

      The first array.

    • B: T[]

      The second array.

    • current: FarthestPoint

      The current FarthestPoint.

    • swapped: boolean

      Boolean indicating if the arrays are swapped.

    • routes: Uint32Array

      The routes array.

    • diffTypesPtrOffset: number

      The offset of the diff types in the routes array.

    Returns {
        type: DiffType;
        value: T;
    }[]

    An array of backtraced differences.

    import { backTrace } from "@std/internal/diff";
    import { assertEquals } from "@std/assert";

    assertEquals(
    backTrace([], [], { y: 0, id: 0 }, false, new Uint32Array(0), 0),
    [],
    );