MCPcopy Create free account
hub / github.com/deployd/deployd / firstTimerInRange

Function firstTimerInRange

test-app/public/sinon.js:28042–28058  ·  view source on GitHub ↗
(clock, from, to)

Source from the content-addressed store, hash-verified

28040 }
28041
28042 function firstTimerInRange(clock, from, to) {
28043 var timers = clock.timers;
28044 var timer = null;
28045 var id, isInRange;
28046
28047 for (id in timers) {
28048 if (timers.hasOwnProperty(id)) {
28049 isInRange = inRange(from, to, timers[id]);
28050
28051 if (isInRange && (!timer || compareTimers(timer, timers[id]) === 1)) {
28052 timer = timers[id];
28053 }
28054 }
28055 }
28056
28057 return timer;
28058 }
28059
28060 function firstTimer(clock) {
28061 var timers = clock.timers;

Callers 1

createClockFunction · 0.85

Calls 2

inRangeFunction · 0.85
compareTimersFunction · 0.85

Tested by

no test coverage detected