From 5d87be731bd9cd722f108f5b98d6ac6ca6a2458c Mon Sep 17 00:00:00 2001 From: Nulo Date: Wed, 11 Sep 2024 23:15:26 -0300 Subject: [PATCH] mostrar cuales son las provincias que no existen --- sepa/sepa-dataset-validator/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sepa/sepa-dataset-validator/index.ts b/sepa/sepa-dataset-validator/index.ts index 8207b72..4bc9500 100644 --- a/sepa/sepa-dataset-validator/index.ts +++ b/sepa/sepa-dataset-validator/index.ts @@ -128,9 +128,12 @@ const checkers: Record boolean | string> = { ["[sucursales.csv] sucursales_provincia no cumple con ISO 3166-2"](files) { const sucursales = files["sucursales.csv"].data; for (const sucursal of sucursales) { - if (!(sucursal as any).sucursales_provincia) continue; - if (!ISO_PROVINCIAS.includes((sucursal as any).sucursales_provincia)) + const prov = (sucursal as any).sucursales_provincia; + if (!prov) continue; + if (!ISO_PROVINCIAS.includes(prov)) { + console.error(` La provincia ${prov} no es vĂ¡lida`); return true; + } } return false; },