@kubb/plugin-ts 3.10.4 → 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.
@@ -35,9 +35,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
35
35
  mod
36
36
  ));
37
37
 
38
- // ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.5_@types+node@20.17.31__jiti@2.4.2_postcss@8.5.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
38
+ // ../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.5_@types+node@20.17.32__jiti@2.4.2_postcss@8.5.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js
39
39
  var init_esm_shims = __esm({
40
- "../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.5_@types+node@20.17.31__jiti@2.4.2_postcss@8.5.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js"() {
40
+ "../../node_modules/.pnpm/tsup@8.4.0_@microsoft+api-extractor@7.52.5_@types+node@20.17.32__jiti@2.4.2_postcss@8.5.3_typescript@5.8.3_yaml@2.7.0/node_modules/tsup/assets/esm_shims.js"() {
41
41
  }
42
42
  });
43
43
 
@@ -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-CQPXWZFH.js.map
2573
- //# sourceMappingURL=chunk-CQPXWZFH.js.map
2589
+ //# sourceMappingURL=chunk-6Z4VW7HA.js.map
2590
+ //# sourceMappingURL=chunk-6Z4VW7HA.js.map