index.js
function duration (time) {
  var number = parseFloat(time)
  switch (unit(time)) {
    case null:
    case 'ms': return number
    case 's': return number * 1000
    case 'm': return number * 60000
    case 'h': return number * 3600000
    case 'd': return number * 86400000
    case 'w': return number * 604800000
    default: return null
  }
}
function duration (time) {
  var number = parseFloat(time)
  switch (unit(time)) {
    case null:
    case 'ms': return number
    case 's': return number * 1000
    case 'm': return number * 60000
    case 'h': return number * 3600000
    case 'd': return number * 86400000
    case 'w': return number * 604800000
    default: return null
  }
}
function duration ( time ) { var number = parseFloat ( time ) switch ( unit ( time ) ) { case null : case 'ms' : return number case 's' : return number * 1000 case 'm' : return number * 60000 case 'h' : return number * 3600000 case 'd' : return number * 86400000 case 'w' : return number * 604800000 default : return null } }
Normalize duration value into milliseconds.
Normalize duration value into milliseconds .