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