@doujins/payments-ui 0.1.4 → 0.1.5

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
@@ -120,8 +120,9 @@ var createClient = (config) => {
120
120
  }
121
121
  };
122
122
  const buildUrl = (path, query) => {
123
- path = path.replace(/^\/+/, "");
124
- const url = new URL(`${config.baseUrl.replace(/^\/+/, "")}${path.endsWith("v1") ? "" : "/v1"}${path}`);
123
+ path = path.replace(/^\/+|\/+$/g, "");
124
+ const baseUrl = config.baseUrl.replace(/^\/+|\/+$/g, "");
125
+ const url = new URL(`${baseUrl}${path.endsWith("v1") ? "/" : "/v1/"}${path}`);
125
126
  if (query) {
126
127
  Object.entries(query).forEach(([key, value]) => {
127
128
  if (value === void 0 || value === null) return;