interface-forge - v2.5.0
    Preparing search index...

    Interface ZodFactoryOptions

    Options for configuring ZodFactory behavior.

    interface ZodFactoryOptions {
        fixtures?: FixtureConfiguration;
        generateFixture?: string | boolean;
        generators?: Record<string, () => unknown>;
        locale?: LocaleDefinition | LocaleDefinition[];
        maxDepth?: number;
        randomizer?: Randomizer;
    }

    Hierarchy (View Summary)

    Index

    Properties

    Fixture configuration for caching generated data

    generateFixture?: string | boolean

    Enable fixture generation/loading for this build.

    • true: Use default fixture path based on call stack
    • string: Use as fixture file path
    generators?: Record<string, () => unknown>

    Custom generator functions for specific field types.

    Generators are matched by the field's description metadata.

    const factory = new ZodFactory(schema, {
    generators: {
    // Schema field must have .describe('userId')
    userId: () => `USR_${Date.now()}`,
    customEmail: () => `test_${Date.now()}@example.com`
    }
    });
    maxDepth?: number
    randomizer?: Randomizer