Debug: agregar logs para encontrar parametro

This commit is contained in:
2026-04-16 12:44:27 -03:00
parent c9f4f1dcc5
commit 3ff94d5350
+3 -1
View File
@@ -728,9 +728,11 @@ for (const linea of lineas) {
for (const [clave, info] of Object.entries(mapeoParametros)) { for (const [clave, info] of Object.entries(mapeoParametros)) {
if (lineaLower.includes(clave)) { if (lineaLower.includes(clave)) {
const cleanLinea = linea.replace(/show_chart|list_alt/g, '').replace(/\t+/g, ' ').replace(/\s+/g, ' ').trim(); const cleanLinea = linea.replace(/show_chart|list_alt/g, '').replace(/\t+/g, ' ').replace(/\s+/g, ' ').trim();
console.log('Testing param:', clave, 'in:', cleanLinea);
const partes = cleanLinea.split(' '); const partes = cleanLinea.split(' ');
let idxParam = partes.findIndex(p => p.toLowerCase().includes(clave)); const claveParts = clave.split(' ');
let idxParam = partes.findIndex(p => claveParts.some(cp => p.toLowerCase().includes(cp)));
if (idxParam === -1) idxParam = 0; if (idxParam === -1) idxParam = 0;
for (let i = idxParam + 1; i < partes.length; i++) { for (let i = idxParam + 1; i < partes.length; i++) {