import { createDuration } from './create';
var round = Math.round;
-var secondsThresholdChanged = false;
var thresholds = {
ss: 44, // a few seconds to seconds
s : 45, // seconds to minute
if (limit === undefined) {
return thresholds[threshold];
}
- if (threshold === 's' && !secondsThresholdChanged) {
+ thresholds[threshold] = limit;
+ if (threshold === 's') {
thresholds.ss = limit - 1;
- } else if (threshold === 'ss') {
- secondsThresholdChanged = true;
}
- thresholds[threshold] = limit;
return true;
}