fix(cli): give DiffFull.detail a single return shape

The binary branch returned an object without before/after while the normal
branch included them, so the result was a union and callers could not read
before/after without narrowing (the diff-full test failed typecheck). Return
before/after as undefined for binary files so the shape is uniform; JSON still
omits the undefined keys, so serialized output is unchanged.
This commit is contained in:
kirillk
2026-08-04 18:29:09 -04:00
parent 41e2bf5643
commit f09e628a4e
@@ -126,7 +126,9 @@ export namespace DiffFull {
deletions: Number.isFinite(deletions) ? deletions : 0,
status,
}
if (binary) return base
// Uniform shape across branches: binary files carry no content, but keep the keys present
// (undefined) so the return type is a single object, not a union missing before/after.
if (binary) return { ...base, before: undefined, after: undefined }
const content = yield* Effect.all(
{