Initial commit - Event Planner application

This commit is contained in:
mberlin
2026-03-18 14:55:56 -03:00
commit 86d779eb4d
7548 changed files with 1006324 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isLogLevelEnabled = isLogLevelEnabled;
const LOG_LEVEL_VALUES = {
verbose: 0,
debug: 1,
log: 2,
warn: 3,
error: 4,
fatal: 5,
};
/**
* Checks if target level is enabled.
* @param targetLevel target level
* @param logLevels array of enabled log levels
*/
function isLogLevelEnabled(targetLevel, logLevels) {
if (!logLevels || (Array.isArray(logLevels) && logLevels?.length === 0)) {
return false;
}
if (logLevels.includes(targetLevel)) {
return true;
}
let highestLogLevelValue = -Infinity;
for (const level of logLevels) {
const v = LOG_LEVEL_VALUES[level];
if (v > highestLogLevelValue)
highestLogLevelValue = v;
}
const targetLevelValue = LOG_LEVEL_VALUES[targetLevel];
return targetLevelValue >= highestLogLevelValue;
}