mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
17 lines
338 B
JavaScript
17 lines
338 B
JavaScript
'use strict'
|
|
|
|
const stringifyCoord = require('./coord')
|
|
|
|
const stringifyAddress = (latitude, longitude, name) => {
|
|
if (!latitude || !longitude || !name) throw new Error('invalid address.')
|
|
return {
|
|
type: 'A',
|
|
name,
|
|
crd: {
|
|
x: stringifyCoord(longitude),
|
|
y: stringifyCoord(latitude)
|
|
}
|
|
}
|
|
}
|
|
|
|
module.exports = stringifyAddress
|