mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-22 22:59:35 +02:00
journeys: make opt.departure & opt.arrival mutually exclusive
This commit is contained in:
parent
0169e83731
commit
856a751b51
1 changed files with 4 additions and 1 deletions
5
index.js
5
index.js
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue