corps/json-delta

TS2322: Type 'AnyJson[] | null' is not assignable to type 'void | AnyJson[]'

jantimon opened this issue · 0 comments

the lcs function return type is AnyJson[] | void however it returns null in line 282:

json-delta/index.ts

Lines 274 to 283 in 41275a6

export function lcs(
a: AnyJson[],
b: AnyJson[],
tolerance = a.length + b.length
): AnyJson[] | void {
let result: AnyJson[] = [];
return arrDiff(a, b, tolerance, aIdx => result.push(a[aIdx]))
? result.reverse()
: null;
}

I can prepare a PR if it helps