Skip to content

Commit

Permalink
fixup! Simplify minItems / maxItems tuple generation
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanbeevers committed Dec 16, 2024
1 parent d9be90f commit 0043750
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/openapi-typescript/src/transform/schema-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ function transformSchemaObjectCore(schemaObject: SchemaObject, options: Transfor

if (shouldGeneratePermutations && max !== undefined) {
return tsUnion(
Array.from({ length: max === undefined ? min : max - min + 1 }).map((_, index) => {
Array.from({ length: max - min + 1 }).map((_, index) => {
const tupleType = ts.factory.createTupleTypeNode(Array.from({ length: index + min }).map(() => itemType));
return options.ctx.immutable
? ts.factory.createTypeOperatorNode(ts.SyntaxKind.ReadonlyKeyword, tupleType)
Expand Down

0 comments on commit 0043750

Please sign in to comment.