@kubb/adapter-oas 5.0.0-alpha.49 → 5.0.0-alpha.50
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 +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -230,10 +230,16 @@ function toCamelOrPascal(text, pascal) {
|
|
|
230
230
|
*
|
|
231
231
|
* Only splits on dots followed by a letter so that version numbers
|
|
232
232
|
* embedded in operationIds (e.g. `v2025.0`) are kept intact.
|
|
233
|
+
*
|
|
234
|
+
* Empty segments are filtered before joining. They arise when the text starts with
|
|
235
|
+
* a dot followed immediately by a letter (e.g. `..Schema` splits into `['..', 'Schema']`
|
|
236
|
+
* and `'..'` transforms to an empty string). Without this filter the join would produce
|
|
237
|
+
* a leading `/`, which `path.resolve` would interpret as an absolute path, allowing
|
|
238
|
+
* generated files to escape the configured output directory.
|
|
233
239
|
*/
|
|
234
240
|
function applyToFileParts(text, transformPart) {
|
|
235
241
|
const parts = text.split(/\.(?=[a-zA-Z])/);
|
|
236
|
-
return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
|
|
242
|
+
return parts.map((part, i) => transformPart(part, i === parts.length - 1)).filter(Boolean).join("/");
|
|
237
243
|
}
|
|
238
244
|
/**
|
|
239
245
|
* Converts `text` to camelCase.
|