Fixes found by an adversarial audit of 3.0.1.
start()was a silent no-op once the countdown had ended. Pushing the target back into the future withupdateOffset()rendered a live value exactly once and then froze forever, reportingrunning === false. Onlyupdate()cleared the finished flag.- The jQuery plugin lost
data-dateprecedence on re-invocation. It read the attribute only when creating an instance, so a second call over the same selection used the shared options date instead — and that is the standard "new content arrived, re-init everything" pattern the readme encourages. - A jQuery-initialised countdown leaked its interval when the element was removed.
$(el).remove(),.empty()and.html()run jQuery'scleanData, which dropped the data entry without stopping the timer, leaving it writing into a detached node with the instance unreachable. leadingZerosrounded up across the unit boundary. 59.999 seconds rendered as60.00, the impossible value that flooring ingetDiffDateexists to prevent — reachable straight from the readme's own decimal-seconds example. It truncates now.leadingZerospadded in front of the minus sign, giving0-5.toDate()returned the caller's ownDate, so mutating it afterwards moved the target.easy-countdown/jquerynow resolves for TypeScript consumers onmoduleResolution: "node".
Seven new regression tests. The 2.x compatibility suite is unchanged and still passes.