@kubb/plugin-ts 5.0.0-beta.103 → 5.0.0-beta.109

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/index.cjs CHANGED
@@ -32,7 +32,7 @@ var __copyProps = (to, from, except, desc) => {
32
32
  }
33
33
  return to;
34
34
  };
35
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
35
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
36
36
  value: mod,
37
37
  enumerable: true
38
38
  }) : target, mod));
@@ -1017,13 +1017,24 @@ function resolveContentTypeVariants(entries, baseName) {
1017
1017
  };
1018
1018
  });
1019
1019
  }
1020
+ const operationParameterGroupsByNode = /* @__PURE__ */ new WeakMap();
1021
+ /**
1022
+ * Groups an operation's parameters by location (`path`/`query`/`header`/`cookie`), deduping each
1023
+ * group by name. Every plugin generator visiting the same `OperationNode` shares one AST instance
1024
+ * (see `KubbDriver`), so the result is cached per node to avoid re-filtering and re-deduping the
1025
+ * same parameters once per plugin.
1026
+ */
1020
1027
  function getOperationParameters(node) {
1021
- return {
1028
+ const cached = operationParameterGroupsByNode.get(node);
1029
+ if (cached) return cached;
1030
+ const groups = {
1022
1031
  path: dedupeParams(node.parameters.filter((param) => param.in === "path")),
1023
1032
  query: dedupeParams(node.parameters.filter((param) => param.in === "query")),
1024
1033
  header: dedupeParams(node.parameters.filter((param) => param.in === "header")),
1025
1034
  cookie: dedupeParams(node.parameters.filter((param) => param.in === "cookie"))
1026
1035
  };
1036
+ operationParameterGroupsByNode.set(node, groups);
1037
+ return groups;
1027
1038
  }
1028
1039
  /**
1029
1040
  * Builds the combined `{ body, path, query, headers }` options object schema for an operation,