2017-11-11 22:35:41 +01:00
|
|
|
'use strict'
|
|
|
|
|
2017-11-11 23:56:09 +01:00
|
|
|
const clone = obj => Object.assign({}, obj)
|
|
|
|
|
2018-06-07 16:00:28 +02:00
|
|
|
const createParseJourney = (profile, stations, lines, hints, polylines) => {
|
|
|
|
const parseLeg = profile.parseJourneyLeg(profile, stations, lines, hints, polylines)
|
2017-11-11 22:35:41 +01:00
|
|
|
|
|
|
|
// todo: c.sDays
|
|
|
|
// todo: c.conSubscr
|
|
|
|
// todo: c.trfRes x vbb-parse-ticket
|
2017-11-12 01:23:34 +01:00
|
|
|
const parseJourney = (j) => {
|
2017-12-28 16:56:27 +01:00
|
|
|
const legs = j.secL.map(leg => parseLeg(j, leg))
|
2017-12-07 20:21:14 +01:00
|
|
|
const res = {
|
2018-03-02 00:35:54 +01:00
|
|
|
type: 'journey',
|
2018-03-21 01:15:43 +01:00
|
|
|
legs
|
2017-12-07 20:21:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return res
|
2017-11-11 22:35:41 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return parseJourney
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = createParseJourney
|