Update Bot

This commit is contained in:
2026-03-15 11:58:43 +01:00
parent b67c111ffc
commit cd99275933
560 changed files with 23173 additions and 55113 deletions

View File

@@ -131,7 +131,6 @@ function display(data) {
/* c8 ignore next */
module.exports = (function () {
const data = Object.create(null);
let displayEnabled = true;
/**
* Time the run
@@ -159,42 +158,9 @@ module.exports = (function () {
};
}
/**
* Returns a shallow copy of the collected timings data.
* @returns {Record<string, number>} mapping of ruleId to total time in ms
*/
function getData() {
return { ...data };
}
/**
* Merges rule timing totals collected elsewhere into this process' totals.
* @param {Record<string, number>} dataToMerge mapping of ruleId to total time in ms
* @returns {void}
*/
function mergeData(dataToMerge) {
for (const [key, value] of Object.entries(dataToMerge)) {
if (typeof data[key] === "undefined") {
data[key] = 0;
}
data[key] += value;
}
}
/**
* Disables printing of timing data on process exit.
* Intended for worker threads or non-main contexts.
* @returns {void}
*/
function disableDisplay() {
displayEnabled = false;
}
if (enabled) {
process.on("exit", () => {
if (displayEnabled && Object.keys(data).length > 0) {
display(data);
}
display(data);
});
}
@@ -202,8 +168,5 @@ module.exports = (function () {
time,
enabled,
getListSize,
getData,
mergeData,
disableDisplay,
};
})();