Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then((d) => {
const p = getProp.bind(null, d)
const orig = getProp.bind(null, p('airport.origin') || {})
const dest = getProp.bind(null, p('airport.destination') || {})
const time = getProp.bind(null, p('time') || {})
let dep = time('real.departure') || time('estimated.departure') || time('scheduled.departure')
if (dep) dep = moment.tz(dep * 1000, orig('timezone.name')).format()
let sDep = time('scheduled.departure')
if (sDep) sDep = moment.tz(sDep * 1000, orig('timezone.name')).format()
let arr = time('real.arrival') || time('estimated.arrival') || time('scheduled.arrival')
if (arr) arr = moment.tz(arr * 1000, dest('timezone.name')).format()
let sArr = time('scheduled.arrival')
if (sArr) sArr = moment.tz(sArr * 1000, dest('timezone.name')).format()
let delay = time('historical.delay') || null
if (delay) delay = parseInt(time('historical.delay'))
return {
.then((d) => {
const p = getProp.bind(null, d)
const orig = getProp.bind(null, p('airport.origin') || {})
const dest = getProp.bind(null, p('airport.destination') || {})
const time = getProp.bind(null, p('time') || {})
let dep = time('real.departure') || time('estimated.departure') || time('scheduled.departure')
if (dep) dep = moment.tz(dep * 1000, orig('timezone.name')).format()
let sDep = time('scheduled.departure')
if (sDep) sDep = moment.tz(sDep * 1000, orig('timezone.name')).format()
let arr = time('real.arrival') || time('estimated.arrival') || time('scheduled.arrival')
if (arr) arr = moment.tz(arr * 1000, dest('timezone.name')).format()
let sArr = time('scheduled.arrival')
if (sArr) sArr = moment.tz(sArr * 1000, dest('timezone.name')).format()
let delay = time('historical.delay') || null
if (delay) delay = parseInt(time('historical.delay'))
return {
id: p('identification.id'),
.then((d) => {
const p = getProp.bind(null, d)
const orig = getProp.bind(null, p('airport.origin') || {})
const dest = getProp.bind(null, p('airport.destination') || {})
const time = getProp.bind(null, p('time') || {})
let dep = time('real.departure') || time('estimated.departure') || time('scheduled.departure')
if (dep) dep = moment.tz(dep * 1000, orig('timezone.name')).format()
let sDep = time('scheduled.departure')
if (sDep) sDep = moment.tz(sDep * 1000, orig('timezone.name')).format()
let arr = time('real.arrival') || time('estimated.arrival') || time('scheduled.arrival')
if (arr) arr = moment.tz(arr * 1000, dest('timezone.name')).format()
let sArr = time('scheduled.arrival')
if (sArr) sArr = moment.tz(sArr * 1000, dest('timezone.name')).format()
let delay = time('historical.delay') || null
if (delay) delay = parseInt(time('historical.delay'))
.then((d) => {
const p = getProp.bind(null, d)
const orig = getProp.bind(null, p('airport.origin') || {})
const dest = getProp.bind(null, p('airport.destination') || {})
const time = getProp.bind(null, p('time') || {})
let dep = time('real.departure') || time('estimated.departure') || time('scheduled.departure')
if (dep) dep = moment.tz(dep * 1000, orig('timezone.name')).format()
let sDep = time('scheduled.departure')
if (sDep) sDep = moment.tz(sDep * 1000, orig('timezone.name')).format()
let arr = time('real.arrival') || time('estimated.arrival') || time('scheduled.arrival')
if (arr) arr = moment.tz(arr * 1000, dest('timezone.name')).format()
let sArr = time('scheduled.arrival')
if (sArr) sArr = moment.tz(sArr * 1000, dest('timezone.name')).format()
let delay = time('historical.delay') || null
if (delay) delay = parseInt(time('historical.delay'))