chanlito / nestjs-extensions Goto Github PK
View Code? Open in Web Editor NEW[WIP] A bunch of useful and opinionated filters, modules, pipes... to use with Nest framework. ๐ป
[WIP] A bunch of useful and opinionated filters, modules, pipes... to use with Nest framework. ๐ป
It's nice that nest will convert post bodies to an entity/dto, but I want the same functionality for coercing params into an object as well. In Spring, this is handled by @ModelAttribute.
Could the DtoPipe be modified to do this?
Currently the only extension I'd like to use in my project is the DtoPipe/Dto. However, if I just add a normal import like:
import { DtoPipe } from 'nestjs-extensions';
Even though I'm only importing DtoPipe (and similarly Dto in the entity), node complains that I need to install ALL of this libs dependencies, including things like mandrill, sequelize, etc., things I have no need for. If I change the import to:
import { DtoPipe } from 'nestjs-extensions/dist/dto';
Then everything works as expected, without having to install anything additional. Is this the recommended way to bring in just one "module" or extension from this project? Is there a better way?
Hi, you can update 0.7.1 version to include the validations, please.
On version 4.6.5 updates say:
HttpException
extends Error
RpcException
extends Error
WsException
extends Error
In your code base by checking instanceof
Error will make every exception to status 500
if (err instanceof Error) {
console.error(errTitle, err);
const statusCode = HttpStatus.INTERNAL_SERVER_ERROR;
res.status(statusCode).json({
statusCode,
message: 'Internal Server Error'
});
}
Title says it all.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.