BUPKIS
    Preparing search index...

    Type Alias AssertionSlot<Part>

    AssertionSlot: Part extends string
        ? PhraseLiteralSlot<Part>
        : Part extends readonly [string, ...string[]]
            ? PhraseLiteralChoiceSlot<Part>
            : Part extends z.ZodType
                ? Part
                : Part extends StandardSchemaV1 ? z.ZodType : never

    Type-level mapping that converts an assertion part to its corresponding validation slot.

    This maps each type of assertion part to a specific Zod schema that can be used for runtime validation:

    • String literals become branded phrase literal slots
    • String literal choices become branded phrase choice slots
    • Zod types are preserved as-is
    • Standard Schema validators become Zod types (see note below)
    • Invalid parts become never

    Important: Standard Schema parts are typed as z.ZodType because at runtime they are wrapped in z.custom() by slotify. This type reflects the runtime reality rather than the input type. The wrapper allows slots to use Zod's .safeParse() and .def properties uniformly, while the Standard Schema's actual validation is called internally.

    Order matters: Must check z.ZodType before StandardSchemaV1 because Zod v4 implements Standard Schema v1, so all Zod types would match both.

    Type Parameters

    • Part extends AssertionPart

      The assertion part to convert to a slot

    // String literal -> branded slot
    type Slot1 = AssertionSlot<'to be a string'>; // PhraseLiteralSlot<'to be a string'>

    // Choice -> branded choice slot
    type Slot2 = AssertionSlot<['to be', 'to equal']>; // PhraseLiteralChoiceSlot<['to be', 'to equal']>

    // Zod type -> preserved
    type Slot3 = AssertionSlot<z.ZodString>; // z.ZodString

    // Standard Schema -> wrapped at runtime
    type Slot4 = AssertionSlot<v.string()>; // z.ZodType (generic, not specific wrapper type)