index.js
function calcMaxAge (val) {
  var num = typeof val === 'string'
    ? ms(val)
    : val

  return num != null
    ? Math.min(Math.max(0, num), ONE_YEAR_MS)
    : ONE_YEAR_MS
}
function calcMaxAge (val) {
  var num = typeof val === 'string'
    ? ms(val)
    : val

  return num != null
    ? Math.min(Math.max(0, num), ONE_YEAR_MS)
    : ONE_YEAR_MS
}
function calcMaxAge ( val ) { var num = typeof val === 'string' ? ms ( val ) : val return num != null ? Math . min ( Math . max ( 0 , num ) , ONE_YEAR_MS ) : ONE_YEAR_MS }
Calculate the max-age from a configured value.

@private
@param {string|number} val
@return {number}
Calculate the max - age from a configured value .