BUPKIS
    Preparing search index...

    Module schema

    Arguably-useful Zod schemas for common types and validation patterns.

    This module provides reusable Zod schemas for validating constructors, functions, property keys, promises, and other common JavaScript types used throughout the assertion system. These tend to work around the impedance mismatch between BUPKIS and Zod.

    These are used internally, but consumers may also find them useful.

    For example, we have FunctionSchema which accepts any function—regardless of its signature. We need this because Zod v4's z.function() no longer returns a ZodType (ref: Zod v4 Migration Guide) and so behaves differently. FunctionSchema allows us to work with functions as values instead of something to be implemented.

    Similarly—but not a new development—z.promise() does not parse a Promise object; it parses the fulfilled value. This is not what we want for "is a Promise" assertions, but it can be useful for making sense of the fulfilled value. To solve this, we have WrappedPromiseLikeSchema (which explicitly supports PromiseLike/"thenable" objects).

    import * as schema from 'bupkis/schema';
    

    Schema

    Schemas for common types and validation patterns.

    AnyMapSchema
    AnySetSchema
    ArrayLikeSchema
    AsyncFunctionSchema
    ConstructibleSchema
    DateLikeFormatSchema
    DictionarySchema
    DurationFormatSchema
    DurationSchema
    FalsySchema
    FunctionSchema
    ISODateFormatSchema
    KeypathSchema
    MapSchema
    NonCollectionObjectSchema
    NonNegativeIntegerSchema
    NullProtoObjectSchema
    PrimitiveSchema
    PropertyKeySchema
    RegExpSchema
    SetSchema
    TimestampFormatSchema
    TruthySchema
    WrappedPromiseLikeSchema

    Variables

    AnyObjectSchema
    BigintSchema
    BooleanSchema
    DateSchema
    ErrorSchema
    InfinitySchema
    NegativeInfinitySchema
    NegativeNumberSchema
    NullSchema
    NumberSchema
    PositiveNumberSchema
    RegexpSchema
    StringSchema
    SymbolSchema
    UndefinedSchema
    UnknownArraySchema
    UnknownRecordSchema
    UnknownSchema
    WeakMapSchema
    WeakRefSchema
    WeakSetSchema