Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #299 from ipfs/patch/object
Browse files Browse the repository at this point in the history
update get-dagNode for buffers
  • Loading branch information
daviddias authored Aug 10, 2016
2 parents ff667a7 + 0a154b6 commit 6948370
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/get-dagnode.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,16 @@ module.exports = function (send, hash, cb) {
var object = res[0]
var stream = res[1]

stream.pipe(bl(function (err, data) {
if (err) {
return cb(err)
}
if (Buffer.isBuffer(stream)) {
cb(err, new DAGNode(stream, object.Links))
} else {
stream.pipe(bl(function (err, data) {
if (err) {
return cb(err)
}

cb(err, new DAGNode(data, object.Links))
}))
cb(err, new DAGNode(data, object.Links))
}))
}
})
}

0 comments on commit 6948370

Please sign in to comment.