lib/utils/scheduleToAction.js
function scheduleToAction (def) {
  if (!def) {
    return null
  }

  const id = def.id || null
  const schedule = parseSchedule(def.schedule)
  const nextTime = nextSchedule(schedule, true)

  return {
    ...def.action,
    meta: {
      id,
      schedule,
      queue: (nextTime) ? nextTime.getTime() : true
    }
  }
}
function scheduleToAction (def) {
  if (!def) {
    return null
  }

  const id = def.id || null
  const schedule = parseSchedule(def.schedule)
  const nextTime = nextSchedule(schedule, true)

  return {
    ...def.action,
    meta: {
      id,
      schedule,
      queue: (nextTime) ? nextTime.getTime() : true
    }
  }
}
Create a queuable action from a schedule definition.
@param {Object} def - A schedule definition
@returns {object} An action object