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) => {
if (isValidId(l)) return _stringify.station(l)
else if ('object' === typeof l) {
if (l.type === 'poi')
return stringify.poi(l.latitude, l.longitude, l.id, l.name)
else if (l.type === 'address')
return stringify.address(l.latitude, l.longitude, l.name)
else throw new Error('invalid location.')
}
else throw new Error('valid station, address or poi required.')
}