Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: APIDevTools/json-schema-ref-parser
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: simonbothen-radinn/json-schema-ref-parser
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Jun 2, 2023

  1. Copy the full SHA
    e5a1b83 View commit details
Showing with 11 additions and 10 deletions.
  1. +11 −10 lib/resolve-external.ts
21 changes: 11 additions & 10 deletions lib/resolve-external.ts
Original file line number Diff line number Diff line change
@@ -64,18 +64,19 @@ function crawl(
seen.add(obj); // Track previously seen objects to avoid infinite recursion
if ($Ref.isExternal$Ref(obj)) {
promises.push(resolve$Ref(obj, path, $refs, options));
} else {
for (const key of Object.keys(obj)) {
const keyPath = Pointer.join(path, key);
const value = obj[key] as string | JSONSchema | Buffer | undefined;

if ($Ref.isExternal$Ref(value)) {
promises.push(resolve$Ref(value, keyPath, $refs, options));
} else {
promises = promises.concat(crawl(value, keyPath, $refs, options, seen));
}
}

for (const key of Object.keys(obj)) {
const keyPath = Pointer.join(path, key);
const value = obj[key] as string | JSONSchema | Buffer | undefined;

if ($Ref.isExternal$Ref(value)) {
promises.push(resolve$Ref(value, keyPath, $refs, options));
}

promises = promises.concat(crawl(value, keyPath, $refs, options, seen));
}

}

return promises;