> if (!_.isNumber(time) || time > duration || time < 0)

Done.