db-vendo-client/p/pkp/index.js

38 lines
895 B
JavaScript
Raw Permalink Normal View History

2022-05-07 16:17:37 +02:00
// todo: use import assertions once they're supported by Node.js & ESLint
// https://github.com/tc39/proposal-import-assertions
import {createRequire} from 'module'
const require = createRequire(import.meta.url)
2020-03-11 20:00:54 +01:00
2022-05-07 16:17:37 +02:00
import {parseHook} from '../../lib/profile-hooks.js'
2020-03-18 21:43:19 +01:00
2022-05-07 16:17:37 +02:00
import {parseLocation} from '../../parse/location.js'
const baseProfile = require('./base.json')
2022-05-07 16:17:37 +02:00
import {products} from './products.js'
2020-03-11 20:00:54 +01:00
2020-03-18 21:43:19 +01:00
const trimStopName = ({parsed}, l) => {
if (parsed.type === 'stop' || parsed.type === 'station' && parsed.name) {
parsed.name = parsed.name.replace(/(^-|-$)/g, '')
}
return parsed
}
2022-05-07 16:17:37 +02:00
const profile = {
...baseProfile,
2020-03-11 20:00:54 +01:00
locale: 'pl-PL',
timezone: 'Europe/Warsaw',
products,
2020-03-18 21:43:19 +01:00
parseLocation: parseHook(parseLocation, trimStopName),
2020-03-11 20:00:54 +01:00
trip: true,
radar: true,
refreshJourney: false,
2020-09-16 17:21:59 +02:00
reachableFrom: true,
remarks: false, // seems like ver >= 1.20 is required
2020-03-11 20:00:54 +01:00
}
2022-05-07 16:17:37 +02:00
export {
profile,
}