@@ -21,7 +21,7 @@ module.exports = resolveExternal;
21
21
* The promise resolves once all JSON references in the schema have been resolved,
22
22
* including nested references that are contained in externally-referenced files.
23
23
*/
24
- function resolveExternal ( parser , options ) {
24
+ function resolveExternal ( parser , options ) {
25
25
if ( ! options . resolve . external ) {
26
26
// Nothing to resolve, so exit early
27
27
return Promise . resolve ( ) ;
@@ -36,7 +36,8 @@ function resolveExternal(parser, options) {
36
36
options
37
37
) ;
38
38
return Promise . all ( promises ) ;
39
- } catch ( e ) {
39
+ }
40
+ catch ( e ) {
40
41
return Promise . reject ( e ) ;
41
42
}
42
43
}
@@ -56,7 +57,7 @@ function resolveExternal(parser, options) {
56
57
* If any of the JSON references point to files that contain additional JSON references,
57
58
* then the corresponding promise will internally reference an array of promises.
58
59
*/
59
- function crawl ( obj , path , $refs , options , external , seen ) {
60
+ function crawl ( obj , path , $refs , options , external , seen ) {
60
61
seen = seen || new Set ( ) ;
61
62
let promises = [ ] ;
62
63
@@ -69,7 +70,8 @@ function crawl(obj, path, $refs, options, external, seen) {
69
70
seen . add ( obj ) ; // Track previously seen objects to avoid infinite recursion
70
71
if ( $Ref . isExternal$Ref ( obj ) ) {
71
72
promises . push ( resolve$Ref ( obj , path , $refs , options ) ) ;
72
- } else {
73
+ }
74
+ else {
73
75
if ( external && $Ref . is$Ref ( obj ) ) {
74
76
/* Correct the reference in the external document so we can resolve it */
75
77
let withoutHash = url . stripHash ( path ) ;
@@ -106,7 +108,7 @@ function crawl(obj, path, $refs, options, external, seen) {
106
108
* The promise resolves once all JSON references in the object have been resolved,
107
109
* including nested references that are contained in externally-referenced files.
108
110
*/
109
- async function resolve$Ref ( $ref , path , $refs , options ) {
111
+ async function resolve$Ref ( $ref , path , $refs , options ) {
110
112
// console.log('Resolving $ref pointer "%s" at %s', $ref.$ref, path);
111
113
112
114
let resolvedPath = url . resolve ( path , $ref . $ref ) ;
@@ -128,7 +130,8 @@ async function resolve$Ref($ref, path, $refs, options) {
128
130
let promises = crawl ( result , withoutHash + "#" , $refs , options , true ) ;
129
131
130
132
return Promise . all ( promises ) ;
131
- } catch ( err ) {
133
+ }
134
+ catch ( err ) {
132
135
if ( ! options . continueOnError || ! isHandledError ( err ) ) {
133
136
throw err ;
134
137
}
0 commit comments