From 2d9b6e430b067aaed4fe49067f5b4baac7959e35 Mon Sep 17 00:00:00 2001 From: freearhey <7253922+freearhey@users.noreply.github.com> Date: Mon, 23 Oct 2023 22:24:23 +0300 Subject: [PATCH] Update validate.ts --- scripts/db/validate.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/db/validate.ts b/scripts/db/validate.ts index ac976969..0ca6ae2a 100644 --- a/scripts/db/validate.ts +++ b/scripts/db/validate.ts @@ -23,12 +23,11 @@ async function main() { if (file.extension() !== 'csv') continue const csv = await dataStorage.load(file.basename()) - if (/\s+$/.test(csv)) - return handleError(`Error: empty lines at the end of file not allowed (${filepath})`) const rows = csv.split(/\r\n/) const headers = rows[0].split(',') for (const [i, line] of rows.entries()) { + if (!line.trim()) continue if (line.indexOf('\n') > -1) return handleError( `Error: row ${i + 1} has the wrong line ending character, should be CRLF (${filepath})`