Skip to main content

createBlueprint

Callable


  • Can be used to generate a blueprint object for use within optimal checks. All supported optimal schemas are passed as an object to the factory.

    import { createBlueprint } from '@boost/common';
    import { optimal } from '@boost/common/optimal';

    const blueprint = createBlueprint(({ string, number }) => ({
    name: string().required(),
    age: number().gt(0),
    }));

    const object = optimal(blueprint).validate({});

    Type parameters

    • T: object