Don't return Promise when it isn't used anyway

pull/1/head
Sven Slootweg 4 years ago
parent 131e1e643c
commit d76afc623e

@ -5,13 +5,14 @@ const through2 = require("through2");
const assureArray = require("assure-array"); const assureArray = require("assure-array");
function wrapStreamHandler(stream, handler, callback, item) { function wrapStreamHandler(stream, handler, callback, item) {
return Promise.try(() => { Promise.try(() => {
return handler(item); return handler(item);
}).then((result) => { }).then((result) => {
return assureArray(result); return assureArray(result);
}).each((newItem) => { }).each((newItem) => {
stream.push(newItem); stream.push(newItem);
}).then(() => { }).then(() => {
// TODO: Fix the "a promise was created in a handler at [...] but was not returned from it" Bluebird warning that occurs here
callback(); callback();
}).catch((err) => { }).catch((err) => {
callback(err); callback(err);

Loading…
Cancel
Save