-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add routingMode query parameter to /journeys route πβ
closes #46 Co-Authored-By: Jannis R <[email protected]>
- Loading branch information
1 parent
beb8657
commit 1ffc757
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import {routingModes} from 'hafas-client/p/db/routing-modes.js' | ||
|
||
const parseRoutingMode = (key, val) => { | ||
if ('string' !== typeof val) throw new Error(key + ' must be a string') | ||
val = val.toUpperCase() | ||
if(Object.prototype.hasOwnProperty.call(routingModes, val)) return routingModes[val] | ||
throw new Error(key + ' must be one of ' + Object.keys(routingModes).join(', ')) | ||
} | ||
|
||
export { | ||
parseRoutingMode | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters