summaryrefslogtreecommitdiff
path: root/testing/diff.ts
diff options
context:
space:
mode:
authorVincent LE GOFF <g_n_s@hotmail.fr>2019-04-24 13:41:23 +0200
committerRyan Dahl <ry@tinyclouds.org>2019-04-24 07:41:22 -0400
commitdcd01dd02530df0e799eb4227087680ffeb80d74 (patch)
tree8cc1dec75dd17c326fea6d7fe471b7e7a31032f7 /testing/diff.ts
parente1f7a60bb326f8299f339635c0738d28431afa0a (diff)
Eslint fixes (denoland/deno_std#356)
Make warnings fail Original: https://github.com/denoland/deno_std/commit/4543b563a9a01c8c168aafcbfd9d4634effba7fc
Diffstat (limited to 'testing/diff.ts')
-rw-r--r--testing/diff.ts26
1 files changed, 18 insertions, 8 deletions
diff --git a/testing/diff.ts b/testing/diff.ts
index e951032f5..4c96b3b28 100644
--- a/testing/diff.ts
+++ b/testing/diff.ts
@@ -54,12 +54,18 @@ export default function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> {
if (!M && !N && !suffixCommon.length && !prefixCommon.length) return [];
if (!N) {
return [
- ...prefixCommon.map(c => ({ type: DiffType.common, value: c })),
- ...A.map(a => ({
- type: swapped ? DiffType.added : DiffType.removed,
- value: a
- })),
- ...suffixCommon.map(c => ({ type: DiffType.common, value: c }))
+ ...prefixCommon.map(
+ (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 })
+ )
];
}
const offset = N;
@@ -198,8 +204,12 @@ export default function diff<T>(A: T[], B: T[]): Array<DiffResult<T>> {
);
}
return [
- ...prefixCommon.map(c => ({ type: DiffType.common, value: c })),
+ ...prefixCommon.map(
+ (c): DiffResult<typeof c> => ({ type: DiffType.common, value: c })
+ ),
...backTrace(A, B, fp[delta + offset], swapped),
- ...suffixCommon.map(c => ({ type: DiffType.common, value: c }))
+ ...suffixCommon.map(
+ (c): DiffResult<typeof c> => ({ type: DiffType.common, value: c })
+ )
];
}