@scalar/openapi-parser 0.10.5 → 0.10.7

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,18 @@
1
1
  # @scalar/openapi-parser
2
2
 
3
+ ## 0.10.7
4
+
5
+ ### Patch Changes
6
+
7
+ - 1223c1f: chore: code style
8
+
9
+ ## 0.10.6
10
+
11
+ ### Patch Changes
12
+
13
+ - 4de3124: feat: make 'null' the second type in an array when upgrading
14
+ - 34e6f52: feat: upgrade to stricter tsconfig
15
+
3
16
  ## 0.10.5
4
17
 
5
18
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"fetchUrls.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch-urls/fetchUrls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,eAAO,MAAM,6BAA6B;;CAEzC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE;IAC7C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;CAC3C,KAAK,UAiDL,CAAA"}
1
+ {"version":3,"file":"fetchUrls.d.ts","sourceRoot":"","sources":["../../../src/plugins/fetch-urls/fetchUrls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,eAAO,MAAM,6BAA6B;;CAEzC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,CAAC,mBAAmB,CAAC,EAAE;IAC7C;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,CAAA;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;CAC3C,KAAK,UAkDL,CAAA"}
@@ -37,6 +37,7 @@ const fetchUrls = (customConfiguration) => {
37
37
  }
38
38
  catch (error) {
39
39
  console.error('[fetchUrls]', error.message, `(${value})`);
40
+ return undefined;
40
41
  }
41
42
  },
42
43
  };
@@ -1 +1 @@
1
- {"version":3,"file":"readFiles.d.ts","sourceRoot":"","sources":["../../../src/plugins/read-files/readFiles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,eAAO,MAAM,SAAS,EAAE,MAAM,UAoD7B,CAAA"}
1
+ {"version":3,"file":"readFiles.d.ts","sourceRoot":"","sources":["../../../src/plugins/read-files/readFiles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAE1D,eAAO,MAAM,SAAS,EAAE,MAAM,UAqD7B,CAAA"}
@@ -38,6 +38,7 @@ const readFiles = () => {
38
38
  }
39
39
  catch (error) {
40
40
  console.error('[readFiles]', error);
41
+ return false;
41
42
  }
42
43
  },
43
44
  resolvePath(value, reference) {
@@ -97,7 +97,7 @@ resolve, errors) {
97
97
  code: 'INVALID_REFERENCE',
98
98
  message: ERRORS.INVALID_REFERENCE.replace('%s', uri),
99
99
  });
100
- return;
100
+ return undefined;
101
101
  }
102
102
  // Understand the URI
103
103
  const [prefix, path] = uri.split('#', 2);
@@ -116,7 +116,7 @@ resolve, errors) {
116
116
  code: 'EXTERNAL_REFERENCE_NOT_FOUND',
117
117
  message: ERRORS.EXTERNAL_REFERENCE_NOT_FOUND.replace('%s', prefix),
118
118
  });
119
- return;
119
+ return undefined;
120
120
  }
121
121
  // $ref: 'other-file.yaml'
122
122
  if (path === undefined) {
@@ -143,6 +143,7 @@ resolve, errors) {
143
143
  message: ERRORS.INVALID_REFERENCE.replace('%s', uri),
144
144
  });
145
145
  }
146
+ return undefined;
146
147
  }
147
148
 
148
149
  export { resolveReferences };
@@ -20,7 +20,7 @@ function upgradeFromThreeToThreeOne(originalSpecification) {
20
20
  // Nullable types
21
21
  specification = traverse(specification, (schema) => {
22
22
  if (schema.type !== 'undefined' && schema.nullable === true) {
23
- schema.type = ['null', schema.type];
23
+ schema.type = [schema.type, 'null'];
24
24
  delete schema.nullable;
25
25
  }
26
26
  return schema;
package/package.json CHANGED
@@ -17,7 +17,7 @@
17
17
  "parser",
18
18
  "typescript"
19
19
  ],
20
- "version": "0.10.5",
20
+ "version": "0.10.7",
21
21
  "engines": {
22
22
  "node": ">=18"
23
23
  },
@@ -64,9 +64,9 @@
64
64
  "json-to-ast": "^2.1.0",
65
65
  "just-diff": "^6.0.2",
66
66
  "tinybench": "^2.8.0",
67
- "@scalar/build-tooling": "0.1.12",
68
- "@scalar/openapi-types": "0.1.7",
69
- "@scalar/types": "0.0.31"
67
+ "@scalar/build-tooling": "0.1.13",
68
+ "@scalar/types": "0.0.33",
69
+ "@scalar/openapi-types": "0.1.7"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "scalar-build-rollup",