@kubb/adapter-oas 5.0.0-beta.21 → 5.0.0-beta.22

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
@@ -366,12 +366,13 @@ var URLPath = class {
366
366
  * @example
367
367
  * new URLPath('/pet/{petId}').toTemplateString() // '`/pet/${petId}`'
368
368
  */
369
- toTemplateString({ prefix = "", replacer } = {}) {
370
- return `\`${prefix}${this.path.split(/\{([^}]+)\}/).map((part, i) => {
369
+ toTemplateString({ prefix, replacer } = {}) {
370
+ const result = this.path.split(/\{([^}]+)\}/).map((part, i) => {
371
371
  if (i % 2 === 0) return part;
372
372
  const param = this.#transformParam(part);
373
373
  return `\${${replacer ? replacer(param) : param}}`;
374
- }).join("")}\``;
374
+ }).join("");
375
+ return `\`${prefix ?? ""}${result}\``;
375
376
  }
376
377
  /**
377
378
  * Extracts all `{param}` segments from the path and returns them as a key-value map.