Skip to content

Commit

Permalink
little refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Mar 13, 2016
1 parent 760b615 commit 78cf007
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.js
Expand Up @@ -225,16 +225,16 @@ function Xray () {

node.stream = function () {
state.stream = store.createWriteStream()
var ret = store.createReadStream()
handleStreamError(ret, node)
return ret
var rs = store.createReadStream()
handleStreamError(rs, node)
return rs
}

node.write = function (path) {
if (!arguments.length) return node.stream()
var ret = state.stream = fs.createWriteStream(path)
handleStreamError(ret, node)
return ret
state.stream = fs.createWriteStream(path)
handleStreamError(state.stream, node)
return state.stream
}

return node
Expand Down

0 comments on commit 78cf007

Please sign in to comment.