Skip to content

Commit

Permalink
Fix extend body-parser type for body parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
cpfriend1721994 committed Apr 3, 2024
1 parent 5f90f07 commit 76f0b26
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions adapters/hyper-express-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,12 @@ export class HyperExpressAdapter extends AbstractHttpAdapter<
.forEach(parserKey => this.use(parserMiddleware[parserKey]));
}

public useBodyParser<Options = NestHyperExpressBodyParserOptions>(
public useBodyParser<Options extends (bodyparser.OptionsJson & bodyparser.OptionsUrlencoded & bodyparser.OptionsText & bodyparser.Options) | undefined = NestHyperExpressBodyParserOptions>(
type: NestHyperExpressBodyParserType,
rawBody: boolean,
options?: Omit<Options, 'verify'>,
): this {
const parserOptions = getBodyParserOptions<Options>(rawBody, options);
const parserOptions = getBodyParserOptions(rawBody, options);
const parser = bodyparser[type](parserOptions);

this.use(parser);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nnmt/platform-hyper-express",
"version": "0.1.3",
"version": "0.1.4",
"description": "NestJS Hyper-Express Adapter (@nnmt/platform-hyper-express)",
"author": "Nguyen Nhat Minh Tu",
"license": "MIT",
Expand Down

0 comments on commit 76f0b26

Please sign in to comment.