refactor(schema): align array overload structure#49
Conversation
Merge ValidatorMap<T> and TypeGuard<T> | StandardSchemaV1<T, T> into
a single overload signature in _fn and OptionalizedArray, matching the
structure already used in ArraySchema. Reduces overload count and
eliminates structural divergence between type and implementation.
Also reorder (tree: {}) fallback to last position (per #46) and add
array type inference + runtime tests.
Closes #47
…-inference-improvements
Review notes (low severity)
|
Summary
Merges the split
ValidatorMap<T>andTypeGuard<T> | StandardSchemaV1<T, T>overloads in_fnandOptionalizedArrayinto a single combined overload, matching the structure already used inArraySchema.Changes
src/validators/schema/array.ts: merged_fnoverloads (2 → 1), mergedOptionalizedArrayoverloads (2 → 1), reordered(tree: {})lastsrc/validators/schema/types/ArraySchema.ts: reordered(tree: {})last (already done in fix(schema): preserve array element inference #46, included here for completeness)src/validators/__tests__/array.spec.ts: type inference + runtime tests (13 tests)Verification
Related
| undefined) — test updated accordingly