@kubb/core 2.0.0-alpha.6 → 2.0.0-alpha.8

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
@@ -240,10 +240,13 @@ var URLPath = class {
240
240
  params: this.getParams()
241
241
  };
242
242
  if (stringify) {
243
- if (type !== "template") {
244
- throw new Error("Type should be `template` when using stringiyf");
243
+ if (type === "template") {
244
+ return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
245
245
  }
246
- return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
246
+ if (object.params) {
247
+ return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
248
+ }
249
+ return `{ url: '${object.url}' }`;
247
250
  }
248
251
  return object;
249
252
  }