Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const journey = (l, p, r) => {
const parseJourney = parse.journey('Europe/Berlin', l, p, r)
const parseJourneyWithTickets = (j) => {
const journey = parseJourney(j)
if (
j.trfRes &&
Array.isArray(j.trfRes.fareSetL) &&
j.trfRes.fareSetL[0] &&
Array.isArray(j.trfRes.fareSetL[0].fareL)
) {
journey.tickets = []
const sets = j.trfRes.fareSetL[0].fareL
for (let s of sets) {
if (!Array.isArray(s.ticketL) || s.ticketL.length === 0) continue
for (let t of s.ticketL) {
const ticket = parseTicket(t)