UNPKG

@tunnel-cast/nestjs

Version:

## About This is a Tunnel-Cast - NestJS integration package, wrap the `cast` application into the `NestJS` building blocks.

18 lines 696 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.transformLeanError = void 0; function transformLeanError(errors) { if (errors === null || errors === void 0 ? void 0 : errors.every(e => e.code != undefined)) { return errors.map(({ code }) => ({ code })); } else if (errors === null || errors === void 0 ? void 0 : errors.every(e => e.fieldName != undefined)) { return errors.map(e => { return { fieldName: e.fieldName, errors: transformLeanError(e.errors) }; }); } } exports.transformLeanError = transformLeanError; //# sourceMappingURL=transform-lean-error.js.map