@kubb/plugin-vue-query 5.13.1 → 5.13.2

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
@@ -36,7 +36,7 @@ var compatibility = {
36
36
  "node": ">=22.22"
37
37
  };
38
38
  // package.json
39
- var version = "5.13.1";
39
+ var version = "5.13.2";
40
40
  // ../../internals/ast/src/http/requestBody.ts
41
41
  /** The schema of the first request body entry, else `undefined` when the operation takes no body. */
42
42
  function getSchema(node) {
@@ -82,15 +82,10 @@ function findPrimary(node) {
82
82
  }
83
83
  // ../../internals/ast/src/http/index.ts
84
84
  const isOperation = _kubb_ast.ast.http.isOperation;
85
- /** Computes once per key; generators visit the same node many times. */
86
- function cached(store, key, compute) {
87
- if (!store.has(key)) store.set(key, compute());
88
- return store.get(key);
89
- }
90
85
  const parametersByNode = /* @__PURE__ */ new WeakMap();
91
86
  /** The operation's parameters by location, with a `querystring` parameter in `query`. A repeated name keeps its first parameter. */
92
87
  function groupParameters(node) {
93
- return cached(parametersByNode, node, () => {
88
+ return (0, _kubb_kit.memo)(parametersByNode, node, () => {
94
89
  const group = (...locations) => {
95
90
  const seen = /* @__PURE__ */ new Set();
96
91
  return locations.flatMap((location) => node.parameters.filter((param) => {
@@ -110,7 +105,7 @@ function groupParameters(node) {
110
105
  const requestGroupsByNode = /* @__PURE__ */ new WeakMap();
111
106
  /** Which request groups are present, which hold a required member, and the body's media types. Built once per operation. */
112
107
  function getRequestGroups(node) {
113
- return cached(requestGroupsByNode, node, () => {
108
+ return (0, _kubb_kit.memo)(requestGroupsByNode, node, () => {
114
109
  const { path, query, header, cookie } = groupParameters(node);
115
110
  const content = node.requestBody?.content ?? [];
116
111
  const body = Boolean(content[0]?.schema);
@@ -1364,7 +1359,7 @@ const declarationPrinter$4 = (0, _kubb_plugin_ts.functionPrinter)({ mode: "decla
1364
1359
  */
1365
1360
  const mutationKeyTransformer = ({ node }) => {
1366
1361
  if (!node.path) return [];
1367
- return [`{ url: '${_kubb_kit.Url.toPath(node.path)}' }`];
1362
+ return [`{ url: ${_kubb_kit.text.quote(_kubb_kit.Url.toPath(node.path))} }`];
1368
1363
  };
1369
1364
  function MutationKey({ name, node, transformer, typeName }) {
1370
1365
  const paramsNode = (0, _kubb_plugin_ts.createFunctionParameters)({ params: [] });
@@ -1402,7 +1397,7 @@ const queryKeyTransformer = ({ node, variant }) => {
1402
1397
  if (!node.path) return [];
1403
1398
  const { path, query } = groupParameters(node);
1404
1399
  const isInfinite = variant === "infiniteQuery" || variant === "suspenseInfiniteQuery";
1405
- const urlFields = [`url: '${_kubb_kit.Url.toPath(node.path)}'`];
1400
+ const urlFields = [`url: ${_kubb_kit.text.quote(_kubb_kit.Url.toPath(node.path))}`];
1406
1401
  if (path.length > 0) urlFields.push("params: path");
1407
1402
  if (isInfinite) urlFields.push("infinite: true");
1408
1403
  const result = [`{ ${urlFields.join(", ")} }`];