Skip to content

Commit 30ced14

Browse files
committed
Fix: #21
Streams should end properly
1 parent aa42853 commit 30ced14

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/xml.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,12 @@ function xml(input, options) {
5050
function end() {
5151
if (stream) {
5252
var data = output;
53-
delay(function () { stream.emit('data', data) });
54-
55-
stream.emit('end');
56-
stream.readable = false;
57-
stream.emit('close');
53+
delay(function () {
54+
stream.emit('data', data);
55+
stream.emit('end');
56+
stream.readable = false;
57+
stream.emit('close');
58+
});
5859
}
5960
}
6061

@@ -278,4 +279,4 @@ function attribute(key, value) {
278279
}
279280

280281
module.exports = xml;
281-
module.exports.element = module.exports.Element = element;
282+
module.exports.element = module.exports.Element = element;

0 commit comments

Comments
 (0)