Skip to content

Commit

Permalink
Merge pull request #25 from harish2704/master
Browse files Browse the repository at this point in the history
Fix: #21
  • Loading branch information
dylang committed Jan 30, 2016
2 parents aa42853 + 30ced14 commit 6ddcd9b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/xml.js
Expand Up @@ -50,11 +50,12 @@ function xml(input, options) {
function end() {
if (stream) {
var data = output;
delay(function () { stream.emit('data', data) });

stream.emit('end');
stream.readable = false;
stream.emit('close');
delay(function () {
stream.emit('data', data);
stream.emit('end');
stream.readable = false;
stream.emit('close');
});
}
}

Expand Down Expand Up @@ -278,4 +279,4 @@ function attribute(key, value) {
}

module.exports = xml;
module.exports.element = module.exports.Element = element;
module.exports.element = module.exports.Element = element;

0 comments on commit 6ddcd9b

Please sign in to comment.