Fixed crawler not reading and comparing all RERequest results

This commit is contained in:
Nedim Uka
2019-07-12 16:13:03 +02:00
parent 4517624fa8
commit 753a09aa36
5 changed files with 46 additions and 4 deletions

View File

@@ -167,3 +167,14 @@ var rule = new schedule.RecurrenceRule();
await processNotifications();
console.log(new Date(), 'Notification service finished');
});
/**
* Add flat method to Array
*/
Object.defineProperty(Array.prototype, 'flat', {
value: function(depth = 1) {
return this.reduce(function (flat, toFlatten) {
return flat.concat((Array.isArray(toFlatten) && (depth>1)) ? toFlatten.flat(depth-1) : toFlatten);
}, []);
}
});