Update Bot
This commit is contained in:
39
node_modules/eslint/lib/linter/timing.js
generated
vendored
39
node_modules/eslint/lib/linter/timing.js
generated
vendored
@@ -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,
|
||||
};
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user