@scalar/openapi-parser 0.10.10 → 0.10.11
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/polyfills/path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/polyfills/path.ts"],"names":[],"mappings":"AA4DA,wBAAgB,OAAO,CAAC,GAAG,UAAU,OAAA,UA6BpC;AAID,wBAAgB,SAAS,CAAC,IAAI,KAAA,UAkB7B;AAGD,wBAAgB,UAAU,CAAC,IAAI,KAAA,WAE9B;AAGD,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,UAStC;AAID,wBAAgB,QAAQ,CAAC,IAAI,KAAA,EAAE,EAAE,KAAA,UA6ChC;AAED,eAAO,MAAM,GAAG,MAAM,CAAA;AACtB,eAAO,MAAM,SAAS,MAAM,CAAA;AAE5B,wBAAgB,OAAO,CAAC,IAAI,KAAA,UAiB3B;AAED,wBAAgB,QAAQ,CAAC,IAAI,KAAA,EAAE,GAAG,KAAA,UAOjC;AAED,wBAAgB,OAAO,CAAC,IAAI,KAAA,UAE3B;;;;;;;;;;;;;AACD,wBAWC"}
|
package/dist/polyfills/path.js
CHANGED
|
@@ -51,17 +51,13 @@ function normalizeArray(parts, allowAboveRoot) {
|
|
|
51
51
|
// Split a filename into [root, dir, basename, ext], unix version
|
|
52
52
|
// 'root' is just a slash, or nothing.
|
|
53
53
|
const splitPathRe = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^/]+?|)(\.[^./]*|))(?:[/]*)$/;
|
|
54
|
-
const splitPath =
|
|
55
|
-
return splitPathRe.exec(filename).slice(1);
|
|
56
|
-
};
|
|
54
|
+
const splitPath = (filename) => splitPathRe.exec(filename).slice(1);
|
|
57
55
|
// path.normalize(path)
|
|
58
56
|
// posix version
|
|
59
57
|
function normalize(path) {
|
|
60
58
|
const isPathAbsolute = isAbsolute(path), trailingSlash = substr(path, -1) === '/';
|
|
61
59
|
// Normalize the path
|
|
62
|
-
path = normalizeArray(filter(path.split('/'),
|
|
63
|
-
return !!p;
|
|
64
|
-
}), !isPathAbsolute).join('/');
|
|
60
|
+
path = normalizeArray(filter(path.split('/'), (p) => !!p), !isPathAbsolute).join('/');
|
|
65
61
|
if (!path && !isPathAbsolute) {
|
|
66
62
|
path = '.';
|
|
67
63
|
}
|
|
@@ -76,7 +72,7 @@ function isAbsolute(path) {
|
|
|
76
72
|
}
|
|
77
73
|
// posix version
|
|
78
74
|
function join(...paths) {
|
|
79
|
-
return normalize(filter(paths,
|
|
75
|
+
return normalize(filter(paths, (p, _index) => {
|
|
80
76
|
if (typeof p !== 'string') {
|
|
81
77
|
throw new TypeError('Arguments to path.join must be strings');
|
|
82
78
|
}
|
|
@@ -97,23 +93,24 @@ function dirname(path) {
|
|
|
97
93
|
return root + dir;
|
|
98
94
|
}
|
|
99
95
|
function filter(xs, f) {
|
|
100
|
-
if (xs.filter)
|
|
96
|
+
if (xs.filter) {
|
|
101
97
|
return xs.filter(f);
|
|
98
|
+
}
|
|
102
99
|
const res = [];
|
|
103
100
|
for (let i = 0; i < xs.length; i++) {
|
|
104
|
-
if (f(xs[i], i, xs))
|
|
101
|
+
if (f(xs[i], i, xs)) {
|
|
105
102
|
res.push(xs[i]);
|
|
103
|
+
}
|
|
106
104
|
}
|
|
107
105
|
return res;
|
|
108
106
|
}
|
|
109
107
|
// String.prototype.substr - negative index don't work in IE8
|
|
110
108
|
const substr = 'ab'.substr(-1) === 'b'
|
|
111
|
-
?
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
: function (str, start, len) {
|
|
115
|
-
if (start < 0)
|
|
109
|
+
? (str, start, len) => str.substr(start, len)
|
|
110
|
+
: (str, start, len) => {
|
|
111
|
+
if (start < 0) {
|
|
116
112
|
start = str.length + start;
|
|
113
|
+
}
|
|
117
114
|
return str.substr(start, len);
|
|
118
115
|
};
|
|
119
116
|
|
package/dist/utils/isYaml.js
CHANGED
package/dist/utils/load/load.js
CHANGED
package/dist/utils/normalize.js
CHANGED
|
@@ -41,8 +41,9 @@ function dereference(schema, filesystem, entrypoint,
|
|
|
41
41
|
resolvedSchemas,
|
|
42
42
|
// error output
|
|
43
43
|
errors, options) {
|
|
44
|
-
if (schema === null || resolvedSchemas.has(schema))
|
|
44
|
+
if (schema === null || resolvedSchemas.has(schema)) {
|
|
45
45
|
return;
|
|
46
|
+
}
|
|
46
47
|
resolvedSchemas.add(schema);
|
|
47
48
|
function resolveExternal(externalFile) {
|
|
48
49
|
dereference(externalFile.specification, filesystem, externalFile, resolvedSchemas, errors, options);
|
|
@@ -52,8 +53,9 @@ errors, options) {
|
|
|
52
53
|
// Find the referenced content
|
|
53
54
|
const resolved = resolveUri(schema.$ref, options, entrypoint, filesystem, resolveExternal, errors);
|
|
54
55
|
// invalid
|
|
55
|
-
if (typeof resolved !== 'object' || resolved === null)
|
|
56
|
+
if (typeof resolved !== 'object' || resolved === null) {
|
|
56
57
|
break;
|
|
58
|
+
}
|
|
57
59
|
const dereferencedRef = schema.$ref;
|
|
58
60
|
// Get rid of the reference
|
|
59
61
|
delete schema.$ref;
|
|
@@ -133,7 +135,7 @@ resolve, errors) {
|
|
|
133
135
|
return acc[key];
|
|
134
136
|
}, file.specification);
|
|
135
137
|
}
|
|
136
|
-
catch (
|
|
138
|
+
catch (_error) {
|
|
137
139
|
if (options?.throwOnError) {
|
|
138
140
|
throw new Error(ERRORS.INVALID_REFERENCE.replace('%s', uri));
|
|
139
141
|
}
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"parser",
|
|
18
18
|
"typescript"
|
|
19
19
|
],
|
|
20
|
-
"version": "0.10.
|
|
20
|
+
"version": "0.10.11",
|
|
21
21
|
"engines": {
|
|
22
22
|
"node": ">=18"
|
|
23
23
|
},
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"tinybench": "^2.8.0",
|
|
67
67
|
"@scalar/build-tooling": "0.1.17",
|
|
68
68
|
"@scalar/openapi-types": "0.1.9",
|
|
69
|
-
"@scalar/types": "0.
|
|
69
|
+
"@scalar/types": "0.1.2"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "scalar-build-rollup",
|