UNPKG

nestjs-typebox

Version:

This library provides helper utilities for writing and validating NestJS APIs using [TypeBox](https://github.com/sinclairzx81/typebox) as an alternative to class-validator/class-transformer. Can be configured to patch @nestjs/swagger allowing OpenAPI gene

17 lines 709 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.configureNestJsTypebox = void 0; const errors_1 = require("@sinclair/typebox/errors"); const formats_js_1 = require("./formats.js"); const swagger_patch_js_1 = require("./swagger-patch.js"); const configureNestJsTypebox = (options) => { (0, errors_1.SetErrorFunction)(params => params.schema.errorMessage ?? (0, errors_1.DefaultErrorFunction)(params)); if (options?.patchSwagger) { (0, swagger_patch_js_1.patchNestJsSwagger)(); } if (options?.setFormats) { (0, formats_js_1.setFormats)(); } }; exports.configureNestJsTypebox = configureNestJsTypebox; //# sourceMappingURL=configure.js.map