@scalar/import 0.3.1 → 0.3.3

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,22 @@
1
1
  # @scalar/import
2
2
 
3
+ ## 0.3.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [0f13162]
8
+ - Updated dependencies [0212daa]
9
+ - @scalar/openapi-parser@0.10.11
10
+ - @scalar/oas-utils@0.2.121
11
+
12
+ ## 0.3.2
13
+
14
+ ### Patch Changes
15
+
16
+ - Updated dependencies [cd75eeb]
17
+ - @scalar/oas-utils@0.2.120
18
+ - @scalar/openapi-parser@0.10.10
19
+
3
20
  ## 0.3.1
4
21
 
5
22
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,OAAO,CAAC,EAAE;IACR;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;CAC3C,GACA,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,CAqHnD;AA6ED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAetE;AAgCD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAqB1E;AAED,yDAAyD;AACzD,eAAO,MAAM,4BAA4B,SAAU,MAAM,KAAG,MAAM,GAAG,SAMpE,CAAA"}
1
+ {"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,EACrB,OAAO,CAAC,EAAE;IACR;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;CAC3C,GACA,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC,CAqHnD;AA6ED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAiBtE;AAgCD;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAqB1E;AAED,yDAAyD;AACzD,eAAO,MAAM,4BAA4B,SAAU,MAAM,KAAG,MAAM,GAAG,SAQpE,CAAA"}
package/dist/resolve.js CHANGED
@@ -184,8 +184,9 @@ function getContentOfScriptTag(html) {
184
184
  ];
185
185
  for (const pattern of patterns) {
186
186
  const match = html.match(pattern);
187
- if (match?.[1])
187
+ if (match?.[1]) {
188
188
  return match[1].trim();
189
+ }
189
190
  }
190
191
  return undefined;
191
192
  }
@@ -245,8 +246,9 @@ function getConfigurationAttribute(html) {
245
246
  /** Grab the URL from the configuration data attribute */
246
247
  const getConfigurationAttributeUrl = (html) => {
247
248
  const configString = getConfigurationAttribute(html);
248
- if (!configString)
249
+ if (!configString) {
249
250
  return undefined;
251
+ }
250
252
  const config = JSON.parse(decodeHtmlEntities(configString));
251
253
  return config.url || config.spec?.url;
252
254
  };
@@ -255,8 +257,9 @@ const getConfigurationAttributeUrl = (html) => {
255
257
  */
256
258
  function parseEmbeddedOpenApi(html) {
257
259
  const configString = getConfigurationAttribute(html);
258
- if (!configString)
260
+ if (!configString) {
259
261
  return undefined;
262
+ }
260
263
  try {
261
264
  const config = JSON.parse(decodeHtmlEntities(configString));
262
265
  // Handle the old spec format while we transition to the new one
package/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  "postman",
17
17
  "scalar"
18
18
  ],
19
- "version": "0.3.1",
19
+ "version": "0.3.3",
20
20
  "engines": {
21
21
  "node": ">=18"
22
22
  },
@@ -36,8 +36,8 @@
36
36
  "module": "dist/index.js",
37
37
  "dependencies": {
38
38
  "yaml": "^2.4.5",
39
- "@scalar/oas-utils": "0.2.119",
40
- "@scalar/openapi-parser": "0.10.10"
39
+ "@scalar/oas-utils": "0.2.121",
40
+ "@scalar/openapi-parser": "0.10.11"
41
41
  },
42
42
  "devDependencies": {
43
43
  "vite": "^5.4.10",