Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions src/tinted-console.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,13 @@ for (const level in levels) {
}

/**
* Enable this particular logging level.
* Enable this particular logging level (and only this one).
* @param {String} level - The level to enable
* @throws {Error} If the level name is not one of the known levels
*/
module.exports.enable = function enable(level) {
for (const key in levels) {
if (levels.hasOwnProperty(level)) {
levels[key] = true;
if (key === level) {
break;
}
}
if (!levels.hasOwnProperty(level)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is indented three spaces while the closing brace under it sits at two. eslint.config.js sets 'indent': ['error', 2, {"SwitchCase": 1}], so npx eslint reports this file as an error and the build stops before anything else in the change is looked at.

throw new Error(`Unknown log level: "${level}"`);
}
levels[level] = true;
};
Loading