@apidevtools/json-schema-ref-parser 9.0.1 → 9.0.6

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/README.md CHANGED
@@ -2,7 +2,7 @@ JSON Schema $Ref Parser
2
2
  ============================
3
3
  #### Parse, Resolve, and Dereference JSON Schema $ref pointers
4
4
 
5
- [![Build Status](https://github.com/APIDevTools/json-schema-ref-parser/workflows/CI-CD/badge.svg?branch=master)](https://github.com/APIDevTools/json-schema-ref-parser/blob/master/.github/workflows/CI-CD.yaml)
5
+ [![Build Status](https://github.com/APIDevTools/json-schema-ref-parser/workflows/CI-CD/badge.svg?branch=master)](https://github.com/APIDevTools/json-schema-ref-parser/actions)
6
6
  [![Coverage Status](https://coveralls.io/repos/github/APIDevTools/json-schema-ref-parser/badge.svg?branch=master)](https://coveralls.io/github/APIDevTools/json-schema-ref-parser)
7
7
 
8
8
  [![npm](https://img.shields.io/npm/v/@apidevtools/json-schema-ref-parser.svg)](https://www.npmjs.com/package/@apidevtools/json-schema-ref-parser)
@@ -11,7 +11,7 @@ JSON Schema $Ref Parser
11
11
  [![Buy us a tree](https://img.shields.io/badge/Treeware-%F0%9F%8C%B3-lightgreen)](https://plant.treeware.earth/APIDevTools/json-schema-ref-parser)
12
12
 
13
13
 
14
- [![OS and Browser Compatibility](https://apitools.dev/img/badges/ci-badges-with-ie.svg)](https://github.com/APIDevTools/json-schema-ref-parser/blob/master/.github/workflows/CI-CD.yaml)
14
+ [![OS and Browser Compatibility](https://apitools.dev/img/badges/ci-badges-with-ie.svg)](https://github.com/APIDevTools/json-schema-ref-parser/actions)
15
15
 
16
16
 
17
17
  The Problem:
@@ -129,7 +129,7 @@ Full API documentation is available [right here](https://apitools.dev/json-schem
129
129
 
130
130
  Contributing
131
131
  --------------------------
132
- I welcome any contributions, enhancements, and bug-fixes. [File 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).
132
+ I welcome any contributions, enhancements, and 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).
133
133
 
134
134
  #### Building/Testing
135
135
  To build/test the project locally on your computer:
package/lib/bundle.js CHANGED
@@ -39,7 +39,7 @@ function bundle (parser, options) {
39
39
  function crawl (parent, key, path, pathFromRoot, indirections, inventory, $refs, options) {
40
40
  let obj = key === null ? parent : parent[key];
41
41
 
42
- if (obj && typeof obj === "object") {
42
+ if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj)) {
43
43
  if ($Ref.isAllowed$Ref(obj)) {
44
44
  inventory$Ref(parent, key, path, pathFromRoot, indirections, inventory, $refs, options);
45
45
  }
@@ -135,7 +135,9 @@ function inventory$Ref ($refParent, $refKey, path, pathFromRoot, indirections, i
135
135
  });
136
136
 
137
137
  // Recursively crawl the resolved value
138
- crawl(pointer.value, null, pointer.path, pathFromRoot, indirections + 1, inventory, $refs, options);
138
+ if (!existingEntry) {
139
+ crawl(pointer.value, null, pointer.path, pathFromRoot, indirections + 1, inventory, $refs, options);
140
+ }
139
141
  }
140
142
 
141
143
  /**
@@ -39,7 +39,7 @@ function crawl (obj, path, pathFromRoot, parents, $refs, options) {
39
39
  circular: false
40
40
  };
41
41
 
42
- if (obj && typeof obj === "object") {
42
+ if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj)) {
43
43
  parents.push(obj);
44
44
 
45
45
  if ($Ref.isAllowed$Ref(obj, options)) {
@@ -57,13 +57,19 @@ function crawl (obj, path, pathFromRoot, parents, $refs, options) {
57
57
  if ($Ref.isAllowed$Ref(value, options)) {
58
58
  dereferenced = dereference$Ref(value, keyPath, keyPathFromRoot, parents, $refs, options);
59
59
  circular = dereferenced.circular;
60
- obj[key] = dereferenced.value;
60
+ // Avoid pointless mutations; breaks frozen objects to no profit
61
+ if (obj[key] !== dereferenced.value) {
62
+ obj[key] = dereferenced.value;
63
+ }
61
64
  }
62
65
  else {
63
66
  if (parents.indexOf(value) === -1) {
64
67
  dereferenced = crawl(value, keyPath, keyPathFromRoot, parents, $refs, options);
65
68
  circular = dereferenced.circular;
66
- obj[key] = dereferenced.value;
69
+ // Avoid pointless mutations; breaks frozen objects to no profit
70
+ if (obj[key] !== dereferenced.value) {
71
+ obj[key] = dereferenced.value;
72
+ }
67
73
  }
68
74
  else {
69
75
  circular = foundCircularReference(keyPath, $refs, options);
@@ -96,7 +102,7 @@ function dereference$Ref ($ref, path, pathFromRoot, parents, $refs, options) {
96
102
  // console.log('Dereferencing $ref pointer "%s" at %s', $ref.$ref, path);
97
103
 
98
104
  let $refPath = url.resolve(path, $ref.$ref);
99
- let pointer = $refs._resolve($refPath, pathFromRoot, options);
105
+ let pointer = $refs._resolve($refPath, path, options);
100
106
 
101
107
  if (pointer === null) {
102
108
  return {
package/lib/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { JSONSchema4, JSONSchema4Type, JSONSchema6, JSONSchema6Type } from 'json-schema';
1
+ import { JSONSchema4, JSONSchema4Type, JSONSchema6, JSONSchema6Type } from "json-schema";
2
2
 
3
- export = $RefParser
3
+ export = $RefParser;
4
4
 
5
5
  /**
6
6
  * This is the default export of JSON Schema $Ref Parser. You can creates instances of this class using new $RefParser(), or you can just call its static methods.
@@ -14,7 +14,7 @@ declare class $RefParser {
14
14
  *
15
15
  * See https://apitools.dev/json-schema-ref-parser/docs/ref-parser.html#schema
16
16
  */
17
- schema: $RefParser.JSONSchema
17
+ public schema: $RefParser.JSONSchema;
18
18
 
19
19
  /**
20
20
  * The $refs property is a `$Refs` object, which lets you access all of the externally-referenced files in the schema, as well as easily get and set specific values in the schema using JSON pointers.
@@ -23,7 +23,7 @@ declare class $RefParser {
23
23
  *
24
24
  * See https://apitools.dev/json-schema-ref-parser/docs/ref-parser.html#refs
25
25
  */
26
- $refs: $RefParser.$Refs
26
+ public $refs: $RefParser.$Refs;
27
27
 
28
28
  /**
29
29
  * Dereferences all `$ref` pointers in the JSON Schema, replacing each reference with its resolved value. This results in a schema object that does not contain any `$ref` pointers. Instead, it's a normal JavaScript object tree that can easily be crawled and used just like any other JavaScript object. This is great for programmatic usage, especially when using tools that don't understand JSON references.
@@ -36,12 +36,12 @@ declare class $RefParser {
36
36
  * @param options (optional)
37
37
  * @param callback (optional) A callback that will receive the dereferenced schema object
38
38
  */
39
- dereference(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
40
- dereference(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
41
- dereference(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
42
- dereference(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
43
- dereference(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
44
- dereference(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
39
+ public dereference(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
40
+ public dereference(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
41
+ public dereference(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
42
+ public dereference(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
43
+ public dereference(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
44
+ public dereference(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
45
45
 
46
46
  /**
47
47
  * Dereferences all `$ref` pointers in the JSON Schema, replacing each reference with its resolved value. This results in a schema object that does not contain any `$ref` pointers. Instead, it's a normal JavaScript object tree that can easily be crawled and used just like any other JavaScript object. This is great for programmatic usage, especially when using tools that don't understand JSON references.
@@ -54,12 +54,12 @@ declare class $RefParser {
54
54
  * @param options (optional)
55
55
  * @param callback (optional) A callback that will receive the dereferenced schema object
56
56
  */
57
- static dereference(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
58
- static dereference(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
59
- static dereference(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
60
- static dereference(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
61
- static dereference(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
62
- static dereference(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
57
+ public static dereference(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
58
+ public static dereference(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
59
+ public static dereference(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
60
+ public static dereference(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
61
+ public static dereference(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
62
+ public static dereference(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
63
63
 
64
64
  /**
65
65
  * Bundles all referenced files/URLs into a single schema that only has internal `$ref` pointers. This lets you split-up your schema however you want while you're building it, but easily combine all those files together when it's time to package or distribute the schema to other people. The resulting schema size will be small, since it will still contain internal JSON references rather than being fully-dereferenced.
@@ -72,12 +72,12 @@ declare class $RefParser {
72
72
  * @param options (optional)
73
73
  * @param callback (optional) A callback that will receive the bundled schema object
74
74
  */
75
- bundle(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
76
- bundle(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
77
- bundle(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
78
- bundle(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
79
- bundle(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
80
- bundle(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
75
+ public bundle(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
76
+ public bundle(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
77
+ public bundle(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
78
+ public bundle(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
79
+ public bundle(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
80
+ public bundle(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
81
81
 
82
82
  /**
83
83
  * Bundles all referenced files/URLs into a single schema that only has internal `$ref` pointers. This lets you split-up your schema however you want while you're building it, but easily combine all those files together when it's time to package or distribute the schema to other people. The resulting schema size will be small, since it will still contain internal JSON references rather than being fully-dereferenced.
@@ -90,12 +90,12 @@ declare class $RefParser {
90
90
  * @param options (optional)
91
91
  * @param callback (optional) A callback that will receive the bundled schema object
92
92
  */
93
- static bundle(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
94
- static bundle(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
95
- static bundle(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
96
- static bundle(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
97
- static bundle(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
98
- static bundle(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
93
+ public static bundle(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
94
+ public static bundle(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
95
+ public static bundle(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
96
+ public static bundle(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
97
+ public static bundle(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
98
+ public static bundle(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
99
99
 
100
100
  /**
101
101
  * *This method is used internally by other methods, such as `bundle` and `dereference`. You probably won't need to call this method yourself.*
@@ -108,12 +108,12 @@ declare class $RefParser {
108
108
  * @param options (optional)
109
109
  * @param callback (optional) A callback that will receive the parsed schema object, or an error
110
110
  */
111
- parse(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
112
- parse(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
113
- parse(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
114
- parse(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
115
- parse(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
116
- parse(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
111
+ public parse(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
112
+ public parse(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
113
+ public parse(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
114
+ public parse(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
115
+ public parse(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
116
+ public parse(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
117
117
 
118
118
  /**
119
119
  * *This method is used internally by other methods, such as `bundle` and `dereference`. You probably won't need to call this method yourself.*
@@ -126,12 +126,12 @@ declare class $RefParser {
126
126
  * @param options (optional)
127
127
  * @param callback (optional) A callback that will receive the parsed schema object, or an error
128
128
  */
129
- static parse(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
130
- static parse(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
131
- static parse(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
132
- static parse(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
133
- static parse(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
134
- static parse(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
129
+ public static parse(schema: string | $RefParser.JSONSchema, callback: $RefParser.SchemaCallback): void;
130
+ public static parse(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
131
+ public static parse(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.SchemaCallback): void;
132
+ public static parse(schema: string | $RefParser.JSONSchema): Promise<$RefParser.JSONSchema>;
133
+ public static parse(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
134
+ public static parse(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.JSONSchema>;
135
135
 
136
136
  /**
137
137
  * *This method is used internally by other methods, such as `bundle` and `dereference`. You probably won't need to call this method yourself.*
@@ -144,12 +144,12 @@ declare class $RefParser {
144
144
  * @param options (optional)
145
145
  * @param callback (optional) A callback that will receive a `$Refs` object
146
146
  */
147
- resolve(schema: string | $RefParser.JSONSchema, callback: $RefParser.$RefsCallback): void;
148
- resolve(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.$RefsCallback): void;
149
- resolve(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.$RefsCallback): void;
150
- resolve(schema: string | $RefParser.JSONSchema): Promise<$RefParser.$Refs>;
151
- resolve(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.$Refs>;
152
- resolve(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.$Refs>;
147
+ public resolve(schema: string | $RefParser.JSONSchema, callback: $RefParser.$RefsCallback): void;
148
+ public resolve(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.$RefsCallback): void;
149
+ public resolve(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.$RefsCallback): void;
150
+ public resolve(schema: string | $RefParser.JSONSchema): Promise<$RefParser.$Refs>;
151
+ public resolve(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.$Refs>;
152
+ public resolve(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.$Refs>;
153
153
 
154
154
  /**
155
155
  * *This method is used internally by other methods, such as `bundle` and `dereference`. You probably won't need to call this method yourself.*
@@ -162,14 +162,15 @@ declare class $RefParser {
162
162
  * @param options (optional)
163
163
  * @param callback (optional) A callback that will receive a `$Refs` object
164
164
  */
165
- static resolve(schema: string | $RefParser.JSONSchema, callback: $RefParser.$RefsCallback): void;
166
- static resolve(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.$RefsCallback): void;
167
- static resolve(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.$RefsCallback): void;
168
- static resolve(schema: string | $RefParser.JSONSchema): Promise<$RefParser.$Refs>;
169
- static resolve(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.$Refs>;
170
- static resolve(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.$Refs>;
165
+ public static resolve(schema: string | $RefParser.JSONSchema, callback: $RefParser.$RefsCallback): void;
166
+ public static resolve(schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.$RefsCallback): void;
167
+ public static resolve(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options, callback: $RefParser.$RefsCallback): void;
168
+ public static resolve(schema: string | $RefParser.JSONSchema): Promise<$RefParser.$Refs>;
169
+ public static resolve(schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.$Refs>;
170
+ public static resolve(baseUrl: string, schema: string | $RefParser.JSONSchema, options: $RefParser.Options): Promise<$RefParser.$Refs>;
171
171
  }
172
172
 
173
+ // eslint-disable-next-line no-redeclare
173
174
  declare namespace $RefParser {
174
175
 
175
176
  export type JSONSchema = JSONSchema4 | JSONSchema6;
@@ -179,7 +180,7 @@ declare namespace $RefParser {
179
180
  /**
180
181
  * See https://apitools.dev/json-schema-ref-parser/docs/options.html
181
182
  */
182
- export type Options = {
183
+ export interface Options {
183
184
 
184
185
  /**
185
186
  * The `parse` options determine how different types of files will be parsed.
@@ -187,11 +188,11 @@ declare namespace $RefParser {
187
188
  * JSON Schema `$Ref` Parser comes with built-in JSON, YAML, plain-text, and binary parsers, any of which you can configure or disable. You can also add your own custom parsers if you want.
188
189
  */
189
190
  parse?: {
190
- json?: ParserOptions | boolean
191
- yaml?: ParserOptions | boolean
192
- text?: (ParserOptions & { encoding?: string }) | boolean
193
- [key: string]: ParserOptions | boolean | undefined
194
- }
191
+ json?: ParserOptions | boolean;
192
+ yaml?: ParserOptions | boolean;
193
+ text?: (ParserOptions & { encoding?: string }) | boolean;
194
+ [key: string]: ParserOptions | boolean | undefined;
195
+ };
195
196
 
196
197
  /**
197
198
  * The `resolve` options control how JSON Schema $Ref Parser will resolve file paths and URLs, and how those files will be read/downloaded.
@@ -203,12 +204,12 @@ declare namespace $RefParser {
203
204
  /**
204
205
  * Determines whether external $ref pointers will be resolved. If this option is disabled, then external `$ref` pointers will simply be ignored.
205
206
  */
206
- external?: boolean
207
- file?: Partial<ResolverOptions> | boolean
208
- http?: HTTPResolverOptions | boolean
207
+ external?: boolean;
208
+ file?: Partial<ResolverOptions> | boolean;
209
+ http?: HTTPResolverOptions | boolean;
209
210
  } & {
210
- [key: string]: Partial<ResolverOptions>
211
- }
211
+ [key: string]: Partial<ResolverOptions>;
212
+ };
212
213
 
213
214
  /**
214
215
  * By default, JSON Schema $Ref Parser throws the first error it encounters. Setting `continueOnError` to `true`
@@ -229,8 +230,8 @@ declare namespace $RefParser {
229
230
  *
230
231
  * If set to `"ignore"`, then circular references will simply be ignored. No error will be thrown, but the `$Refs.circular` property will still be set to `true`.
231
232
  */
232
- circular?: boolean | 'ignore'
233
- }
233
+ circular?: boolean | "ignore";
234
+ };
234
235
  }
235
236
 
236
237
  export interface HTTPResolverOptions extends Partial<ResolverOptions> {
@@ -238,22 +239,22 @@ declare namespace $RefParser {
238
239
  /**
239
240
  * You can specify any HTTP headers that should be sent when downloading files. For example, some servers may require you to set the `Accept` or `Referrer` header.
240
241
  */
241
- headers?: object
242
+ headers?: object;
242
243
 
243
244
  /**
244
245
  * The amount of time (in milliseconds) to wait for a response from the server when downloading files. The default is 5 seconds.
245
246
  */
246
- timeout?: number
247
+ timeout?: number;
247
248
 
248
249
  /**
249
250
  * The maximum number of HTTP redirects to follow per file. The default is 5. To disable automatic following of redirects, set this to zero.
250
251
  */
251
- redirects?: number
252
+ redirects?: number;
252
253
 
253
254
  /**
254
255
  * Set this to `true` if you're downloading files from a CORS-enabled server that requires authentication
255
256
  */
256
- withCredentials?: boolean
257
+ withCredentials?: boolean;
257
258
  }
258
259
 
259
260
  /**
@@ -268,12 +269,12 @@ declare namespace $RefParser {
268
269
  *
269
270
  * The order property and canRead property are related to each other. For each file that JSON Schema $Ref Parser needs to resolve, it first determines which resolvers can read that file by checking their canRead property. If only one resolver matches a file, then only that one resolver is called, regardless of its order. If multiple resolvers match a file, then those resolvers are tried in order until one of them successfully reads the file. Once a resolver successfully reads the file, the rest of the resolvers are skipped.
270
271
  */
271
- order?: number
272
+ order?: number;
272
273
 
273
274
  /**
274
275
  * The `canRead` property tells JSON Schema `$Ref` Parser what kind of files your resolver can read. In this example, we've simply specified a regular expression that matches "mogodb://" URLs, but we could have used a simple boolean, or even a function with custom logic to determine which files to resolve. Here are examples of each approach:
275
276
  */
276
- canRead: boolean | RegExp | string | string[] | ((file: FileInfo) => boolean)
277
+ canRead: boolean | RegExp | string | string[] | ((file: FileInfo) => boolean);
277
278
 
278
279
  /**
279
280
  * This is where the real work of a resolver happens. The `read` method accepts the same file info object as the `canRead` function, but rather than returning a boolean value, the `read` method should return the contents of the file. The file contents should be returned in as raw a form as possible, such as a string or a byte array. Any further parsing or processing should be done by parsers.
@@ -283,7 +284,7 @@ declare namespace $RefParser {
283
284
  read(
284
285
  file: FileInfo,
285
286
  callback?: (error: Error | null, data: string | null) => any
286
- ): string | Buffer | Promise<string | Buffer>
287
+ ): string | Buffer | Promise<string | Buffer>;
287
288
  }
288
289
 
289
290
  export interface ParserOptions {
@@ -293,21 +294,21 @@ declare namespace $RefParser {
293
294
  *
294
295
  * You can change the order in which parsers run, which is useful if you know that most of your referenced files will be a certain type, or if you add your own custom parser that you want to run first.
295
296
  */
296
- order?: number
297
+ order?: number;
297
298
 
298
299
  /**
299
300
  * All of the built-in parsers allow empty files by default. The JSON and YAML parsers will parse empty files as `undefined`. The text parser will parse empty files as an empty string. The binary parser will parse empty files as an empty byte array.
300
301
  *
301
302
  * You can set `allowEmpty: false` on any parser, which will cause an error to be thrown if a file empty.
302
303
  */
303
- allowEmpty?: boolean
304
+ allowEmpty?: boolean;
304
305
 
305
306
  /**
306
307
  * Determines which parsers will be used for which files.
307
308
  *
308
309
  * A regular expression can be used to match files by their full path. A string (or array of strings) can be used to match files by their file extension. Or a function can be used to perform more complex matching logic. See the custom parser docs for details.
309
310
  */
310
- canParse?: boolean | RegExp | string | string[] | ((file: FileInfo) => boolean)
311
+ canParse?: boolean | RegExp | string | string[] | ((file: FileInfo) => boolean);
311
312
 
312
313
  /**
313
314
  * This is where the real work of a parser happens. The `parse` method accepts the same file info object as the `canParse` function, but rather than returning a boolean value, the `parse` method should return a JavaScript representation of the file contents. For our CSV parser, that is a two-dimensional array of lines and values. For your parser, it might be an object, a string, a custom class, or anything else.
@@ -317,7 +318,7 @@ declare namespace $RefParser {
317
318
  parse(
318
319
  file: FileInfo,
319
320
  callback?: (error: Error | null, data: string | null) => any
320
- ): unknown | Promise<unknown>
321
+ ): unknown | Promise<unknown>;
321
322
  }
322
323
 
323
324
  /**
@@ -332,17 +333,17 @@ declare namespace $RefParser {
332
333
  /**
333
334
  * The full URL of the file. This could be any type of URL, including "http://", "https://", "file://", "ftp://", "mongodb://", or even a local filesystem path (when running in Node.js).
334
335
  */
335
- url: string
336
+ url: string;
336
337
 
337
338
  /**
338
339
  * The lowercase file extension, such as ".json", ".yaml", ".txt", etc.
339
340
  */
340
- extension: string
341
+ extension: string;
341
342
 
342
343
  /**
343
344
  * The raw file contents, in whatever form they were returned by the resolver that read the file.
344
345
  */
345
- data: string | Buffer
346
+ data: string | Buffer;
346
347
  }
347
348
 
348
349
  /**
@@ -358,7 +359,7 @@ declare namespace $RefParser {
358
359
  *
359
360
  * See https://apitools.dev/json-schema-ref-parser/docs/refs.html#circular
360
361
  */
361
- circular: boolean
362
+ public circular: boolean;
362
363
 
363
364
  /**
364
365
  * Returns the paths/URLs of all the files in your schema (including the main schema file).
@@ -367,7 +368,7 @@ declare namespace $RefParser {
367
368
  *
368
369
  * @param types (optional) Optionally only return certain types of paths ("file", "http", etc.)
369
370
  */
370
- paths(...types: string[]): string[]
371
+ public paths(...types: string[]): string[]
371
372
 
372
373
  /**
373
374
  * Returns a map of paths/URLs and their correspond values.
@@ -376,7 +377,7 @@ declare namespace $RefParser {
376
377
  *
377
378
  * @param types (optional) Optionally only return values from certain locations ("file", "http", etc.)
378
379
  */
379
- values(...types: string[]): { [url: string]: $RefParser.JSONSchema }
380
+ public values(...types: string[]): { [url: string]: $RefParser.JSONSchema }
380
381
 
381
382
  /**
382
383
  * Returns `true` if the given path exists in the schema; otherwise, returns `false`
@@ -385,7 +386,7 @@ declare namespace $RefParser {
385
386
  *
386
387
  * @param $ref The JSON Reference path, optionally with a JSON Pointer in the hash
387
388
  */
388
- exists($ref: string): boolean
389
+ public exists($ref: string): boolean
389
390
 
390
391
  /**
391
392
  * Gets the value at the given path in the schema. Throws an error if the path does not exist.
@@ -394,7 +395,7 @@ declare namespace $RefParser {
394
395
  *
395
396
  * @param $ref The JSON Reference path, optionally with a JSON Pointer in the hash
396
397
  */
397
- get($ref: string): JSONSchema4Type | JSONSchema6Type
398
+ public get($ref: string): JSONSchema4Type | JSONSchema6Type
398
399
 
399
400
  /**
400
401
  * Sets the value at the given path in the schema. If the property, or any of its parents, don't exist, they will be created.
@@ -402,18 +403,18 @@ declare namespace $RefParser {
402
403
  * @param $ref The JSON Reference path, optionally with a JSON Pointer in the hash
403
404
  * @param value The value to assign. Can be anything (object, string, number, etc.)
404
405
  */
405
- set($ref: string, value: JSONSchema4Type | JSONSchema6Type): void
406
+ public set($ref: string, value: JSONSchema4Type | JSONSchema6Type): void
406
407
  }
407
408
 
408
409
  export type JSONParserErrorType = "EUNKNOWN" | "EPARSER" | "EUNMATCHEDPARSER" | "ERESOLVER" | "EUNMATCHEDRESOLVER" | "EMISSINGPOINTER" | "EINVALIDPOINTER";
409
410
 
410
411
  export class JSONParserError extends Error {
411
- readonly name: string;
412
- readonly message: string;
413
- readonly source: string;
414
- readonly path: Array<string | number>;
415
- readonly errors: string;
416
- readonly code: JSONParserErrorType;
412
+ public readonly name: string;
413
+ public readonly message: string;
414
+ public readonly source: string;
415
+ public readonly path: Array<string | number>;
416
+ public readonly errors: string;
417
+ public readonly code: JSONParserErrorType;
417
418
  }
418
419
 
419
420
  export class JSONParserErrorGroup extends Error {
@@ -422,44 +423,44 @@ declare namespace $RefParser {
422
423
  *
423
424
  * See https://github.com/APIDevTools/json-schema-ref-parser/blob/master/docs/ref-parser.md#errors
424
425
  */
425
- readonly errors: Array<$RefParser.JSONParserError | $RefParser.InvalidPointerError | $RefParser.ResolverError | $RefParser.ParserError | $RefParser.MissingPointerError | $RefParser.UnmatchedParserError | $RefParser.UnmatchedResolverError>;
426
+ public readonly errors: Array<$RefParser.JSONParserError | $RefParser.InvalidPointerError | $RefParser.ResolverError | $RefParser.ParserError | $RefParser.MissingPointerError | $RefParser.UnmatchedParserError | $RefParser.UnmatchedResolverError>;
426
427
 
427
428
  /**
428
429
  * The fields property is a `$RefParser` instance
429
430
  *
430
431
  * See https://apitools.dev/json-schema-ref-parser/docs/ref-parser.html
431
432
  */
432
- readonly files: $RefParser;
433
+ public readonly files: $RefParser;
433
434
 
434
435
  /**
435
436
  * User friendly message containing the total amount of errors, as well as the absolute path to the source document
436
437
  */
437
- readonly message: string;
438
+ public readonly message: string;
438
439
  }
439
440
 
440
441
  export class ParserError extends JSONParserError {
441
- readonly name = "ParserError";
442
- readonly code = "EPARSER";
442
+ public readonly name = "ParserError";
443
+ public readonly code = "EPARSER";
443
444
  }
444
445
  export class UnmatchedParserError extends JSONParserError {
445
- readonly name = "UnmatchedParserError";
446
- readonly code ="EUNMATCHEDPARSER";
446
+ public readonly name = "UnmatchedParserError";
447
+ public readonly code ="EUNMATCHEDPARSER";
447
448
  }
448
449
  export class ResolverError extends JSONParserError {
449
- readonly name = "ResolverError";
450
- readonly code ="ERESOLVER";
451
- readonly ioErrorCode?: string;
450
+ public readonly name = "ResolverError";
451
+ public readonly code ="ERESOLVER";
452
+ public readonly ioErrorCode?: string;
452
453
  }
453
454
  export class UnmatchedResolverError extends JSONParserError {
454
- readonly name = "UnmatchedResolverError";
455
- readonly code ="EUNMATCHEDRESOLVER";
455
+ public readonly name = "UnmatchedResolverError";
456
+ public readonly code ="EUNMATCHEDRESOLVER";
456
457
  }
457
458
  export class MissingPointerError extends JSONParserError {
458
- readonly name = "MissingPointerError";
459
- readonly code ="EMISSINGPOINTER";
459
+ public readonly name = "MissingPointerError";
460
+ public readonly code ="EMISSINGPOINTER";
460
461
  }
461
462
  export class InvalidPointerError extends JSONParserError {
462
- readonly name = "InvalidPointerError";
463
- readonly code ="EINVALIDPOINTER";
463
+ public readonly name = "InvalidPointerError";
464
+ public readonly code ="EINVALIDPOINTER";
464
465
  }
465
466
  }
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ /* eslint-disable no-unused-vars */
1
2
  "use strict";
2
3
 
3
4
  const $Refs = require("./refs");
package/lib/parse.js CHANGED
@@ -124,7 +124,7 @@ function parseFile (file, options, $refs) {
124
124
  .then(onParsed, onError);
125
125
 
126
126
  function onParsed (parser) {
127
- if ((options.continueOnError || !parser.plugin.allowEmpty) && isEmpty(parser.result)) {
127
+ if (!parser.plugin.allowEmpty && isEmpty(parser.result)) {
128
128
  reject(ono.syntax(`Error parsing "${file.url}" as ${parser.plugin.name}. \nParsed value is empty`));
129
129
  }
130
130
  else {
@@ -36,7 +36,7 @@ module.exports = {
36
36
  * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver
37
37
  * @returns {Promise}
38
38
  */
39
- async parse (file) {
39
+ async parse (file) { // eslint-disable-line require-await
40
40
  let data = file.data;
41
41
  if (Buffer.isBuffer(data)) {
42
42
  data = data.toString();
@@ -37,7 +37,7 @@ module.exports = {
37
37
  * @param {*} file.data - The file contents. This will be whatever data type was returned by the resolver
38
38
  * @returns {Promise}
39
39
  */
40
- async parse (file) {
40
+ async parse (file) { // eslint-disable-line require-await
41
41
  let data = file.data;
42
42
  if (Buffer.isBuffer(data)) {
43
43
  data = data.toString();
package/lib/pointer.js CHANGED
@@ -64,6 +64,7 @@ function Pointer ($ref, path, friendlyPath) {
64
64
  *
65
65
  * @param {*} obj - The object that will be crawled
66
66
  * @param {$RefParserOptions} options
67
+ * @param {string} pathFromRoot - the path of place that initiated resolving
67
68
  *
68
69
  * @returns {Pointer}
69
70
  * Returns a JSON pointer whose {@link Pointer#value} is the resolved value.
@@ -71,7 +72,7 @@ function Pointer ($ref, path, friendlyPath) {
71
72
  * the {@link Pointer#$ref} and {@link Pointer#path} will reflect the resolution path
72
73
  * of the resolved value.
73
74
  */
74
- Pointer.prototype.resolve = function (obj, options) {
75
+ Pointer.prototype.resolve = function (obj, options, pathFromRoot) {
75
76
  let tokens = Pointer.parse(this.path, this.originalPath);
76
77
 
77
78
  // Crawl the object, one token at a time
@@ -83,6 +84,10 @@ Pointer.prototype.resolve = function (obj, options) {
83
84
  this.path = Pointer.join(this.path, tokens.slice(i));
84
85
  }
85
86
 
87
+ if (typeof this.value === "object" && this.value !== null && "$ref" in this.value) {
88
+ return this;
89
+ }
90
+
86
91
  let token = tokens[i];
87
92
  if (this.value[token] === undefined || this.value[token] === null) {
88
93
  this.value = null;
@@ -94,7 +99,10 @@ Pointer.prototype.resolve = function (obj, options) {
94
99
  }
95
100
 
96
101
  // Resolve the final value
97
- resolveIf$Ref(this, options);
102
+ if (!this.value || this.value.$ref && url.resolve(this.path, this.value.$ref) !== pathFromRoot) {
103
+ resolveIf$Ref(this, options);
104
+ }
105
+
98
106
  return this;
99
107
  };
100
108
 
@@ -226,7 +234,7 @@ function resolveIf$Ref (pointer, options) {
226
234
  pointer.circular = true;
227
235
  }
228
236
  else {
229
- let resolved = pointer.$ref.$refs._resolve($refPath, url.getHash(pointer.path), options);
237
+ let resolved = pointer.$ref.$refs._resolve($refPath, pointer.path, options);
230
238
  pointer.indirections += resolved.indirections + 1;
231
239
 
232
240
  if ($Ref.isExtended$Ref(pointer.value)) {
package/lib/ref.js CHANGED
@@ -3,8 +3,8 @@
3
3
  module.exports = $Ref;
4
4
 
5
5
  const Pointer = require("./pointer");
6
- const { JSONParserError, JSONParserErrorGroup, ParserError, MissingPointerError, ResolverError, isHandledError } = require("./util/errors");
7
- const { safePointerToPath } = require("./util/url");
6
+ const { InvalidPointerError, isHandledError, normalizeError } = require("./util/errors");
7
+ const { safePointerToPath, stripHash, getHash } = require("./util/url");
8
8
 
9
9
  /**
10
10
  * This class represents a single JSON reference and its resolved value.
@@ -61,11 +61,13 @@ $Ref.prototype.addError = function (err) {
61
61
  this.errors = [];
62
62
  }
63
63
 
64
+ // the path has been almost certainly set at this point,
65
+ // but just in case something went wrong, let's inject path if necessary
64
66
  if (Array.isArray(err.errors)) {
65
- this.errors.push(...err.errors);
67
+ this.errors.push(...err.errors.map(normalizeError));
66
68
  }
67
69
  else {
68
- this.errors.push(err);
70
+ this.errors.push(normalizeError(err));
69
71
  }
70
72
  };
71
73
 
@@ -110,14 +112,23 @@ $Ref.prototype.get = function (path, options) {
110
112
  $Ref.prototype.resolve = function (path, options, friendlyPath, pathFromRoot) {
111
113
  let pointer = new Pointer(this, path, friendlyPath);
112
114
  try {
113
- return pointer.resolve(this.value, options);
115
+ return pointer.resolve(this.value, options, pathFromRoot);
114
116
  }
115
117
  catch (err) {
116
118
  if (!options || !options.continueOnError || !isHandledError(err)) {
117
119
  throw err;
118
120
  }
119
121
 
120
- err.path = safePointerToPath(pathFromRoot);
122
+ if (err.path === null) {
123
+ err.path = safePointerToPath(getHash(pathFromRoot));
124
+ }
125
+
126
+ if (err instanceof InvalidPointerError) {
127
+ // this is a special case - InvalidPointerError is thrown when dereferencing external file,
128
+ // but the issue is caused by the source file that referenced the file that undergoes dereferencing
129
+ err.source = stripHash(pathFromRoot);
130
+ }
131
+
121
132
  this.addError(err);
122
133
  return null;
123
134
  }
package/lib/refs.js CHANGED
@@ -41,7 +41,7 @@ function $Refs () {
41
41
  * @param {...string|string[]} [types] - Only return paths of the given types ("file", "http", etc.)
42
42
  * @returns {string[]}
43
43
  */
44
- $Refs.prototype.paths = function (types) {
44
+ $Refs.prototype.paths = function (types) { // eslint-disable-line no-unused-vars
45
45
  let paths = getPaths(this._$refs, arguments);
46
46
  return paths.map((path) => {
47
47
  return path.decoded;
@@ -54,7 +54,7 @@ $Refs.prototype.paths = function (types) {
54
54
  * @param {...string|string[]} [types] - Only return references of the given types ("file", "http", etc.)
55
55
  * @returns {object}
56
56
  */
57
- $Refs.prototype.values = function (types) {
57
+ $Refs.prototype.values = function (types) { // eslint-disable-line no-unused-vars
58
58
  let $refs = this._$refs;
59
59
  let paths = getPaths($refs, arguments);
60
60
  return paths.reduce((obj, path) => {
@@ -54,7 +54,7 @@ function resolveExternal (parser, options) {
54
54
  function crawl (obj, path, $refs, options) {
55
55
  let promises = [];
56
56
 
57
- if (obj && typeof obj === "object") {
57
+ if (obj && typeof obj === "object" && !ArrayBuffer.isView(obj)) {
58
58
  if ($Ref.isExternal$Ref(obj)) {
59
59
  promises.push(resolve$Ref(obj, path, $refs, options));
60
60
  }
@@ -11,7 +11,7 @@ const JSONParserError = exports.JSONParserError = class JSONParserError extends
11
11
  this.code = "EUNKNOWN";
12
12
  this.message = message;
13
13
  this.source = source;
14
- this.path = [];
14
+ this.path = null;
15
15
 
16
16
  Ono.extend(this);
17
17
  }
@@ -122,3 +122,11 @@ function setErrorName (err) {
122
122
  exports.isHandledError = function (err) {
123
123
  return err instanceof JSONParserError || err instanceof JSONParserErrorGroup;
124
124
  };
125
+
126
+ exports.normalizeError = function (err) {
127
+ if (err.path === null) {
128
+ err.path = [];
129
+ }
130
+
131
+ return err;
132
+ };
@@ -84,7 +84,9 @@ exports.run = function (plugins, method, file, $refs) {
84
84
  // A synchronous result was returned
85
85
  onSuccess(result);
86
86
  }
87
- // else { the callback will be called }
87
+ else if (index === plugins.length) {
88
+ throw new Error("No promise has been returned or callback has been called.");
89
+ }
88
90
  }
89
91
  catch (e) {
90
92
  onError(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apidevtools/json-schema-ref-parser",
3
- "version": "9.0.1",
3
+ "version": "9.0.6",
4
4
  "description": "Parse, Resolve, and Dereference JSON Schema $ref pointers",
5
5
  "keywords": [
6
6
  "json",
@@ -42,7 +42,7 @@
42
42
  "test": "npm run test:node && npm run test:typescript && npm run test:browser && npm run lint",
43
43
  "test:node": "mocha",
44
44
  "test:browser": "karma start --single-run",
45
- "test:typescript": "tsc --noEmit --strict --lib esnext test/specs/typescript-definition.spec.ts",
45
+ "test:typescript": "tsc --noEmit --strict --lib esnext,dom test/specs/typescript-definition.spec.ts",
46
46
  "coverage": "npm run coverage:node && npm run coverage:browser",
47
47
  "coverage:node": "nyc node_modules/mocha/bin/mocha",
48
48
  "coverage:browser": "npm run test:browser -- --coverage",
@@ -51,26 +51,26 @@
51
51
  "release": "npm run upgrade && npm run clean && npm test && npm run bump"
52
52
  },
53
53
  "devDependencies": {
54
- "@babel/polyfill": "^7.7.0",
55
- "@jsdevtools/eslint-config-modular": "^8.0.3",
56
- "@jsdevtools/host-environment": "^2.0.3",
57
- "@jsdevtools/karma-config": "^3.1.4",
58
- "@jsdevtools/version-bump-prompt": "^6.0.3",
54
+ "@babel/polyfill": "^7.10.4",
55
+ "@jsdevtools/eslint-config": "^1.0.7",
56
+ "@jsdevtools/host-environment": "^2.0.4",
57
+ "@jsdevtools/karma-config": "^3.1.7",
58
+ "@jsdevtools/version-bump-prompt": "^6.0.6",
59
59
  "@types/json-schema": "^7.0.4",
60
- "@types/node": "^13.13.0",
60
+ "@types/node": "^14.0.25",
61
61
  "chai": "^4.2.0",
62
62
  "chai-subset": "^1.6.0",
63
- "eslint": "^6.8.0",
63
+ "eslint": "^7.5.0",
64
64
  "karma": "^5.0.2",
65
65
  "karma-cli": "^2.0.0",
66
- "mocha": "^7.1.1",
66
+ "mocha": "^8.0.1",
67
67
  "npm-check": "^5.9.0",
68
68
  "nyc": "^15.0.1",
69
69
  "shx": "^0.3.2",
70
- "typescript": "^3.7.4"
70
+ "typescript": "^3.9.7"
71
71
  },
72
72
  "dependencies": {
73
- "@jsdevtools/ono": "^7.1.2",
73
+ "@jsdevtools/ono": "^7.1.3",
74
74
  "call-me-maybe": "^1.0.1",
75
75
  "js-yaml": "^3.13.1"
76
76
  }