Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then((d) => {
return Array.isArray(d.jnyL)
? d.jnyL
.map(parse.departure('Europe/Berlin', d.locations, d.lines, d.remarks))
.map((dep) => {
dep.station.name = shorten(dep.station.name)
dep.direction = shorten(dep.direction)
return dep
})
.sort((a, b) => new Date(a.when) - new Date(b.when))
: []
})
}