@apidevtools/json-schema-ref-parser 11.7.0 → 11.7.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/dereference.js +1 -1
- package/dist/lib/index.d.ts +4 -1
- package/dist/lib/index.js +5 -1
- package/lib/dereference.ts +1 -1
- package/lib/index.ts +4 -0
- package/package.json +1 -1
package/dist/lib/dereference.js
CHANGED
|
@@ -140,7 +140,7 @@ function dereference$Ref($ref, path, pathFromRoot, parents, processedObjects, de
|
|
|
140
140
|
const shouldResolveOnCwd = isExternalRef && options?.dereference?.externalReferenceResolution === "root";
|
|
141
141
|
const $refPath = url.resolve(shouldResolveOnCwd ? url.cwd() : path, $ref.$ref);
|
|
142
142
|
const cache = dereferencedCache.get($refPath);
|
|
143
|
-
if (cache) {
|
|
143
|
+
if (cache && !cache.circular) {
|
|
144
144
|
const refKeys = Object.keys($ref);
|
|
145
145
|
if (refKeys.length > 1) {
|
|
146
146
|
const extraKeys = {};
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import $Refs from "./refs.js";
|
|
2
|
+
import normalizeArgs from "./normalize-args.js";
|
|
3
|
+
import _dereference from "./dereference.js";
|
|
2
4
|
import { JSONParserError, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, UnmatchedResolverError, isHandledError, JSONParserErrorGroup } from "./util/errors.js";
|
|
3
5
|
import type { ParserOptions } from "./options.js";
|
|
6
|
+
import { getJsonSchemaRefParserDefaultOptions } from "./options.js";
|
|
4
7
|
import type { $RefsCallback, JSONSchema, SchemaCallback, FileInfo, Plugin, ResolverOptions, HTTPResolverOptions } from "./types/index.js";
|
|
5
8
|
export type RefParserSchema = string | JSONSchema;
|
|
6
9
|
/**
|
|
@@ -156,4 +159,4 @@ export declare const parse: typeof $RefParser.parse;
|
|
|
156
159
|
export declare const resolve: typeof $RefParser.resolve;
|
|
157
160
|
export declare const bundle: typeof $RefParser.bundle;
|
|
158
161
|
export declare const dereference: typeof $RefParser.dereference;
|
|
159
|
-
export { UnmatchedResolverError, JSONParserError, JSONSchema, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, ParserOptions, $RefsCallback, isHandledError, JSONParserErrorGroup, SchemaCallback, FileInfo, Plugin, ResolverOptions, HTTPResolverOptions, };
|
|
162
|
+
export { UnmatchedResolverError, JSONParserError, JSONSchema, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, ParserOptions, $RefsCallback, isHandledError, JSONParserErrorGroup, SchemaCallback, FileInfo, Plugin, ResolverOptions, HTTPResolverOptions, _dereference as dereferenceInternal, normalizeArgs as jsonSchemaParserNormalizeArgs, getJsonSchemaRefParserDefaultOptions, };
|
package/dist/lib/index.js
CHANGED
|
@@ -26,13 +26,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.JSONParserErrorGroup = exports.isHandledError = exports.UnmatchedParserError = exports.ParserError = exports.ResolverError = exports.MissingPointerError = exports.InvalidPointerError = exports.JSONParserError = exports.UnmatchedResolverError = exports.dereference = exports.bundle = exports.resolve = exports.parse = exports.$RefParser = void 0;
|
|
29
|
+
exports.getJsonSchemaRefParserDefaultOptions = exports.jsonSchemaParserNormalizeArgs = exports.dereferenceInternal = exports.JSONParserErrorGroup = exports.isHandledError = exports.UnmatchedParserError = exports.ParserError = exports.ResolverError = exports.MissingPointerError = exports.InvalidPointerError = exports.JSONParserError = exports.UnmatchedResolverError = exports.dereference = exports.bundle = exports.resolve = exports.parse = exports.$RefParser = void 0;
|
|
30
30
|
const refs_js_1 = __importDefault(require("./refs.js"));
|
|
31
31
|
const parse_js_1 = __importDefault(require("./parse.js"));
|
|
32
32
|
const normalize_args_js_1 = __importDefault(require("./normalize-args.js"));
|
|
33
|
+
exports.jsonSchemaParserNormalizeArgs = normalize_args_js_1.default;
|
|
33
34
|
const resolve_external_js_1 = __importDefault(require("./resolve-external.js"));
|
|
34
35
|
const bundle_js_1 = __importDefault(require("./bundle.js"));
|
|
35
36
|
const dereference_js_1 = __importDefault(require("./dereference.js"));
|
|
37
|
+
exports.dereferenceInternal = dereference_js_1.default;
|
|
36
38
|
const url = __importStar(require("./util/url.js"));
|
|
37
39
|
const errors_js_1 = require("./util/errors.js");
|
|
38
40
|
Object.defineProperty(exports, "JSONParserError", { enumerable: true, get: function () { return errors_js_1.JSONParserError; } });
|
|
@@ -46,6 +48,8 @@ Object.defineProperty(exports, "isHandledError", { enumerable: true, get: functi
|
|
|
46
48
|
Object.defineProperty(exports, "JSONParserErrorGroup", { enumerable: true, get: function () { return errors_js_1.JSONParserErrorGroup; } });
|
|
47
49
|
const ono_1 = require("@jsdevtools/ono");
|
|
48
50
|
const maybe_js_1 = __importDefault(require("./util/maybe.js"));
|
|
51
|
+
const options_js_1 = require("./options.js");
|
|
52
|
+
Object.defineProperty(exports, "getJsonSchemaRefParserDefaultOptions", { enumerable: true, get: function () { return options_js_1.getJsonSchemaRefParserDefaultOptions; } });
|
|
49
53
|
/**
|
|
50
54
|
* This class parses a JSON schema, builds a map of its JSON references and their resolved values,
|
|
51
55
|
* and provides methods for traversing, manipulating, and dereferencing those references.
|
package/lib/dereference.ts
CHANGED
|
@@ -190,7 +190,7 @@ function dereference$Ref<S extends object = JSONSchema, O extends ParserOptions<
|
|
|
190
190
|
const $refPath = url.resolve(shouldResolveOnCwd ? url.cwd() : path, $ref.$ref);
|
|
191
191
|
|
|
192
192
|
const cache = dereferencedCache.get($refPath);
|
|
193
|
-
if (cache) {
|
|
193
|
+
if (cache && !cache.circular) {
|
|
194
194
|
const refKeys = Object.keys($ref);
|
|
195
195
|
if (refKeys.length > 1) {
|
|
196
196
|
const extraKeys = {};
|
package/lib/index.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import { ono } from "@jsdevtools/ono";
|
|
20
20
|
import maybe from "./util/maybe.js";
|
|
21
21
|
import type { ParserOptions } from "./options.js";
|
|
22
|
+
import { getJsonSchemaRefParserDefaultOptions } from "./options.js";
|
|
22
23
|
import type {
|
|
23
24
|
$RefsCallback,
|
|
24
25
|
JSONSchema,
|
|
@@ -446,4 +447,7 @@ export {
|
|
|
446
447
|
Plugin,
|
|
447
448
|
ResolverOptions,
|
|
448
449
|
HTTPResolverOptions,
|
|
450
|
+
_dereference as dereferenceInternal,
|
|
451
|
+
normalizeArgs as jsonSchemaParserNormalizeArgs,
|
|
452
|
+
getJsonSchemaRefParserDefaultOptions,
|
|
449
453
|
};
|