diff --git a/lib/dereference.js b/lib/dereference.js index 529029a8..db84d7eb 100644 --- a/lib/dereference.js +++ b/lib/dereference.js @@ -72,7 +72,7 @@ async function crawl ( ); result.circular = dereferenced.circular; result.value = dereferenced.value; - } + } else { for (let key of Object.keys(obj)) { let keyPath = Pointer.join(path, key); @@ -95,7 +95,7 @@ async function crawl ( if (obj[key] !== dereferenced.value) { obj[key] = dereferenced.value; } - } + } else { if (parents.indexOf(value) === -1) { dereferenced = await crawl( @@ -112,7 +112,7 @@ async function crawl ( if (obj[key] !== dereferenced.value) { obj[key] = dereferenced.value; } - } + } else { circular = foundCircularReference(keyPath, $refs, options); }