Skip to content

Commit

Permalink
fix(openapi-sampler): fix formatting
Browse files Browse the repository at this point in the history
closes #246
  • Loading branch information
ostridm committed Aug 13, 2024
1 parent 3f97800 commit 3db8fda
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/openapi-sampler/src/samplers/StringSampler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ export class StringSampler implements Sampler {
randExp.max = max ?? randExp.max;
const result = randExp.gen();

return max !== undefined && result.length > max && this.hasInfiniteQuantifier(pattern)
return max !== undefined &&
result.length > max &&
this.hasInfiniteQuantifier(pattern)
? this.sampleWithMaxLength(randExp, max)
: result;
}
Expand Down

0 comments on commit 3db8fda

Please sign in to comment.