simioni / nest-standard-response

Standardized and configurable API responses for NestJS
https://www.npmjs.com/package/nest-standard-response
MIT License
7 stars 1 forks source link

setMessage is possibly undefined #3

Open egdelwonk opened 1 month ago

egdelwonk commented 1 month ago

Hi! First, thanks for a great library, it seems very useful so far.

For some reason, when calling params.setMessage() using the @StandardParams parameter decorator, typescript complains that it is possible undefined:

image

Looking at the types definition, it looks like the interface declares it as optional. Is this expected? Is there a preferred way to ensure the call to setMessage is type-safe?

image