@scalar/oas-utils 0.2.66 → 0.2.67

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @scalar/oas-utils
2
2
 
3
+ ## 0.2.67
4
+
5
+ ### Patch Changes
6
+
7
+ - 823c14d: fix: add tests for oauth2 flows, ensure we reject on state mismatch
8
+ - 997cd35: fix: relative URLs are created wrong
9
+
3
10
  ## 0.2.66
4
11
 
5
12
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"makeUrlAbsolute.d.ts","sourceRoot":"","sources":["../../src/helpers/makeUrlAbsolute.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,SAAU,MAAM,uBAoB3C,CAAA"}
1
+ {"version":3,"file":"makeUrlAbsolute.d.ts","sourceRoot":"","sources":["../../src/helpers/makeUrlAbsolute.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,eAAe,SAAU,MAAM,uBAqB3C,CAAA"}
@@ -10,10 +10,11 @@ const makeUrlAbsolute = (url) => {
10
10
  const baseUrl = window.location.href;
11
11
  // Remove any query parameters or hash from the base URL
12
12
  const cleanBaseUrl = baseUrl.split('?')[0].split('#')[0];
13
- // Ensure the base URL ends with a slash if it doesn’t already
13
+ // For base URLs with a path component, we want to remove the last path segment
14
+ // if it doesn't end with a slash
14
15
  const normalizedBaseUrl = cleanBaseUrl.endsWith('/')
15
16
  ? cleanBaseUrl
16
- : cleanBaseUrl + '/';
17
+ : cleanBaseUrl.substring(0, cleanBaseUrl.lastIndexOf('/') + 1);
17
18
  return new URL(url, normalizedBaseUrl).toString();
18
19
  };
19
20
 
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "specification",
17
17
  "yaml"
18
18
  ],
19
- "version": "0.2.66",
19
+ "version": "0.2.67",
20
20
  "engines": {
21
21
  "node": ">=18"
22
22
  },
@@ -106,8 +106,8 @@
106
106
  "nanoid": "^5.0.7",
107
107
  "yaml": "^2.4.5",
108
108
  "zod": "^3.23.8",
109
- "@scalar/openapi-types": "0.1.4",
110
109
  "@scalar/object-utils": "1.1.11",
110
+ "@scalar/openapi-types": "0.1.4",
111
111
  "@scalar/themes": "0.9.45",
112
112
  "@scalar/types": "0.0.18"
113
113
  },
@@ -116,9 +116,9 @@
116
116
  "vite": "^5.4.9",
117
117
  "vitest": "^1.6.0",
118
118
  "zod-to-ts": "^1.2.0",
119
- "@scalar/build-tooling": "0.1.11",
120
119
  "@scalar/openapi-parser": "0.8.8",
121
- "@scalar/openapi-types": "0.1.4"
120
+ "@scalar/openapi-types": "0.1.4",
121
+ "@scalar/build-tooling": "0.1.11"
122
122
  },
123
123
  "scripts": {
124
124
  "build": "scalar-build-rollup",