@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.cjs +13 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -2
- package/dist/index.js.map +1 -1
- package/kubb-extension.json +14 -0
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -261,12 +261,23 @@ function resolveOperationTypeNames(node, resolver, options = {}) {
|
|
|
261
261
|
*
|
|
262
262
|
* When `pascal` is `true` the first word is also capitalized (PascalCase), otherwise only subsequent words are.
|
|
263
263
|
*/
|
|
264
|
-
function
|
|
264
|
+
function convert(text, pascal) {
|
|
265
265
|
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) => {
|
|
266
266
|
if (word.length > 1 && word === word.toUpperCase()) return word;
|
|
267
267
|
return (i === 0 && !pascal ? word.charAt(0).toLowerCase() : word.charAt(0).toUpperCase()) + word.slice(1);
|
|
268
268
|
}).join("").replace(/[^a-zA-Z0-9]/g, "");
|
|
269
269
|
}
|
|
270
|
+
const cache = /* @__PURE__ */ new Map();
|
|
271
|
+
const cacheLimit = 1e4;
|
|
272
|
+
function toCamelOrPascal(text, pascal) {
|
|
273
|
+
const key = `${pascal ? "P" : "c"}${text}`;
|
|
274
|
+
const cached = cache.get(key);
|
|
275
|
+
if (cached !== void 0) return cached;
|
|
276
|
+
const result = convert(text, pascal);
|
|
277
|
+
if (cache.size >= cacheLimit) cache.clear();
|
|
278
|
+
cache.set(key, result);
|
|
279
|
+
return result;
|
|
280
|
+
}
|
|
270
281
|
/**
|
|
271
282
|
* Converts `text` to camelCase.
|
|
272
283
|
*
|
|
@@ -345,7 +356,7 @@ var compatibility = {
|
|
|
345
356
|
};
|
|
346
357
|
//#endregion
|
|
347
358
|
//#region package.json
|
|
348
|
-
var version = "5.5.
|
|
359
|
+
var version = "5.5.5";
|
|
349
360
|
//#endregion
|
|
350
361
|
//#region ../../internals/tanstack-query/src/components/HookFile.tsx
|
|
351
362
|
/**
|