@kubb/plugin-react-query 5.0.0-beta.75 → 5.0.0-beta.76
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 +11 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -227,6 +227,17 @@ var Url = class Url {
|
|
|
227
227
|
return path.replace(/\{([^}]+)\}/g, ":$1");
|
|
228
228
|
}
|
|
229
229
|
/**
|
|
230
|
+
* Rewrites OpenAPI placeholder names while keeping the `{...}` braces, so the generated `url`
|
|
231
|
+
* literal aligns with the grouped `path` request option that the runtime client interpolates by
|
|
232
|
+
* key.
|
|
233
|
+
*
|
|
234
|
+
* @example
|
|
235
|
+
* Url.toCasedTemplate('/projects/{project_id}', { casing: 'camelcase' }) // '/projects/{projectId}'
|
|
236
|
+
*/
|
|
237
|
+
static toCasedTemplate(path, { casing } = {}) {
|
|
238
|
+
return path.replace(/\{([^}]+)\}/g, (_, name) => `{${transformParam(name, casing)}}`);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
230
241
|
* Converts an OpenAPI/Swagger path to a TypeScript template literal string.
|
|
231
242
|
* `prefix` is prepended inside the literal, `replacer` transforms each parameter name,
|
|
232
243
|
* and `casing` controls parameter identifier casing.
|