@mercury-labs/nest-auth
Version:
Mercury framework auth library. It supports local auth, jwt with both bearer token and cookie, basic auth.
15 lines • 483 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateEntity = void 0;
const common_1 = require("@nestjs/common");
async function validateEntity(value, toEntity, whitelist = false) {
return await new common_1.ValidationPipe({
transform: true,
whitelist,
}).transform(value, {
type: 'body',
metatype: toEntity,
});
}
exports.validateEntity = validateEntity;
//# sourceMappingURL=validate-entity.js.map
;