diff --git a/src/lib/resolve.js b/src/lib/resolve.js index 33dd67d5e..b0a1e3205 100644 --- a/src/lib/resolve.js +++ b/src/lib/resolve.js @@ -29,13 +29,6 @@ export async function * resolve (cid, path, codecs, getBlock, options) { let value = await load(cid) let lastCid = cid - if (!parts.length) { - yield { - value, - remainderPath: '' - } - } - // End iteration if there isn't a CID to follow any more while (parts.length) { const key = parts.shift() @@ -62,4 +55,9 @@ export async function * resolve (cid, path, codecs, getBlock, options) { value = await load(value) } } + + yield { + value, + remainderPath: '' + } }