@kubb/plugin-vue-query 5.5.4 → 5.5.5

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.js CHANGED
@@ -235,12 +235,23 @@ function resolveOperationTypeNames(node, resolver, options = {}) {
235
235
  *
236
236
  * When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
237
237
  */
238
- function toCamelOrPascal(text, pascal) {
238
+ function convert(text, pascal) {
239
239
  return text.trim().replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g, "$1 $2").replace(/(\d)([a-z])/g, "$1 $2").split(/[\s\-_./\\:]+/).filter(Boolean).map((word, i) => {
240
240
  if (word.length > 1 && word === word.toUpperCase()) return word;
241
241
  return (i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()) + word.slice(1);
242
242
  }).join("").replace(/[^a-zA-Z0-9]/g, "");
243
243
  }
244
+ const cache = /* @__PURE__ */ new Map();
245
+ const cacheLimit = 1e4;
246
+ function toCamelOrPascal(text, pascal) {
247
+ const key = `${pascal ? "P" : "c"}${text}`;
248
+ const cached = cache.get(key);
249
+ if (cached !== void 0) return cached;
250
+ const result = convert(text, pascal);
251
+ if (cache.size >= cacheLimit) cache.clear();
252
+ cache.set(key, result);
253
+ return result;
254
+ }
244
255
  /**
245
256
  * Converts `text` to camelCase.
246
257
  *
@@ -319,7 +330,7 @@ var compatibility = {
319
330
  };
320
331
  //#endregion
321
332
  //#region package.json
322
- var version = "5.5.4";
333
+ var version = "5.5.5";
323
334
  //#endregion
324
335
  //#region ../../internals/tanstack-query/src/components/HookFile.tsx
325
336
  /**