@scalar/openapi-parser 0.10.3 → 0.10.4
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 +6 -0
- package/dist/utils/traverse.d.ts.map +1 -1
- package/dist/utils/traverse.js +4 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/utils/traverse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC;;GAEG;AACH,wBAAgB,QAAQ,CACtB,aAAa,EAAE,SAAS,EACxB,SAAS,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,SAAS,EACnE,IAAI,GAAE,MAAM,EAAO,
|
|
1
|
+
{"version":3,"file":"traverse.d.ts","sourceRoot":"","sources":["../../src/utils/traverse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEzC;;GAEG;AACH,wBAAgB,QAAQ,CACtB,aAAa,EAAE,SAAS,EACxB,SAAS,EAAE,CAAC,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,SAAS,EACnE,IAAI,GAAE,MAAM,EAAO,aA0BpB"}
|
package/dist/utils/traverse.js
CHANGED
|
@@ -7,13 +7,15 @@ function traverse(specification, transform, path = []) {
|
|
|
7
7
|
const currentPath = [...path, key];
|
|
8
8
|
if (Array.isArray(value)) {
|
|
9
9
|
result[key] = value.map((item, index) => {
|
|
10
|
-
if (typeof item === 'object' && item !== null) {
|
|
10
|
+
if (typeof item === 'object' && !Array.isArray(item) && item !== null) {
|
|
11
11
|
return traverse(item, transform, [...currentPath, index.toString()]);
|
|
12
12
|
}
|
|
13
13
|
return item;
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
else if (typeof value === 'object' &&
|
|
16
|
+
else if (typeof value === 'object' &&
|
|
17
|
+
!Array.isArray(value) &&
|
|
18
|
+
value !== null) {
|
|
17
19
|
result[key] = traverse(value, transform, currentPath);
|
|
18
20
|
}
|
|
19
21
|
else {
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"parser",
|
|
18
18
|
"typescript"
|
|
19
19
|
],
|
|
20
|
-
"version": "0.10.
|
|
20
|
+
"version": "0.10.4",
|
|
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/types": "0.0.25",
|
|
68
67
|
"@scalar/build-tooling": "0.1.12",
|
|
69
|
-
"@scalar/openapi-types": "0.1.
|
|
68
|
+
"@scalar/openapi-types": "0.1.6",
|
|
69
|
+
"@scalar/types": "0.0.26"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "scalar-build-rollup",
|