@apidevtools/json-schema-ref-parser
Advanced tools
Comparing version 11.5.1 to 11.5.2
@@ -29,3 +29,3 @@ import $Ref from "./ref.js"; | ||
*/ | ||
paths(...types: string[]): string[]; | ||
paths(...types: (string | string[])[]): string[]; | ||
/** | ||
@@ -38,3 +38,3 @@ * Returns a map of paths/URLs and their correspond values. | ||
*/ | ||
values(...types: string[]): S; | ||
values(...types: (string | string[])[]): S; | ||
/** | ||
@@ -127,4 +127,4 @@ * Returns `true` if the given path exists in the schema; otherwise, returns `false` | ||
*/ | ||
toJSON: (...types: string[]) => S; | ||
toJSON: (...types: (string | string[])[]) => S; | ||
} | ||
export {}; |
@@ -49,3 +49,3 @@ "use strict"; | ||
paths(...types) { | ||
const paths = getPaths(this._$refs, types); | ||
const paths = getPaths(this._$refs, types.flat()); | ||
return paths.map((path) => { | ||
@@ -64,3 +64,3 @@ return (0, convert_path_to_posix_1.default)(path.decoded); | ||
const $refs = this._$refs; | ||
const paths = getPaths($refs, types); | ||
const paths = getPaths($refs, types.flat()); | ||
return paths.reduce((obj, path) => { | ||
@@ -67,0 +67,0 @@ obj[(0, convert_path_to_posix_1.default)(path.decoded)] = $refs[path.encoded].value; |
@@ -34,4 +34,4 @@ import { ono } from "@jsdevtools/ono"; | ||
*/ | ||
paths(...types: string[]): string[] { | ||
const paths = getPaths(this._$refs, types); | ||
paths(...types: (string | string[])[]): string[] { | ||
const paths = getPaths(this._$refs, types.flat()); | ||
return paths.map((path) => { | ||
@@ -49,5 +49,5 @@ return convertPathToPosix(path.decoded); | ||
*/ | ||
values(...types: string[]): S { | ||
values(...types: (string | string[])[]): S { | ||
const $refs = this._$refs; | ||
const paths = getPaths($refs, types); | ||
const paths = getPaths($refs, types.flat()); | ||
return paths.reduce<Record<string, any>>((obj, path) => { | ||
@@ -54,0 +54,0 @@ obj[convertPathToPosix(path.decoded)] = $refs[path.encoded].value; |
{ | ||
"name": "@apidevtools/json-schema-ref-parser", | ||
"version": "11.5.1", | ||
"version": "11.5.2", | ||
"description": "Parse, Resolve, and Dereference JSON Schema $ref pointers", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
330056