fix(types): resolve zod v3 type inference differences in task tools
zod v3 infers .default([]) fields as string[] | undefined in z.infer output type (unlike v4 which marks them as string[]). Add nullish coalescing guards and use any[] for the readJsonSafe result array to avoid the type mismatch in task-list and task-update.
This commit is contained in:
@@ -114,12 +114,12 @@ async function handleUpdate(
|
||||
|
||||
const addBlocks = args.addBlocks as string[] | undefined;
|
||||
if (addBlocks) {
|
||||
task.blocks = [...new Set([...task.blocks, ...addBlocks])];
|
||||
task.blocks = [...new Set([...(task.blocks ?? []), ...addBlocks])];
|
||||
}
|
||||
|
||||
const addBlockedBy = args.addBlockedBy as string[] | undefined;
|
||||
if (addBlockedBy) {
|
||||
task.blockedBy = [...new Set([...task.blockedBy, ...addBlockedBy])];
|
||||
task.blockedBy = [...new Set([...(task.blockedBy ?? []), ...addBlockedBy])];
|
||||
}
|
||||
|
||||
if (validatedArgs.metadata !== undefined) {
|
||||
|
||||
Reference in New Issue
Block a user