@apidevtools/json-schema-ref-parser 11.5.1 → 11.5.2
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/dist/lib/refs.d.ts +3 -3
- package/dist/lib/refs.js +2 -2
- package/lib/refs.ts +4 -4
- package/package.json +1 -1
package/dist/lib/refs.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export default class $Refs<S extends JSONSchema = JSONSchema> {
|
|
|
26
26
|
*
|
|
27
27
|
* @param types (optional) Optionally only return certain types of paths ("file", "http", etc.)
|
|
28
28
|
*/
|
|
29
|
-
paths(...types: string[]): string[];
|
|
29
|
+
paths(...types: (string | string[])[]): string[];
|
|
30
30
|
/**
|
|
31
31
|
* Returns a map of paths/URLs and their correspond values.
|
|
32
32
|
*
|
|
@@ -34,7 +34,7 @@ export default class $Refs<S extends JSONSchema = JSONSchema> {
|
|
|
34
34
|
*
|
|
35
35
|
* @param types (optional) Optionally only return values from certain locations ("file", "http", etc.)
|
|
36
36
|
*/
|
|
37
|
-
values(...types: string[]): S;
|
|
37
|
+
values(...types: (string | string[])[]): S;
|
|
38
38
|
/**
|
|
39
39
|
* Returns `true` if the given path exists in the schema; otherwise, returns `false`
|
|
40
40
|
*
|
|
@@ -122,6 +122,6 @@ export default class $Refs<S extends JSONSchema = JSONSchema> {
|
|
|
122
122
|
*
|
|
123
123
|
* @returns {object}
|
|
124
124
|
*/
|
|
125
|
-
toJSON: (...types: string[]) => S;
|
|
125
|
+
toJSON: (...types: (string | string[])[]) => S;
|
|
126
126
|
}
|
|
127
127
|
export {};
|
package/dist/lib/refs.js
CHANGED
|
@@ -46,7 +46,7 @@ class $Refs {
|
|
|
46
46
|
* @param types (optional) Optionally only return certain types of paths ("file", "http", etc.)
|
|
47
47
|
*/
|
|
48
48
|
paths(...types) {
|
|
49
|
-
const paths = getPaths(this._$refs, types);
|
|
49
|
+
const paths = getPaths(this._$refs, types.flat());
|
|
50
50
|
return paths.map((path) => {
|
|
51
51
|
return (0, convert_path_to_posix_1.default)(path.decoded);
|
|
52
52
|
});
|
|
@@ -60,7 +60,7 @@ class $Refs {
|
|
|
60
60
|
*/
|
|
61
61
|
values(...types) {
|
|
62
62
|
const $refs = this._$refs;
|
|
63
|
-
const paths = getPaths($refs, types);
|
|
63
|
+
const paths = getPaths($refs, types.flat());
|
|
64
64
|
return paths.reduce((obj, path) => {
|
|
65
65
|
obj[(0, convert_path_to_posix_1.default)(path.decoded)] = $refs[path.encoded].value;
|
|
66
66
|
return obj;
|
package/lib/refs.ts
CHANGED
|
@@ -31,8 +31,8 @@ export default class $Refs<S extends JSONSchema = JSONSchema> {
|
|
|
31
31
|
*
|
|
32
32
|
* @param types (optional) Optionally only return certain types of paths ("file", "http", etc.)
|
|
33
33
|
*/
|
|
34
|
-
paths(...types: string[]): string[] {
|
|
35
|
-
const paths = getPaths(this._$refs, types);
|
|
34
|
+
paths(...types: (string | string[])[]): string[] {
|
|
35
|
+
const paths = getPaths(this._$refs, types.flat());
|
|
36
36
|
return paths.map((path) => {
|
|
37
37
|
return convertPathToPosix(path.decoded);
|
|
38
38
|
});
|
|
@@ -45,9 +45,9 @@ export default class $Refs<S extends JSONSchema = JSONSchema> {
|
|
|
45
45
|
*
|
|
46
46
|
* @param types (optional) Optionally only return values from certain locations ("file", "http", etc.)
|
|
47
47
|
*/
|
|
48
|
-
values(...types: string[]): S {
|
|
48
|
+
values(...types: (string | string[])[]): S {
|
|
49
49
|
const $refs = this._$refs;
|
|
50
|
-
const paths = getPaths($refs, types);
|
|
50
|
+
const paths = getPaths($refs, types.flat());
|
|
51
51
|
return paths.reduce<Record<string, any>>((obj, path) => {
|
|
52
52
|
obj[convertPathToPosix(path.decoded)] = $refs[path.encoded].value;
|
|
53
53
|
return obj;
|