@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 CHANGED
@@ -256,10 +256,16 @@ function toCamelOrPascal(text, pascal) {
256
256
  *
257
257
  * Only splits on dots followed by a letter so that version numbers
258
258
  * embedded in operationIds (e.g. `v2025.0`) are kept intact.
259
+ *
260
+ * Empty segments are filtered before joining. They arise when the text starts with
261
+ * a dot followed immediately by a letter (e.g. `..Schema` splits into `['..', 'Schema']`
262
+ * and `'..'` transforms to an empty string). Without this filter the join would produce
263
+ * a leading `/`, which `path.resolve` would interpret as an absolute path, allowing
264
+ * generated files to escape the configured output directory.
259
265
  */
260
266
  function applyToFileParts(text, transformPart) {
261
267
  const parts = text.split(/\.(?=[a-zA-Z])/);
262
- return parts.map((part, i) => transformPart(part, i === parts.length - 1)).join("/");
268
+ return parts.map((part, i) => transformPart(part, i === parts.length - 1)).filter(Boolean).join("/");
263
269
  }
264
270
  /**
265
271
  * Converts `text` to camelCase.