How to use the hafas-client/stringify.poi function in hafas-client

To help you get started, we’ve selected a few hafas-client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github derhuerst / vbb-hafas / lib / journeys.js View on Github external
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.')
}