Skip to content

Commit

Permalink
fix: check if keys with validation constraints exist
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilmysliwiec committed Aug 1, 2023
1 parent 1f95b61 commit 72da365
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/type-helpers/partial-type.helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ export function PartialType<T>(classRef: Type<T>): Type<Partial<T>> {
classRef,
PartialTypeClass
);
keysWithValidationConstraints
.filter((key) => !fields.includes(key))
.forEach((key) => applyIsOptionalDecorator(PartialTypeClass, key));
if (keysWithValidationConstraints) {
keysWithValidationConstraints
.filter((key) => !fields.includes(key))
.forEach((key) => applyIsOptionalDecorator(PartialTypeClass, key));
}

inheritTransformationMetadata(classRef, PartialTypeClass);

Expand Down

0 comments on commit 72da365

Please sign in to comment.