lib/index.js
function makeHoliday(date, info, observedInfo) {

  // always make the holiday.
  var holiday = {
    info: info,
    date: {
      month: date.getMonth(),
      day  : date.getDate()
    }
  }

  // if the holiday info's `bank` value has a function then
  // give it the date so it can evaluate the value.
  if ('function' === typeof info.bank) {
    info.bank = info.bank(date)
  }

  // without an observed holiday we return only the main holiday
  if (date.observed == null) {
    return holiday
  }

  // there's an observed date so return both holidays in an array.
  else {
    return [
      holiday, // main holiday
      {        // observed holiday
        info: observedInfo,
        date: {
          month: date.observed.getMonth(),
          day  : date.observed.getDate()
        }
      }
    ]
  }
}
function makeHoliday(date, info, observedInfo) {

  // always make the holiday.
  var holiday = {
    info: info,
    date: {
      month: date.getMonth(),
      day  : date.getDate()
    }
  }

  // if the holiday info's `bank` value has a function then
  // give it the date so it can evaluate the value.
  if ('function' === typeof info.bank) {
    info.bank = info.bank(date)
  }

  // without an observed holiday we return only the main holiday
  if (date.observed == null) {
    return holiday
  }

  // there's an observed date so return both holidays in an array.
  else {
    return [
      holiday, // main holiday
      {        // observed holiday
        info: observedInfo,
        date: {
          month: date.observed.getMonth(),
          day  : date.observed.getDate()
        }
      }
    ]
  }
}
function makeHoliday ( date , info , observedInfo ) { // always make the holiday. var holiday = { info : info , date : { month : date . getMonth ( ) , day : date . getDate ( ) } } // if the holiday info's `bank` value has a function then // give it the date so it can evaluate the value. if ( 'function' === typeof info . bank ) { info . bank = info . bank ( date ) } // without an observed holiday we return only the main holiday if ( date . observed == null ) { return holiday } // there's an observed date so return both holidays in an array. else { return [ holiday , // main holiday { // observed holiday info : observedInfo , date : { month : date . observed . getMonth ( ) , day : date . observed . getDate ( ) } } ] } }
helper function which accepts the calculated holiday date and holiday info's. if an observed date was produced then it returns both holidays. also helps with the `bank` boolean value.
helper function which accepts the calculated holiday date and holiday info s . if an observed date was produced then it returns both holidays . also helps with the bank boolean value .