@apidevtools/json-schema-ref-parser 15.1.3 → 15.2.1

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.
@@ -1,6 +1,8 @@
1
1
  import $Refs from "./refs.js";
2
2
  import normalizeArgs from "./normalize-args.js";
3
3
  import _dereference from "./dereference.js";
4
+ import FileResolver from "./resolvers/file.js";
5
+ import HTTPResolver from "./resolvers/http.js";
4
6
  import { JSONParserError, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, UnmatchedResolverError, isHandledError, JSONParserErrorGroup } from "./util/errors.js";
5
7
  import type { ParserOptions } from "./options.js";
6
8
  import { getJsonSchemaRefParserDefaultOptions } from "./options.js";
@@ -160,4 +162,4 @@ export declare const parse: typeof $RefParser.parse;
160
162
  export declare const resolve: typeof $RefParser.resolve;
161
163
  export declare const bundle: typeof $RefParser.bundle;
162
164
  export declare const dereference: typeof $RefParser.dereference;
163
- 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, $Refs, isUnsafeUrl, };
165
+ 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, $Refs, isUnsafeUrl, FileResolver, HTTPResolver, };
package/dist/lib/index.js CHANGED
@@ -5,6 +5,8 @@ import resolveExternal from "./resolve-external.js";
5
5
  import _bundle from "./bundle.js";
6
6
  import _dereference from "./dereference.js";
7
7
  import * as url from "./util/url.js";
8
+ import FileResolver from "./resolvers/file.js";
9
+ import HTTPResolver from "./resolvers/http.js";
8
10
  import { JSONParserError, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, UnmatchedResolverError, isHandledError, JSONParserErrorGroup, } from "./util/errors.js";
9
11
  import maybe from "./util/maybe.js";
10
12
  import { getJsonSchemaRefParserDefaultOptions } from "./options.js";
@@ -160,4 +162,4 @@ export const parse = $RefParser.parse;
160
162
  export const resolve = $RefParser.resolve;
161
163
  export const bundle = $RefParser.bundle;
162
164
  export const dereference = $RefParser.dereference;
163
- export { UnmatchedResolverError, JSONParserError, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, isHandledError, JSONParserErrorGroup, _dereference as dereferenceInternal, normalizeArgs as jsonSchemaParserNormalizeArgs, getJsonSchemaRefParserDefaultOptions, $Refs, isUnsafeUrl, };
165
+ export { UnmatchedResolverError, JSONParserError, InvalidPointerError, MissingPointerError, ResolverError, ParserError, UnmatchedParserError, isHandledError, JSONParserErrorGroup, _dereference as dereferenceInternal, normalizeArgs as jsonSchemaParserNormalizeArgs, getJsonSchemaRefParserDefaultOptions, $Refs, isUnsafeUrl, FileResolver, HTTPResolver, };
@@ -106,7 +106,7 @@ async function download(u, httpOptions, _redirects) {
106
106
  async function get(u, httpOptions) {
107
107
  let controller;
108
108
  let timeoutId;
109
- if (httpOptions.timeout) {
109
+ if (httpOptions.timeout && typeof AbortController !== "undefined") {
110
110
  controller = new AbortController();
111
111
  timeoutId = setTimeout(() => controller.abort(), httpOptions.timeout);
112
112
  }
package/lib/index.ts CHANGED
@@ -5,6 +5,8 @@ import resolveExternal from "./resolve-external.js";
5
5
  import _bundle from "./bundle.js";
6
6
  import _dereference from "./dereference.js";
7
7
  import * as url from "./util/url.js";
8
+ import FileResolver from "./resolvers/file.js";
9
+ import HTTPResolver from "./resolvers/http.js";
8
10
  import {
9
11
  JSONParserError,
10
12
  InvalidPointerError,
@@ -441,4 +443,6 @@ export {
441
443
  getJsonSchemaRefParserDefaultOptions,
442
444
  $Refs,
443
445
  isUnsafeUrl,
446
+ FileResolver,
447
+ HTTPResolver,
444
448
  };
@@ -121,7 +121,7 @@ async function download<S extends object = JSONSchema>(
121
121
  async function get<S extends object = JSONSchema>(u: RequestInfo | URL, httpOptions: HTTPResolverOptions<S>) {
122
122
  let controller: any;
123
123
  let timeoutId: any;
124
- if (httpOptions.timeout) {
124
+ if (httpOptions.timeout && typeof AbortController !== "undefined") {
125
125
  controller = new AbortController();
126
126
  timeoutId = setTimeout(() => controller.abort(), httpOptions.timeout);
127
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apidevtools/json-schema-ref-parser",
3
- "version": "15.1.3",
3
+ "version": "15.2.1",
4
4
  "description": "Parse, Resolve, and Dereference JSON Schema $ref pointers",
5
5
  "type": "module",
6
6
  "types": "dist/lib/index.d.ts",
@@ -75,29 +75,29 @@
75
75
  "js-yaml": "^4.1.1"
76
76
  },
77
77
  "devDependencies": {
78
- "@eslint/compat": "^2.0.0",
79
- "@eslint/js": "^9.39.1",
78
+ "@eslint/compat": "^2.0.1",
79
+ "@eslint/js": "^9.39.2",
80
80
  "@types/eslint": "^9.6.1",
81
81
  "@types/js-yaml": "^4.0.9",
82
82
  "@types/json-schema": "^7.0.15",
83
- "@types/node": "^24",
84
- "@typescript-eslint/eslint-plugin": "^8.48.0",
85
- "@typescript-eslint/parser": "^8.48.0",
86
- "@vitest/coverage-v8": "^4.0.14",
83
+ "@types/node": "^25",
84
+ "@typescript-eslint/eslint-plugin": "^8.53.0",
85
+ "@typescript-eslint/parser": "^8.53.0",
86
+ "@vitest/coverage-v8": "^4.0.17",
87
87
  "cross-env": "^10.1.0",
88
- "eslint": "^9.39.1",
88
+ "eslint": "^9.39.2",
89
89
  "eslint-config-prettier": "^10.1.8",
90
90
  "eslint-plugin-import": "^2.32.0",
91
- "eslint-plugin-prettier": "^5.5.4",
91
+ "eslint-plugin-prettier": "^5.5.5",
92
92
  "eslint-plugin-promise": "^7.2.1",
93
93
  "eslint-plugin-unused-imports": "^4.3.0",
94
- "globals": "^16.5.0",
95
- "jsdom": "^27.2.0",
96
- "prettier": "^3.7.3",
94
+ "globals": "^17.0.0",
95
+ "jsdom": "^27.4.0",
96
+ "prettier": "^3.8.0",
97
97
  "rimraf": "^6.1.2",
98
98
  "typescript": "^5.9.3",
99
- "typescript-eslint": "^8.48.0",
100
- "vitest": "^4.0.14"
99
+ "typescript-eslint": "^8.53.0",
100
+ "vitest": "^4.0.17"
101
101
  },
102
102
  "release": {
103
103
  "branches": [