mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
16 lines
402 B
JavaScript
16 lines
402 B
JavaScript
'use strict'
|
|
|
|
const defaultProfile = require('./lib/default-profile')
|
|
const request = require('./lib/request')
|
|
|
|
const createClient = (profile) => {
|
|
profile = Object.assign({}, defaultProfile, profile)
|
|
if ('string' !== typeof profile.timezone) {
|
|
throw new Error('profile.timezone must be a string.')
|
|
}
|
|
|
|
const client = data => request(profile, data)
|
|
return client
|
|
}
|
|
|
|
module.exports = createClient
|