Marketplace móvil para negocios locales mexicanos. Estructura inicial: - apps/backend (NestJS API) - apps/frontend (React Web) - apps/mobile (Expo/React Native) - apps/mcp-server (Claude MCP Server) - apps/whatsapp-service (WhatsApp Business API) - database/ (PostgreSQL DDL) - docs/ (Documentación) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
30 lines
838 B
JavaScript
30 lines
838 B
JavaScript
"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;
|
|
}
|
|
const highestLogLevelValue = logLevels
|
|
.map(level => LOG_LEVEL_VALUES[level])
|
|
.sort((a, b) => b - a)?.[0];
|
|
const targetLevelValue = LOG_LEVEL_VALUES[targetLevel];
|
|
return targetLevelValue >= highestLogLevelValue;
|
|
}
|