Skip to content

Commit

Permalink
allow customising the hafas-client profile
Browse files Browse the repository at this point in the history
  • Loading branch information
derhuerst committed Oct 7, 2022
1 parent 411b814 commit 32586e6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@
const createHafasClient = require('hafas-client')
const bvgProfile = require('hafas-client/p/bvg')

const createClient = (userAgent) => {
return createHafasClient(bvgProfile, userAgent)
const defaults = {
profile: bvgProfile
}

const createClient = (userAgent, opt = {}) => {
const {
profile,
} = {...defaults, ...opt}

return createHafasClient(profile, userAgent)
}

createClient.defaults = defaults
module.exports = createClient
2 changes: 1 addition & 1 deletion license.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2020, Jannis R
Copyright (c) 2022, Jannis R

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

Expand Down

0 comments on commit 32586e6

Please sign in to comment.