mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
20 lines
454 B
JavaScript
20 lines
454 B
JavaScript
'use strict'
|
|
|
|
// todo: what is p.number vs p.line?
|
|
// todo: what is p.icoX?
|
|
// todo: what is p.oprX?
|
|
// todo: is passing in profile necessary?
|
|
const parseLine = (profile, p) => {
|
|
if (!p) return null // todo: handle this upstream
|
|
const res = {type: 'line', name: p.line || p.name}
|
|
|
|
if (p.cls) res.class = p.cls
|
|
if (p.prodCtx) {
|
|
res.productCode = +p.prodCtx.catCode
|
|
res.productName = p.prodCtx.catOutS
|
|
}
|
|
|
|
return res
|
|
}
|
|
|
|
module.exports = parseLine
|