From 3db8fdac50f435aa022bda87346b075c47e325ca Mon Sep 17 00:00:00 2001 From: Dmitry Ostrikov Date: Tue, 13 Aug 2024 19:53:30 +0300 Subject: [PATCH] fix(openapi-sampler): fix formatting closes #246 --- packages/openapi-sampler/src/samplers/StringSampler.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/openapi-sampler/src/samplers/StringSampler.ts b/packages/openapi-sampler/src/samplers/StringSampler.ts index bd6bacfc..f2f70e99 100644 --- a/packages/openapi-sampler/src/samplers/StringSampler.ts +++ b/packages/openapi-sampler/src/samplers/StringSampler.ts @@ -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; }