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

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.js CHANGED
@@ -198,10 +198,13 @@ var URLPath = class {
198
198
  params: this.getParams()
199
199
  };
200
200
  if (stringify) {
201
- if (type !== "template") {
202
- throw new Error("Type should be `template` when using stringiyf");
201
+ if (type === "template") {
202
+ return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
203
203
  }
204
- return JSON.stringify(object).replaceAll("'", "").replaceAll(`"`, "");
204
+ if (object.params) {
205
+ return `{ url: '${object.url}', params: ${JSON.stringify(object.params).replaceAll("'", "").replaceAll(`"`, "")} }`;
206
+ }
207
+ return `{ url: '${object.url}' }`;
205
208
  }
206
209
  return object;
207
210
  }