first
This commit is contained in:
27
node_modules/@11ty/eleventy-img/src/defer-counter.js
generated
vendored
Normal file
27
node_modules/@11ty/eleventy-img/src/defer-counter.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
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;
|
||||
Reference in New Issue
Block a user