@kubb/plugin-ts 3.10.5 → 3.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XYPHODCL.js → chunk-6Z4VW7HA.js} +21 -4
- package/dist/{chunk-5PM37XL2.cjs.map → chunk-6Z4VW7HA.js.map} +1 -1
- package/dist/{chunk-6S26IDCZ.cjs → chunk-NDFIM3JY.cjs} +11 -11
- package/dist/{chunk-6S26IDCZ.cjs.map → chunk-NDFIM3JY.cjs.map} +1 -1
- package/dist/{chunk-3UQESUKQ.js → chunk-REZ3I5MV.js} +3 -3
- package/dist/{chunk-3UQESUKQ.js.map → chunk-REZ3I5MV.js.map} +1 -1
- package/dist/{chunk-5PM37XL2.cjs → chunk-SBVGN5GX.cjs} +21 -4
- package/dist/chunk-SBVGN5GX.cjs.map +1 -0
- package/dist/components.cjs +3 -3
- package/dist/components.js +1 -1
- package/dist/generators.cjs +4 -4
- package/dist/generators.js +2 -2
- package/dist/index.cjs +4 -4
- package/dist/index.js +2 -2
- package/package.json +9 -9
- package/src/generators/__snapshots__/enumArray20.ts +1 -1
- package/src/parser.ts +33 -1
- package/dist/chunk-XYPHODCL.js.map +0 -1
|
@@ -2242,10 +2242,24 @@ var typeKeywordMapper = {
|
|
|
2242
2242
|
}
|
|
2243
2243
|
return factory.createArrayDeclaration({ nodes });
|
|
2244
2244
|
},
|
|
2245
|
-
tuple: (nodes) => {
|
|
2245
|
+
tuple: (nodes, rest, min, max) => {
|
|
2246
2246
|
if (!nodes) {
|
|
2247
2247
|
return void 0;
|
|
2248
2248
|
}
|
|
2249
|
+
if (max) {
|
|
2250
|
+
nodes = nodes.slice(0, max);
|
|
2251
|
+
if (nodes.length < max && rest) {
|
|
2252
|
+
nodes = [...nodes, ...Array(max - nodes.length).fill(rest)];
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2255
|
+
if (min) {
|
|
2256
|
+
nodes = nodes.map(
|
|
2257
|
+
(node, index) => index >= min ? factory.createOptionalTypeNode(node) : node
|
|
2258
|
+
);
|
|
2259
|
+
}
|
|
2260
|
+
if (typeof max === "undefined" && rest) {
|
|
2261
|
+
nodes.push(factory.createRestTypeNode(factory.createArrayTypeNode(rest)));
|
|
2262
|
+
}
|
|
2249
2263
|
return factory.createTupleTypeNode(nodes);
|
|
2250
2264
|
},
|
|
2251
2265
|
enum: (name) => {
|
|
@@ -2350,7 +2364,10 @@ function parse({ current, siblings, name }, options) {
|
|
|
2350
2364
|
}
|
|
2351
2365
|
if (isKeyword(current, schemaKeywords.tuple)) {
|
|
2352
2366
|
return typeKeywordMapper.tuple(
|
|
2353
|
-
current.args.items.map((schema) => parse({ name, current: schema, siblings }, options)).filter(Boolean)
|
|
2367
|
+
current.args.items.map((schema) => parse({ name, current: schema, siblings }, options)).filter(Boolean),
|
|
2368
|
+
current.args.rest && (parse({ name, current: current.args.rest, siblings }, options) ?? void 0),
|
|
2369
|
+
current.args.min,
|
|
2370
|
+
current.args.max
|
|
2354
2371
|
);
|
|
2355
2372
|
}
|
|
2356
2373
|
if (isKeyword(current, schemaKeywords.const)) {
|
|
@@ -2569,5 +2586,5 @@ react/cjs/react.development.js:
|
|
|
2569
2586
|
*/
|
|
2570
2587
|
|
|
2571
2588
|
export { OasType, Type2 as Type, init_esm_shims };
|
|
2572
|
-
//# sourceMappingURL=chunk-
|
|
2573
|
-
//# sourceMappingURL=chunk-
|
|
2589
|
+
//# sourceMappingURL=chunk-6Z4VW7HA.js.map
|
|
2590
|
+
//# sourceMappingURL=chunk-6Z4VW7HA.js.map
|