Refactoring day1

This commit is contained in:
2020-08-20 20:27:14 +02:00
parent 6aceefeb2f
commit b907489a75
481 changed files with 5321 additions and 5616 deletions

View File

@@ -278,7 +278,6 @@ function init(self) {
if (error) {
return __handleError(self, error);
}
if (!doc) {
var identifier = self.s.filter._id ? self.s.filter._id.toString() : self.s.filter.filename;
var errmsg = 'FileNotFound: file ' + identifier + ' was not found';
@@ -302,11 +301,7 @@ function init(self) {
return;
}
try {
self.s.bytesToSkip = handleStartOption(self, doc, self.s.options);
} catch (error) {
return __handleError(self, error);
}
self.s.bytesToSkip = handleStartOption(self, doc, self.s.options);
var filter = { files_id: doc._id };
@@ -327,13 +322,7 @@ function init(self) {
self.s.expectedEnd = Math.ceil(doc.length / doc.chunkSize);
self.s.file = doc;
try {
self.s.bytesToTrim = handleEndOption(self, doc, self.s.cursor, self.s.options);
} catch (error) {
return __handleError(self, error);
}
self.s.bytesToTrim = handleEndOption(self, doc, self.s.cursor, self.s.options);
self.emit('file', doc);
});
}