@apidevtools/json-schema-ref-parser
Advanced tools
Comparing version 11.6.4 to 11.6.5
@@ -85,3 +85,2 @@ "use strict"; | ||
}); | ||
// eslint-disable-next-line no-shadow | ||
for (const key of keys) { | ||
@@ -88,0 +87,0 @@ const keyPath = pointer_js_1.default.join(path, key); |
@@ -170,3 +170,5 @@ "use strict"; | ||
let circular = directCircular || parents.has(pointer.value); | ||
circular && foundCircularReference(path, $refs, options); | ||
if (circular) { | ||
foundCircularReference(path, $refs, options); | ||
} | ||
// Dereference the JSON reference | ||
@@ -173,0 +175,0 @@ let dereferencedValue = ref_js_1.default.dereference($ref, pointer.value); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.normalizeArgs = void 0; | ||
exports.normalizeArgs = normalizeArgs; | ||
const options_js_1 = require("./options.js"); | ||
@@ -55,3 +55,2 @@ /** | ||
} | ||
exports.normalizeArgs = normalizeArgs; | ||
exports.default = normalizeArgs; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import type { HTTPResolverOptions, JSONSchema, JSONSchemaObject, Plugin, ResolverOptions } from "./types/index.js"; | ||
@@ -94,3 +93,3 @@ export type DeepPartial<T> = T extends object ? { | ||
export declare const getJsonSchemaRefParserDefaultOptions: () => $RefParserOptions<JSONSchema>; | ||
export declare const getNewOptions: <S extends object = JSONSchema, O extends { | ||
export declare const getNewOptions: <S extends object = JSONSchema, O extends ParserOptions<S> = { | ||
parse?: { | ||
@@ -117,2 +116,3 @@ [x: string]: boolean | { | ||
readonly hasIndices?: boolean | undefined; | ||
readonly unicodeSets?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
@@ -146,2 +146,3 @@ [Symbol.replace]?: {} | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
readonly unicodeSets?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
@@ -175,2 +176,3 @@ [Symbol.replace]?: {} | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
readonly unicodeSets?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
@@ -204,2 +206,3 @@ [Symbol.replace]?: {} | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
readonly unicodeSets?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
@@ -233,2 +236,3 @@ [Symbol.replace]?: {} | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
readonly unicodeSets?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
@@ -261,2 +265,3 @@ [Symbol.replace]?: {} | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
readonly unicodeSets?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
@@ -300,2 +305,3 @@ [Symbol.replace]?: {} | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
readonly unicodeSets?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
@@ -327,2 +333,3 @@ [Symbol.replace]?: {} | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
readonly unicodeSets?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
@@ -367,2 +374,3 @@ [Symbol.replace]?: {} | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
readonly unicodeSets?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
@@ -379,291 +387,9 @@ [Symbol.replace]?: {} | undefined; | ||
dereference?: { | ||
circular?: boolean | "ignore" | undefined; | ||
circular?: (boolean | "ignore") | undefined; | ||
excludedPathMatcher?: {} | undefined; | ||
onDereference?: {} | undefined; | ||
externalReferenceResolution?: "relative" | "root" | undefined; | ||
externalReferenceResolution?: ("relative" | "root") | undefined; | ||
} | undefined; | ||
mutateInputSchema?: boolean | undefined; | ||
timeoutMs?: number | undefined; | ||
} = { | ||
parse?: { | ||
[x: string]: boolean | { | ||
name?: string | undefined; | ||
order?: number | undefined; | ||
allowEmpty?: boolean | undefined; | ||
allowBOM?: boolean | undefined; | ||
encoding?: BufferEncoding | undefined; | ||
canParse?: string | boolean | { | ||
exec?: {} | undefined; | ||
test?: {} | undefined; | ||
readonly source?: string | undefined; | ||
readonly global?: boolean | undefined; | ||
readonly ignoreCase?: boolean | undefined; | ||
readonly multiline?: boolean | undefined; | ||
lastIndex?: number | undefined; | ||
compile?: {} | undefined; | ||
readonly flags?: string | undefined; | ||
readonly sticky?: boolean | undefined; | ||
readonly unicode?: boolean | undefined; | ||
readonly dotAll?: boolean | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
[Symbol.replace]?: {} | undefined; | ||
[Symbol.search]?: {} | undefined; | ||
[Symbol.split]?: {} | undefined; | ||
[Symbol.matchAll]?: {} | undefined; | ||
} | (string | undefined)[] | {} | undefined; | ||
parse?: string | number | {} | undefined; | ||
} | undefined; | ||
json?: boolean | { | ||
name?: string | undefined; | ||
order?: number | undefined; | ||
allowEmpty?: boolean | undefined; | ||
allowBOM?: boolean | undefined; | ||
encoding?: BufferEncoding | undefined; | ||
canParse?: string | boolean | { | ||
exec?: {} | undefined; | ||
test?: {} | undefined; | ||
readonly source?: string | undefined; | ||
readonly global?: boolean | undefined; | ||
readonly ignoreCase?: boolean | undefined; | ||
readonly multiline?: boolean | undefined; | ||
lastIndex?: number | undefined; | ||
compile?: {} | undefined; | ||
readonly flags?: string | undefined; | ||
readonly sticky?: boolean | undefined; | ||
readonly unicode?: boolean | undefined; | ||
readonly dotAll?: boolean | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
[Symbol.replace]?: {} | undefined; | ||
[Symbol.search]?: {} | undefined; | ||
[Symbol.split]?: {} | undefined; | ||
[Symbol.matchAll]?: {} | undefined; | ||
} | (string | undefined)[] | {} | undefined; | ||
parse?: string | number | {} | undefined; | ||
} | undefined; | ||
yaml?: boolean | { | ||
name?: string | undefined; | ||
order?: number | undefined; | ||
allowEmpty?: boolean | undefined; | ||
allowBOM?: boolean | undefined; | ||
encoding?: BufferEncoding | undefined; | ||
canParse?: string | boolean | { | ||
exec?: {} | undefined; | ||
test?: {} | undefined; | ||
readonly source?: string | undefined; | ||
readonly global?: boolean | undefined; | ||
readonly ignoreCase?: boolean | undefined; | ||
readonly multiline?: boolean | undefined; | ||
lastIndex?: number | undefined; | ||
compile?: {} | undefined; | ||
readonly flags?: string | undefined; | ||
readonly sticky?: boolean | undefined; | ||
readonly unicode?: boolean | undefined; | ||
readonly dotAll?: boolean | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
[Symbol.replace]?: {} | undefined; | ||
[Symbol.search]?: {} | undefined; | ||
[Symbol.split]?: {} | undefined; | ||
[Symbol.matchAll]?: {} | undefined; | ||
} | (string | undefined)[] | {} | undefined; | ||
parse?: string | number | {} | undefined; | ||
} | undefined; | ||
binary?: boolean | { | ||
name?: string | undefined; | ||
order?: number | undefined; | ||
allowEmpty?: boolean | undefined; | ||
allowBOM?: boolean | undefined; | ||
encoding?: BufferEncoding | undefined; | ||
canParse?: string | boolean | { | ||
exec?: {} | undefined; | ||
test?: {} | undefined; | ||
readonly source?: string | undefined; | ||
readonly global?: boolean | undefined; | ||
readonly ignoreCase?: boolean | undefined; | ||
readonly multiline?: boolean | undefined; | ||
lastIndex?: number | undefined; | ||
compile?: {} | undefined; | ||
readonly flags?: string | undefined; | ||
readonly sticky?: boolean | undefined; | ||
readonly unicode?: boolean | undefined; | ||
readonly dotAll?: boolean | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
[Symbol.replace]?: {} | undefined; | ||
[Symbol.search]?: {} | undefined; | ||
[Symbol.split]?: {} | undefined; | ||
[Symbol.matchAll]?: {} | undefined; | ||
} | (string | undefined)[] | {} | undefined; | ||
parse?: string | number | {} | undefined; | ||
} | undefined; | ||
text?: boolean | { | ||
name?: string | undefined; | ||
order?: number | undefined; | ||
allowEmpty?: boolean | undefined; | ||
allowBOM?: boolean | undefined; | ||
encoding?: BufferEncoding | undefined; | ||
canParse?: string | boolean | { | ||
exec?: {} | undefined; | ||
test?: {} | undefined; | ||
readonly source?: string | undefined; | ||
readonly global?: boolean | undefined; | ||
readonly ignoreCase?: boolean | undefined; | ||
readonly multiline?: boolean | undefined; | ||
lastIndex?: number | undefined; | ||
compile?: {} | undefined; | ||
readonly flags?: string | undefined; | ||
readonly sticky?: boolean | undefined; | ||
readonly unicode?: boolean | undefined; | ||
readonly dotAll?: boolean | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
[Symbol.replace]?: {} | undefined; | ||
[Symbol.search]?: {} | undefined; | ||
[Symbol.split]?: {} | undefined; | ||
[Symbol.matchAll]?: {} | undefined; | ||
} | (string | undefined)[] | {} | undefined; | ||
parse?: string | number | {} | undefined; | ||
} | undefined; | ||
} | undefined; | ||
resolve?: { | ||
[x: string]: boolean | { | ||
name?: string | undefined; | ||
order?: number | undefined; | ||
canRead?: string | boolean | { | ||
exec?: {} | undefined; | ||
test?: {} | undefined; | ||
readonly source?: string | undefined; | ||
readonly global?: boolean | undefined; | ||
readonly ignoreCase?: boolean | undefined; | ||
readonly multiline?: boolean | undefined; | ||
lastIndex?: number | undefined; | ||
compile?: {} | undefined; | ||
readonly flags?: string | undefined; | ||
readonly sticky?: boolean | undefined; | ||
readonly unicode?: boolean | undefined; | ||
readonly dotAll?: boolean | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
[Symbol.replace]?: {} | undefined; | ||
[Symbol.search]?: {} | undefined; | ||
[Symbol.split]?: {} | undefined; | ||
[Symbol.matchAll]?: {} | undefined; | ||
} | (string | undefined)[] | {} | undefined; | ||
read?: string | object | {} | undefined; | ||
} | { | ||
headers?: ([(string | undefined)?, (string | undefined)?] | undefined)[] | { | ||
[x: string]: string | undefined; | ||
} | { | ||
append?: {} | undefined; | ||
delete?: {} | undefined; | ||
get?: {} | undefined; | ||
getSetCookie?: {} | undefined; | ||
has?: {} | undefined; | ||
set?: {} | undefined; | ||
forEach?: {} | undefined; | ||
} | null | undefined; | ||
timeout?: number | undefined; | ||
redirects?: number | undefined; | ||
withCredentials?: boolean | undefined; | ||
name?: string | undefined; | ||
order?: number | undefined; | ||
canRead?: string | boolean | { | ||
exec?: {} | undefined; | ||
test?: {} | undefined; | ||
readonly source?: string | undefined; | ||
readonly global?: boolean | undefined; | ||
readonly ignoreCase?: boolean | undefined; | ||
readonly multiline?: boolean | undefined; | ||
lastIndex?: number | undefined; | ||
compile?: {} | undefined; | ||
readonly flags?: string | undefined; | ||
readonly sticky?: boolean | undefined; | ||
readonly unicode?: boolean | undefined; | ||
readonly dotAll?: boolean | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
[Symbol.replace]?: {} | undefined; | ||
[Symbol.search]?: {} | undefined; | ||
[Symbol.split]?: {} | undefined; | ||
[Symbol.matchAll]?: {} | undefined; | ||
} | (string | undefined)[] | {} | undefined; | ||
read?: string | object | {} | undefined; | ||
} | undefined; | ||
external?: boolean | undefined; | ||
file?: boolean | { | ||
name?: string | undefined; | ||
order?: number | undefined; | ||
canRead?: string | boolean | { | ||
exec?: {} | undefined; | ||
test?: {} | undefined; | ||
readonly source?: string | undefined; | ||
readonly global?: boolean | undefined; | ||
readonly ignoreCase?: boolean | undefined; | ||
readonly multiline?: boolean | undefined; | ||
lastIndex?: number | undefined; | ||
compile?: {} | undefined; | ||
readonly flags?: string | undefined; | ||
readonly sticky?: boolean | undefined; | ||
readonly unicode?: boolean | undefined; | ||
readonly dotAll?: boolean | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
[Symbol.replace]?: {} | undefined; | ||
[Symbol.search]?: {} | undefined; | ||
[Symbol.split]?: {} | undefined; | ||
[Symbol.matchAll]?: {} | undefined; | ||
} | (string | undefined)[] | {} | undefined; | ||
read?: string | object | {} | undefined; | ||
} | undefined; | ||
http?: boolean | { | ||
headers?: ([(string | undefined)?, (string | undefined)?] | undefined)[] | { | ||
[x: string]: string | undefined; | ||
} | { | ||
append?: {} | undefined; | ||
delete?: {} | undefined; | ||
get?: {} | undefined; | ||
getSetCookie?: {} | undefined; | ||
has?: {} | undefined; | ||
set?: {} | undefined; | ||
forEach?: {} | undefined; | ||
} | null | undefined; | ||
timeout?: number | undefined; | ||
redirects?: number | undefined; | ||
withCredentials?: boolean | undefined; | ||
name?: string | undefined; | ||
order?: number | undefined; | ||
canRead?: string | boolean | { | ||
exec?: {} | undefined; | ||
test?: {} | undefined; | ||
readonly source?: string | undefined; | ||
readonly global?: boolean | undefined; | ||
readonly ignoreCase?: boolean | undefined; | ||
readonly multiline?: boolean | undefined; | ||
lastIndex?: number | undefined; | ||
compile?: {} | undefined; | ||
readonly flags?: string | undefined; | ||
readonly sticky?: boolean | undefined; | ||
readonly unicode?: boolean | undefined; | ||
readonly dotAll?: boolean | undefined; | ||
readonly hasIndices?: boolean | undefined; | ||
[Symbol.match]?: {} | undefined; | ||
[Symbol.replace]?: {} | undefined; | ||
[Symbol.search]?: {} | undefined; | ||
[Symbol.split]?: {} | undefined; | ||
[Symbol.matchAll]?: {} | undefined; | ||
} | (string | undefined)[] | {} | undefined; | ||
read?: string | object | {} | undefined; | ||
} | undefined; | ||
} | undefined; | ||
continueOnError?: boolean | undefined; | ||
dereference?: { | ||
circular?: boolean | "ignore" | undefined; | ||
excludedPathMatcher?: {} | undefined; | ||
onDereference?: {} | undefined; | ||
externalReferenceResolution?: "relative" | "root" | undefined; | ||
} | undefined; | ||
mutateInputSchema?: boolean | undefined; | ||
timeoutMs?: number | undefined; | ||
}>(options: O | undefined) => O & $RefParserOptions<S>; | ||
@@ -670,0 +396,0 @@ export type Options<S extends object = JSONSchema> = $RefParserOptions<S>; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import type $Refs from "./refs.js"; | ||
@@ -3,0 +2,0 @@ import type { ParserOptions } from "./options.js"; |
@@ -55,3 +55,3 @@ "use strict"; | ||
} | ||
catch (e) { | ||
catch { | ||
return false; | ||
@@ -58,0 +58,0 @@ } |
@@ -88,3 +88,3 @@ "use strict"; | ||
} | ||
catch (e) { | ||
catch { | ||
return false; | ||
@@ -91,0 +91,0 @@ } |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import type { JSONSchema4, JSONSchema4Object, JSONSchema6, JSONSchema6Object, JSONSchema7, JSONSchema7Object } from "json-schema"; | ||
@@ -16,3 +15,3 @@ import type $Refs from "../refs.js"; | ||
*/ | ||
headers?: RequestInit['headers'] | null; | ||
headers?: RequestInit["headers"] | null; | ||
/** | ||
@@ -19,0 +18,0 @@ * The amount of time (in milliseconds) to wait for a response from the server when downloading files. The default is 5 seconds. |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = convertPathToPosix; | ||
const path_1 = __importDefault(require("path")); | ||
@@ -15,2 +16,1 @@ function convertPathToPosix(filePath) { | ||
} | ||
exports.default = convertPathToPosix; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.normalizeError = exports.isHandledError = exports.InvalidPointerError = exports.TimeoutError = exports.MissingPointerError = exports.UnmatchedResolverError = exports.ResolverError = exports.UnmatchedParserError = exports.ParserError = exports.JSONParserErrorGroup = exports.JSONParserError = void 0; | ||
exports.InvalidPointerError = exports.TimeoutError = exports.MissingPointerError = exports.UnmatchedResolverError = exports.ResolverError = exports.UnmatchedParserError = exports.ParserError = exports.JSONParserErrorGroup = exports.JSONParserError = void 0; | ||
exports.isHandledError = isHandledError; | ||
exports.normalizeError = normalizeError; | ||
const ono_1 = require("@jsdevtools/ono"); | ||
@@ -105,3 +107,2 @@ const url_js_1 = require("./url.js"); | ||
} | ||
exports.isHandledError = isHandledError; | ||
function normalizeError(err) { | ||
@@ -113,2 +114,1 @@ if (err.path === null) { | ||
} | ||
exports.normalizeError = normalizeError; |
@@ -6,2 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.default = maybe; | ||
const next_js_1 = __importDefault(require("./next.js")); | ||
@@ -25,2 +26,1 @@ function maybe(cb, promise) { | ||
} | ||
exports.default = maybe; |
@@ -1,2 +0,1 @@ | ||
/// <reference types="node" /> | ||
import type { FileInfo, JSONSchema } from "../types/index.js"; | ||
@@ -3,0 +2,0 @@ import type { ParserOptions } from "../options.js"; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.run = exports.sort = exports.filter = exports.all = void 0; | ||
exports.all = all; | ||
exports.filter = filter; | ||
exports.sort = sort; | ||
exports.run = run; | ||
/** | ||
@@ -20,3 +23,2 @@ * Returns the given plugins as an array, rather than an object map. | ||
} | ||
exports.all = all; | ||
/** | ||
@@ -30,3 +32,2 @@ * Filters the given plugins, returning only the ones return `true` for the given method. | ||
} | ||
exports.filter = filter; | ||
/** | ||
@@ -43,3 +44,2 @@ * Sorts the given plugins, in place, by their `order` property. | ||
} | ||
exports.sort = sort; | ||
/** | ||
@@ -109,3 +109,2 @@ * Runs the specified method of the given plugins, in order, until one of them returns a successful result. | ||
} | ||
exports.run = run; | ||
/** | ||
@@ -112,0 +111,0 @@ * Returns the value of the given property. |
@@ -29,3 +29,16 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.relative = exports.safePointerToPath = exports.toFileSystemPath = exports.fromFileSystemPath = exports.isFileSystemPath = exports.isHttp = exports.stripHash = exports.getHash = exports.stripQuery = exports.getExtension = exports.getProtocol = exports.cwd = exports.resolve = exports.parse = void 0; | ||
exports.parse = void 0; | ||
exports.resolve = resolve; | ||
exports.cwd = cwd; | ||
exports.getProtocol = getProtocol; | ||
exports.getExtension = getExtension; | ||
exports.stripQuery = stripQuery; | ||
exports.getHash = getHash; | ||
exports.stripHash = stripHash; | ||
exports.isHttp = isHttp; | ||
exports.isFileSystemPath = isFileSystemPath; | ||
exports.fromFileSystemPath = fromFileSystemPath; | ||
exports.toFileSystemPath = toFileSystemPath; | ||
exports.safePointerToPath = safePointerToPath; | ||
exports.relative = relative; | ||
const convert_path_to_posix_1 = __importDefault(require("./convert-path-to-posix")); | ||
@@ -64,3 +77,2 @@ const path_1 = __importStar(require("path")); | ||
} | ||
exports.resolve = resolve; | ||
/** | ||
@@ -84,3 +96,2 @@ * Returns the current working directory (in Node) or the current page URL (in browsers). | ||
} | ||
exports.cwd = cwd; | ||
/** | ||
@@ -99,3 +110,2 @@ * Returns the protocol of the given URL, or `undefined` if it has no protocol. | ||
} | ||
exports.getProtocol = getProtocol; | ||
/** | ||
@@ -115,3 +125,2 @@ * Returns the lowercased file extension of the given URL, | ||
} | ||
exports.getExtension = getExtension; | ||
/** | ||
@@ -130,3 +139,2 @@ * Removes the query, if any, from the given path. | ||
} | ||
exports.stripQuery = stripQuery; | ||
/** | ||
@@ -149,3 +157,2 @@ * Returns the hash (URL fragment), of the given path. | ||
} | ||
exports.getHash = getHash; | ||
/** | ||
@@ -167,3 +174,2 @@ * Removes the hash (URL fragment), if any, from the given path. | ||
} | ||
exports.stripHash = stripHash; | ||
/** | ||
@@ -189,3 +195,2 @@ * Determines whether the given path is an HTTP(S) URL. | ||
} | ||
exports.isHttp = isHttp; | ||
/** | ||
@@ -200,3 +205,3 @@ * Determines whether the given path is a filesystem path. | ||
// @ts-ignore | ||
if (typeof window !== "undefined" || process.browser) { | ||
if (typeof window !== "undefined" || (typeof process !== "undefined" && process.browser)) { | ||
// We're running in a browser, so assume that all paths are URLs. | ||
@@ -209,3 +214,2 @@ // This way, even relative paths will be treated as URLs rather than as filesystem paths | ||
} | ||
exports.isFileSystemPath = isFileSystemPath; | ||
/** | ||
@@ -256,3 +260,2 @@ * Converts a filesystem path to a properly-encoded URL. | ||
} | ||
exports.fromFileSystemPath = fromFileSystemPath; | ||
/** | ||
@@ -303,3 +306,2 @@ * Converts a URL to a local filesystem path. | ||
} | ||
exports.toFileSystemPath = toFileSystemPath; | ||
/** | ||
@@ -322,3 +324,2 @@ * Converts a $ref pointer to a valid JSON Path. | ||
} | ||
exports.safePointerToPath = safePointerToPath; | ||
function relative(from, to) { | ||
@@ -333,2 +334,1 @@ if (!isFileSystemPath(from) || !isFileSystemPath(to)) { | ||
} | ||
exports.relative = relative; |
@@ -90,3 +90,2 @@ import $Ref from "./ref.js"; | ||
// eslint-disable-next-line no-shadow | ||
for (const key of keys) { | ||
@@ -294,3 +293,3 @@ const keyPath = Pointer.join(path, key); | ||
} | ||
return undefined | ||
return undefined; | ||
} | ||
@@ -297,0 +296,0 @@ |
@@ -224,3 +224,5 @@ import $Ref from "./ref.js"; | ||
let circular = directCircular || parents.has(pointer.value); | ||
circular && foundCircularReference(path, $refs, options); | ||
if (circular) { | ||
foundCircularReference(path, $refs, options); | ||
} | ||
@@ -227,0 +229,0 @@ // Dereference the JSON reference |
@@ -287,3 +287,3 @@ import type { ParserOptions } from "./options.js"; | ||
} | ||
return undefined | ||
return undefined; | ||
} | ||
@@ -290,0 +290,0 @@ export default Pointer; |
@@ -94,3 +94,3 @@ import Pointer from "./pointer.js"; | ||
return true; | ||
} catch (e) { | ||
} catch { | ||
return false; | ||
@@ -199,3 +199,3 @@ } | ||
} | ||
return undefined | ||
return undefined; | ||
} | ||
@@ -202,0 +202,0 @@ |
@@ -75,3 +75,3 @@ import { ono } from "@jsdevtools/ono"; | ||
return true; | ||
} catch (e) { | ||
} catch { | ||
return false; | ||
@@ -78,0 +78,0 @@ } |
@@ -28,3 +28,3 @@ import type { | ||
*/ | ||
headers?: RequestInit['headers'] | null; | ||
headers?: RequestInit["headers"] | null; | ||
@@ -31,0 +31,0 @@ /** |
@@ -166,3 +166,3 @@ import convertPathToPosix from "./convert-path-to-posix"; | ||
// @ts-ignore | ||
if (typeof window !== "undefined" || process.browser) { | ||
if (typeof window !== "undefined" || (typeof process !== "undefined" && process.browser)) { | ||
// We're running in a browser, so assume that all paths are URLs. | ||
@@ -169,0 +169,0 @@ // This way, even relative paths will be treated as URLs rather than as filesystem paths |
{ | ||
"name": "@apidevtools/json-schema-ref-parser", | ||
"version": "11.6.4", | ||
"version": "11.6.5", | ||
"description": "Parse, Resolve, and Dereference JSON Schema $ref pointers", | ||
@@ -70,21 +70,25 @@ "keywords": [ | ||
"devDependencies": { | ||
"@types/eslint": "8.56.10", | ||
"@eslint/compat": "^1.1.1", | ||
"@eslint/js": "^9.8.0", | ||
"@types/eslint": "9.6.0", | ||
"@types/js-yaml": "^4.0.9", | ||
"@types/node": "^18", | ||
"@typescript-eslint/eslint-plugin": "^7.9.0", | ||
"@typescript-eslint/parser": "^7.9.0", | ||
"@vitest/coverage-v8": "^1.6.0", | ||
"@types/node": "^22", | ||
"@typescript-eslint/eslint-plugin": "^8.0.0", | ||
"@typescript-eslint/parser": "^8.0.0", | ||
"@vitest/coverage-v8": "^2.0.5", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.57.0", | ||
"eslint": "^9.8.0", | ||
"eslint-config-prettier": "^9.1.0", | ||
"eslint-config-standard": "^17.1.0", | ||
"eslint-plugin-import": "^2.29.1", | ||
"eslint-plugin-prettier": "^5.1.3", | ||
"eslint-plugin-promise": "^6.1.1", | ||
"eslint-plugin-unused-imports": "^3.2.0", | ||
"jsdom": "^24.1.0", | ||
"prettier": "^3.3.0", | ||
"rimraf": "^5.0.7", | ||
"typescript": "^5.4.5", | ||
"vitest": "^1.6.0" | ||
"eslint-plugin-prettier": "^5.2.1", | ||
"eslint-plugin-promise": "^7.0.0", | ||
"eslint-plugin-unused-imports": "^4.0.1", | ||
"globals": "^15.9.0", | ||
"jsdom": "^24.1.1", | ||
"prettier": "^3.3.3", | ||
"rimraf": "^6.0.1", | ||
"typescript": "^5.5.4", | ||
"typescript-eslint": "^8.0.0", | ||
"vitest": "^2.0.5" | ||
}, | ||
@@ -91,0 +95,0 @@ "dependencies": { |
@@ -12,4 +12,4 @@ # JSON Schema $Ref Parser | ||
Installation | ||
-------------------------- | ||
## Installation | ||
Install using [npm](https://docs.npmjs.com/about-npm/): | ||
@@ -23,4 +23,4 @@ | ||
The Problem: | ||
-------------------------- | ||
## The Problem: | ||
You've got a JSON Schema with `$ref` pointers to other files and/or URLs. Maybe you know all the referenced files ahead | ||
@@ -53,4 +53,4 @@ of time. Maybe you don't. Maybe some are local files, and others are remote URLs. Maybe they are a mix of JSON and YAML | ||
The Solution: | ||
-------------------------- | ||
## The Solution: | ||
JSON Schema $Ref Parser is a full [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03) | ||
@@ -74,4 +74,3 @@ and [JSON Pointer](https://tools.ietf.org/html/rfc6901) implementation that crawls even the most | ||
Example | ||
-------------------------- | ||
## Example | ||
@@ -96,7 +95,4 @@ ```javascript | ||
## Polyfills | ||
Polyfills | ||
-------------------------- | ||
If you are using Node.js < 18, you'll need a polyfill for `fetch`, | ||
@@ -111,4 +107,4 @@ like [node-fetch](https://github.com/node-fetch/node-fetch): | ||
Browser support | ||
-------------------------- | ||
## Browser support | ||
JSON Schema $Ref Parser supports recent versions of every major web browser. Older browsers may | ||
@@ -130,23 +126,21 @@ require [Babel](https://babeljs.io/) and/or [polyfills](https://babeljs.io/docs/en/next/babel-polyfill). | ||
config.resolve.fallback = { | ||
"path": require.resolve("path-browserify"), | ||
'fs': require.resolve('browserify-fs') | ||
} | ||
path: require.resolve("path-browserify"), | ||
fs: require.resolve("browserify-fs"), | ||
}; | ||
config.plugins.push( | ||
new webpack.ProvidePlugin({ | ||
Buffer: ['buffer', 'Buffer'] | ||
}) | ||
) | ||
Buffer: ["buffer", "Buffer"], | ||
}), | ||
); | ||
``` | ||
API Documentation | ||
-------------------------- | ||
## API Documentation | ||
Full API documentation is available [right here](https://apitools.dev/json-schema-ref-parser/docs/) | ||
## Contributing | ||
Contributing | ||
-------------------------- | ||
I welcome any contributions, enhancements, and | ||
bug-fixes. [Open an issue](https://github.com/APIDevTools/json-schema-ref-parser/issues) on GitHub | ||
bug-fixes. [Open an issue](https://github.com/APIDevTools/json-schema-ref-parser/issues) on GitHub | ||
and [submit a pull request](https://github.com/APIDevTools/json-schema-ref-parser/pulls). | ||
@@ -158,13 +152,13 @@ | ||
1. __Clone this repo__<br> | ||
1. **Clone this repo**<br> | ||
`git clone https://github.com/APIDevTools/json-schema-ref-parser.git` | ||
2. __Install dependencies__<br> | ||
2. **Install dependencies**<br> | ||
`yarn install` | ||
3. __Run the tests__<br> | ||
3. **Run the tests**<br> | ||
`yarn test` | ||
License | ||
-------------------------- | ||
## License | ||
JSON Schema $Ref Parser is 100% free and open-source, under the [MIT license](LICENSE). Use it however you want. | ||
@@ -176,6 +170,4 @@ | ||
## Big Thanks To | ||
Big Thanks To | ||
-------------------------- | ||
Thanks to these awesome companies for their support of Open Source developers ❤ | ||
@@ -182,0 +174,0 @@ |
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
323712
23
7679
169