Files
beall/node_modules/@11ty/eleventy-img/src/defer-counter.js

28 lines
391 B
JavaScript
Raw Normal View History

2026-03-31 16:38:22 -07:00
class DeferCounter {
constructor() {
this.resetCount();
}
resetCount() {
this.deferCount = 0;
this.inputs = new Map();
}
getCount() {
return this.deferCount;
}
increment(input) {
if(input) {
if(this.inputs.has(input)) {
return;
}
this.inputs.set(input, true);
}
this.deferCount++;
}
}
module.exports = DeferCounter;