diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2020-07-14 15:24:17 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-14 15:24:17 -0400 |
commit | cde4dbb35132848ffece59ef9cfaccff32347124 (patch) | |
tree | cc7830968c6decde704c8cfb83c9185193dc698f /std/testing/diff.ts | |
parent | 9eca71caa1674c31f9cc5d4e86c03f10b59e0a00 (diff) |
Use dprint for internal formatting (#6682)
Diffstat (limited to 'std/testing/diff.ts')
-rw-r--r-- | std/testing/diff.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/std/testing/diff.ts b/std/testing/diff.ts index da1e827ac..3a9eca4bb 100644 --- a/std/testing/diff.ts +++ b/std/testing/diff.ts @@ -41,7 +41,7 @@ export default function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> { const suffixCommon = createCommon( A.slice(prefixCommon.length), B.slice(prefixCommon.length), - true + true, ).reverse(); A = suffixCommon.length ? A.slice(prefixCommon.length, -suffixCommon.length) @@ -57,16 +57,16 @@ export default function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> { if (!N) { return [ ...prefixCommon.map( - (c): DiffResult<typeof c> => ({ type: DiffType.common, value: c }) + (c): DiffResult<typeof c> => ({ type: DiffType.common, value: c }), ), ...A.map( (a): DiffResult<typeof a> => ({ type: swapped ? DiffType.added : DiffType.removed, value: a, - }) + }), ), ...suffixCommon.map( - (c): DiffResult<typeof c> => ({ type: DiffType.common, value: c }) + (c): DiffResult<typeof c> => ({ type: DiffType.common, value: c }), ), ]; } @@ -91,7 +91,7 @@ export default function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> { A: T[], B: T[], current: FarthestPoint, - swapped: boolean + swapped: boolean, ): Array<{ type: DiffType; value: T; @@ -133,7 +133,7 @@ export default function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> { slide: FarthestPoint, down: FarthestPoint, k: number, - M: number + M: number, ): FarthestPoint { if (slide && slide.y === -1 && down && down.y === -1) { return { y: 0, id: 0 }; @@ -163,7 +163,7 @@ export default function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> { down: FarthestPoint, _offset: number, A: T[], - B: T[] + B: T[], ): FarthestPoint { const M = A.length; const N = B.length; @@ -189,7 +189,7 @@ export default function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> { fp[k + 1 + offset], offset, A, - B + B, ); } for (let k = delta + p; k > delta; --k) { @@ -199,7 +199,7 @@ export default function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> { fp[k + 1 + offset], offset, A, - B + B, ); } fp[delta + offset] = snake( @@ -208,16 +208,16 @@ export default function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> { fp[delta + 1 + offset], offset, A, - B + B, ); } return [ ...prefixCommon.map( - (c): DiffResult<typeof c> => ({ type: DiffType.common, value: c }) + (c): DiffResult<typeof c> => ({ type: DiffType.common, value: c }), ), ...backTrace(A, B, fp[delta + offset], swapped), ...suffixCommon.map( - (c): DiffResult<typeof c> => ({ type: DiffType.common, value: c }) + (c): DiffResult<typeof c> => ({ type: DiffType.common, value: c }), ), ]; } |