Skip to content

Commit 28fef1f

Browse files
committed
fixup! Supports minItems / maxItems
1 parent fd2d805 commit 28fef1f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/transform/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export function transformSchemaObj(node: any, options: TransformSchemaObjOptions
194194
: undefined;
195195

196196
const estimateCodeSize =
197-
maxItems === undefined ? minItems : (maxItems * (maxItems + 1) - minItems * (minItems + 1)) / 2;
197+
maxItems === undefined ? minItems : (maxItems * (maxItems + 1) - minItems * (minItems - 1)) / 2;
198198
const items = node.items ? transformSchemaObj(node.items as any, options) : "unknown";
199199
if ((minItems !== 0 || maxItems !== undefined) && options.supportArrayLength && estimateCodeSize < 30) {
200200
if (maxItems === undefined) {

0 commit comments

Comments
 (0)