0

I new in TypeScript I try to use app.response.sendWrapped but show error "Property 'sendWrapped' does not exist on type 'Response<any, Record<string, any>, number>'.ts(2339)"

This my code

// At this show "Property 'sendWrapped' does not exist on type 'Response<any, Record<string, any>, number>'".
app.response.sendWrapped = function (statusCode: number, message: string, data?: any) {
  return this.status(statusCode)
    .send({
      status: statusCode,
      message,
      data,
    });
};

Can somone fix this?

  • Please provide enough code so others can better understand or reproduce the problem. – Community May 26 '23 at 07:48
  • Does this answer your question? [Extend Express Request object using Typescript](https://stackoverflow.com/questions/37377731/extend-express-request-object-using-typescript) – Yury Tarabanko May 27 '23 at 11:30

0 Answers0