The assertion parts to convert to slots
// Phrase-first assertion gets subject slot
type Slots1 = AssertionSlots<['to be a string']>;
// Result: [z.ZodUnknown, PhraseLiteralSlot<'to be a string'>]
// Schema-first assertion preserves structure
type Slots2 = AssertionSlots<[z.string(), 'to match', z.regexp()]>;
// Result: [z.ZodString, PhraseLiteralSlot<'to match'>, z.ZodRegExp]
Tuple type representing all validation slots derived from assertion parts.
This type processes assertion parts to create a tuple of Zod schemas that can be used for runtime argument validation. If the first part is a phrase, a subject slot (
z.ZodUnknown
) is automatically prepended to accept the assertion subject.The resulting tuple:
never
entries filtered out to maintain proper tuple structure