@seedgrid/fe-core 2026.4.25 → 2026.4.26

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.
@@ -218,8 +218,18 @@ function mergeHeaders(target, source) {
218
218
  target.set(key, value);
219
219
  });
220
220
  }
221
+ function resolveAbsoluteBase(baseUrl) {
222
+ if (baseUrl.startsWith("http://") || baseUrl.startsWith("https://")) {
223
+ return baseUrl;
224
+ }
225
+ const origin = globalThis.window === undefined
226
+ ? "http://localhost:3000"
227
+ : globalThis.window.location.origin;
228
+ return `${origin}${baseUrl}`;
229
+ }
221
230
  function buildUrl(baseUrl, path, query) {
222
- const base = baseUrl.endsWith("/") ? baseUrl : `${baseUrl}/`;
231
+ const resolved = resolveAbsoluteBase(baseUrl);
232
+ const base = resolved.endsWith("/") ? resolved : `${resolved}/`;
223
233
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
224
234
  const url = new URL(normalizedPath, base);
225
235
  for (const [key, value] of Object.entries(query ?? {})) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedgrid/fe-core",
3
- "version": "2026.4.25",
3
+ "version": "2026.4.26",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",