journeys: make opt.departure & opt.arrival mutually exclusive

This commit is contained in:
Jannis R 2018-05-30 16:15:26 +02:00 committed by Jannis Redmann
parent 0169e83731
commit 856a751b51

View file

@ -62,7 +62,10 @@ const createClient = (profile, request = _request) => {
to = profile.formatLocation(profile, to, 'to')
if (('earlierThan' in opt) && ('laterThan' in opt)) {
throw new Error('opt.laterThan and opt.laterThan are mutually exclusive.')
throw new Error('opt.earlierThan and opt.laterThan are mutually exclusive.')
}
if (('departure' in opt) && ('arrival' in opt)) {
throw new Error('opt.departure and opt.arrival are mutually exclusive.')
}
let journeysRef = null
if ('earlierThan' in opt) {