Skip to content

Commit

Permalink
Merge pull request #2760 from cantecim/patch-1
Browse files Browse the repository at this point in the history
fix(): fix clonePrimitiveLiteral result is undefined issue on Length decorator
  • Loading branch information
kamilmysliwiec authored Jan 15, 2024
2 parents 24d1976 + e5be51e commit 1fb1995
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/plugin/visitors/model-class.visitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ export class ModelClassVisitor extends AbstractFileVisitor {
return result;
}

const clonedMinLength = this.clonePrimitiveLiteral(factory, minLength);
const clonedMinLength = this.clonePrimitiveLiteral(factory, minLength) ?? minLength;
if (clonedMinLength) {
result.push(
factory.createPropertyAssignment('minLength', clonedMinLength)
Expand All @@ -649,7 +649,7 @@ export class ModelClassVisitor extends AbstractFileVisitor {
const clonedMaxLength = this.clonePrimitiveLiteral(
factory,
maxLength
);
) ?? maxLength;
if (clonedMaxLength) {
result.push(
factory.createPropertyAssignment('maxLength', clonedMaxLength)
Expand Down

0 comments on commit 1fb1995

Please sign in to comment.