BUPKIS
    Preparing search index...

    Variable SetSchemaConst

    SetSchema: ZodCustom<Set<unknown>, Set<unknown>> = ...

    Schema that matches any Set instance, including those with any element types.

    This schema is designed for runtime type checking and assertion matching rather than parsing or validation of Set contents. It uses instanceof checking to verify that a value is a Set, regardless of what elements it contains.

    Usage in Assertions:

    • Collection size validation: expect(mySet, 'to have size', 3)
    • Set operations: expect(setA, 'to be a subset of', setB)
    • Emptiness checks: expect(mySet, 'to be empty')
    • Element containment: expect(mySet, 'to contain', value)

    Why instanceof Instead of Zod's z.set():

    • z.set() requires knowing the element schema at compile time
    • This schema works with Sets containing any element types
    • Focuses on the Set structure rather than element validation
    • Better performance for assertion matching scenarios
    // Matches any Set regardless of element types
    SetSchema.parse(new Set([1, 2, 3])); // ✓ passes
    SetSchema.parse(new Set(['a', 'b'])); // ✓ passes
    SetSchema.parse(new Set()); // ✓ passes (empty Set)
    SetSchema.parse([]); // ✗ fails (not a Set)
    SetSchema.parse(new WeakSet()); // ✗ fails (use AnySetSchema)