Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const location = (l) => {
const r = parse.location(l)
if (r.id) r.id = to12Digit(r.id.replace(leadingZeros, ''))
if ('products' in r) r.products = util.products.parseBitmask(r.products)
if (r.type === 'station' && !r.coordinates) {
const [s] = stations(r.id)
if (s) {
r.coordinates = {
latitude: s.coordinates.latitude,
longitude: s.coordinates.longitude
}
}
}
return r
}