Skip to content

Commit

Permalink
feat: Make options optional (#42)
Browse files Browse the repository at this point in the history
Currently `ValidationPipe` requires `options` to be defined, forcing you
to include a default e.g. `{}` if you don't have any options to specify.
  • Loading branch information
jmcdo29 authored May 8, 2024
2 parents 1674d2e + 482b43f commit b5fdced
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/serious-eels-eat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@nest-lab/typeschema': patch
---

fix: make `options` optional
2 changes: 1 addition & 1 deletion packages/typeschema/src/lib/typeschema.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class ValidationPipe implements PipeTransform {
constructor(
@Optional()
@Inject(TypeschemaOptions)
private readonly options: ValidationPipeOptions,
private readonly options?: ValidationPipeOptions,
@Optional() protected readonly logger?: Logger
) {}
async transform(value: unknown, metadata: ArgumentMetadata) {
Expand Down

0 comments on commit b5fdced

Please sign in to comment.