@beenotung/tslib
Version:
utils library in Typescript
16 lines (15 loc) • 449 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.clearAllTimer = clearAllTimer;
// eslint-disable-next-line @typescript-eslint/no-empty-function
function noop() { }
function clearAllTimer() {
let i = setInterval(noop);
if (typeof i !== 'number') {
throw new Error('clearAllTimer does not support node.js');
}
for (; i > 0; i--) {
clearTimeout(i);
clearInterval(i);
}
}