mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
parseWarning: use fromLocations[0]
This commit is contained in:
parent
472646057f
commit
fe63644827
1 changed files with 4 additions and 4 deletions
|
@ -15,16 +15,16 @@ const parseMsgEdge = (ctx) => (e) => {
|
||||||
])
|
])
|
||||||
res.icon = e.icon || null
|
res.icon = e.icon || null
|
||||||
// todo: rename `Loc` -> `Location` [breaking]
|
// todo: rename `Loc` -> `Location` [breaking]
|
||||||
res.fromLoc = e.fromLocation || null
|
res.fromLoc = Array.isArray(e.fromLocations) && e.fromLocations[0] || e.fromLocation || null
|
||||||
res.toLoc = e.toLocation || null
|
res.toLoc = Array.isArray(e.toLocations) && e.toLocations[0] || e.toLocation || null
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
const parseMsgEvent = (ctx) => (e) => {
|
const parseMsgEvent = (ctx) => (e) => {
|
||||||
const {profile} = ctx // todo: test that covers this
|
const {profile} = ctx // todo: test that covers this
|
||||||
return {
|
return {
|
||||||
// todo: rename `Loc` -> `Location` [breaking]
|
// todo: rename `Loc` -> `Location` [breaking]
|
||||||
fromLoc: e.fromLocation || null,
|
fromLoc: Array.isArray(e.fromLocations) && e.fromLocations[0] || e.fromLocation || null,
|
||||||
toLoc: e.toLocation || null,
|
toLoc: Array.isArray(e.toLocations) && e.toLocations[0] || e.toLocation || null,
|
||||||
start: profile.parseDateTime(ctx, e.fDate, e.fTime, null),
|
start: profile.parseDateTime(ctx, e.fDate, e.fTime, null),
|
||||||
end: profile.parseDateTime(ctx, e.tDate, e.tTime, null),
|
end: profile.parseDateTime(ctx, e.tDate, e.tTime, null),
|
||||||
sections: e.sectionNums || [] // todo: parse
|
sections: e.sectionNums || [] // todo: parse
|
||||||
|
|
Loading…
Add table
Reference in a new issue