From 856a751b513f6cb8d8a3afb4c2b8b6e22a397747 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Wed, 30 May 2018 16:15:26 +0200 Subject: [PATCH] journeys: make opt.departure & opt.arrival mutually exclusive --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index cb3f312f..1db64568 100644 --- a/index.js +++ b/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) {