diff --git a/server/db/antiguo.js b/server/db/antiguo.js index b1eac82..8ebb90e 100644 --- a/server/db/antiguo.js +++ b/server/db/antiguo.js @@ -326,14 +326,11 @@ const carpetasRepetidas = async () => { let repetidas = []; for (let i = 0; i < carpetas.length; i++) { + let aux = [carpetas[i]]; for (let j = i + 1; j < carpetas.length; j++) { - if (carpetas[i].name === carpetas[j].name) repetidas.push(carpetas[j]); - else { - repetidas.push(carpetas[i]); - i = j - 1; - break; - } + if (carpetas[i].name === carpetas[j].name) carpetas.push(carpetas[j]); } + if (aux.length > 1) repetidas.push(aux); } console.log(carpetas.length); console.log(carpetas);