site-config-stack 2.2.12 → 2.2.13

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/urls.cjs CHANGED
@@ -12,7 +12,10 @@ function resolveSitePath(pathOrUrl, options) {
12
12
  if (base !== "/" && path.startsWith(base)) {
13
13
  path = path.slice(base.length);
14
14
  }
15
- const origin = options.absolute ? options.siteUrl : "";
15
+ let origin = ufo.withoutTrailingSlash(options.absolute ? options.siteUrl : "");
16
+ if (base !== "/" && origin.endsWith(base)) {
17
+ origin = origin.slice(0, origin.indexOf(base));
18
+ }
16
19
  const baseWithOrigin = options.withBase ? ufo.withBase(base, origin || "/") : origin;
17
20
  const resolvedUrl = ufo.withBase(path, baseWithOrigin);
18
21
  return path === "/" && !options.withBase ? ufo.withTrailingSlash(resolvedUrl) : fixSlashes(options.trailingSlash, resolvedUrl);
package/dist/urls.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { hasProtocol, parseURL, withLeadingSlash, withBase, withTrailingSlash, withoutTrailingSlash } from 'ufo';
1
+ import { hasProtocol, parseURL, withLeadingSlash, withoutTrailingSlash, withBase, withTrailingSlash } from 'ufo';
2
2
 
3
3
  function resolveSitePath(pathOrUrl, options) {
4
4
  let path = pathOrUrl;
@@ -10,7 +10,10 @@ function resolveSitePath(pathOrUrl, options) {
10
10
  if (base !== "/" && path.startsWith(base)) {
11
11
  path = path.slice(base.length);
12
12
  }
13
- const origin = options.absolute ? options.siteUrl : "";
13
+ let origin = withoutTrailingSlash(options.absolute ? options.siteUrl : "");
14
+ if (base !== "/" && origin.endsWith(base)) {
15
+ origin = origin.slice(0, origin.indexOf(base));
16
+ }
14
17
  const baseWithOrigin = options.withBase ? withBase(base, origin || "/") : origin;
15
18
  const resolvedUrl = withBase(path, baseWithOrigin);
16
19
  return path === "/" && !options.withBase ? withTrailingSlash(resolvedUrl) : fixSlashes(options.trailingSlash, resolvedUrl);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "site-config-stack",
3
3
  "type": "module",
4
- "version": "2.2.12",
4
+ "version": "2.2.13",
5
5
  "description": "Shared site configuration utilities.",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/harlan-zw",
@@ -40,10 +40,10 @@
40
40
  "vue": "^3"
41
41
  },
42
42
  "dependencies": {
43
- "ufo": "^1.4.0"
43
+ "ufo": "^1.5.3"
44
44
  },
45
45
  "devDependencies": {
46
- "vue": "^3.4.21"
46
+ "vue": "^3.4.31"
47
47
  },
48
48
  "scripts": {
49
49
  "lint": "eslint . --fix",