Fix $ZodErrorTree type: Allow undefined in error items array #4040
Annotations
5 errors
|
Test with TypeScript latest on Node lts/* (ubuntu-latest)
Process completed with exit code 1.
|
|
src/v4/classic/tests/error-utils.test.ts:
packages/zod/src/v4/classic/tests/error-utils.test.ts#L341
TypeCheckError: Type '{ errors string[]; properties? { username? { errors string[]; }; favoriteNumbers? { errors string[]; items? { errors string[]; }[]; }; nesting? { errors string[]; properties? { a? { errors string[]; }; }; }; }; }' does not satisfy the constraint '{ errors string[]; properties "Expected undefined, Actual ..." | "Expected ..., Actual ..."; }'.
Types of property 'properties' are incompatible.
Type '{ username? { errors string[]; }; favoriteNumbers? { errors string[]; items? { errors string[]; }[]; }; nesting? { errors string[]; properties? { a? { errors string[]; }; }; }; }' is not assignable to type '"Expected undefined, Actual ..." | "Expected ..., Actual ..."'.
❯ src/v4/classic/tests/error-utils.test.ts:341:34
|
|
Test with TypeScript 5.5 on Node lts/* (ubuntu-latest)
The strategy configuration was canceled because "test-node.ubuntu-latest_lts___lates" failed
|
|
Test with TypeScript 5.5 on Node lts/* (ubuntu-latest)
Process completed with exit code 1.
|
|
src/v4/classic/tests/error-utils.test.ts:
packages/zod/src/v4/classic/tests/error-utils.test.ts#L341
TypeCheckError: Type '{ errors string[]; properties? { username? { errors string[]; }; favoriteNumbers? { errors string[]; items? { errors string[]; }[]; }; nesting? { errors string[]; properties? { a? { errors string[]; }; }; }; }; }' does not satisfy the constraint '{ errors string[]; properties "Expected undefined, Actual ..." | "Expected ..., Actual ..."; }'.
Types of property 'properties' are incompatible.
Type '{ username? { errors string[]; }; favoriteNumbers? { errors string[]; items? { errors string[]; }[]; }; nesting? { errors string[]; properties? { a? { errors string[]; }; }; }; }' is not assignable to type '"Expected undefined, Actual ..." | "Expected ..., Actual ..."'.
❯ src/v4/classic/tests/error-utils.test.ts:341:34
|