@scalar/import 0.0.4 → 0.0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @scalar/import
2
2
 
3
+ ## 0.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - 779cf35: feat: import from escaped JS object
8
+ - Updated dependencies [757fade]
9
+ - Updated dependencies [a607115]
10
+ - @scalar/openapi-parser@0.8.9
11
+
3
12
  ## 0.0.4
4
13
 
5
14
  ### Patch Changes
package/dist/resolve.js CHANGED
@@ -157,6 +157,11 @@ function parseHtml(html) {
157
157
  if (linkMatch?.[1]) {
158
158
  return linkMatch[1];
159
159
  }
160
+ // Check for URLs in escaped JS objects
161
+ const escapedJsonMatch = html.match(/\\"spec\\":\{.*?\\"url\\":\\"([^"\\]+)\\"/);
162
+ if (escapedJsonMatch?.[1]) {
163
+ return escapedJsonMatch[1];
164
+ }
160
165
  return undefined;
161
166
  }
162
167
  /**
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "postman",
17
17
  "scalar"
18
18
  ],
19
- "version": "0.0.4",
19
+ "version": "0.0.5",
20
20
  "engines": {
21
21
  "node": ">=18"
22
22
  },
@@ -36,7 +36,7 @@
36
36
  "module": "dist/index.js",
37
37
  "dependencies": {
38
38
  "yaml": "^2.4.5",
39
- "@scalar/openapi-parser": "0.8.8"
39
+ "@scalar/openapi-parser": "0.8.9"
40
40
  },
41
41
  "devDependencies": {
42
42
  "vite": "^5.4.9",