@plugjs/plug
Version:
PlugJS Build System ===================
19 lines (18 loc) • 863 B
TypeScript
/** Identifies a single change */
export interface Change {
/** The position in the Left-Hand side where items were deleted */
lhsPos: number;
/** The number of items deleted from the Left-Hand side */
lhsDel: number;
/** The position in the Right-Hand side where items were added */
rhsPos: number;
/** The number of items added to the Right-Hand side */
rhsAdd: number;
}
/**
* Compare the _Left-Hand side_ {@link Iterable} to _Right-Hand side_ one,
* producing an array of {@link Change | Changes} identifying the differences.
*/
export declare function diff<T, I extends Iterable<T> = Iterable<T>>(lhs: I, rhs: I): Change[];
/** Produce a textual diff between two values. */
export declare function textDiff(lhs: any, rhs: any, add?: (s: string) => string, del?: (s: string) => string, not?: (s: string) => string): string;