refactor: fix exit-1 comment, remove JSON round-trip, use OfficeMeta cast
This commit is contained in:
@@ -37,6 +37,7 @@ export function createDifferAdapter(
|
||||
if (!result.ok) {
|
||||
const e = result.error;
|
||||
if (e.kind === "non_zero_exit" && e.exitCode === 1) {
|
||||
// docx-diff exits 1 when documents have differences — this is a success path
|
||||
} else if (e.kind === "non_zero_exit") {
|
||||
throw new Error(`differ: docx-diff failed (exit ${e.exitCode}): ${e.stderr}`);
|
||||
} else if (e.kind === "timeout") {
|
||||
@@ -52,8 +53,7 @@ export function createDifferAdapter(
|
||||
throw new Error(`differ: report file not found: ${reportPath}`);
|
||||
}
|
||||
|
||||
const raw = JSON.stringify({ outputDocx, sourceDocx, diffReport: reportPath });
|
||||
const meta = schema.parse(JSON.parse(raw)) as T;
|
||||
const meta = schema.parse({ outputDocx, sourceDocx, diffReport: reportPath });
|
||||
return { meta, childThread: null };
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user