Skip to content

Commit f0541f3

Browse files
committed
Update: Reduce object creation for end-of-stream options
1 parent b6b297f commit f0541f3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ var exhaust = require('stream-exhaust');
99

1010
function noop(){}
1111

12+
var eosConfig = {
13+
error: false
14+
};
15+
1216
function asyncDone(fn, cb){
1317
cb = once(cb);
1418

@@ -36,7 +40,7 @@ function asyncDone(fn, cb){
3640
if(result && typeof result.on === 'function'){
3741
// assume node stream
3842
d.add(result);
39-
eos(exhaust(result), { error: false }, onSuccess);
43+
eos(exhaust(result), eosConfig, onSuccess);
4044
return;
4145
}
4246

0 commit comments

Comments
 (0)