Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getOldLogs (appId, beforeDate, afterDate, filter, deployment_id) {
const limit = (beforeDate == null && afterDate == null) ? 300 : null;
const before = (beforeDate != null) ? beforeDate.toISOString() : null;
const after = (afterDate != null) ? afterDate.toISOString() : null;
const logsProm = fetchOldLogs({ appId, limit, before, after, filter, deployment_id }).then(sendToApi);
return Bacon.fromPromise(logsProm)
.flatMapLatest((logs) => Bacon.fromArray(logs.reverse()));
};