fix; unecessary ternary condition

This commit is contained in:
Chesterkxng
2025-03-29 11:20:07 +00:00
parent 9f13da2968
commit 35be979a6e

View File

@@ -22,13 +22,11 @@ export function csvRowsToColumns(
} }
const rows = input const rows = input
? input
.split('\n') .split('\n')
.map((row) => row.split(',')) .map((row) => row.split(','))
.filter( .filter(
(row) => row.length > 0 && !row[0].trim().startsWith(commentCharacter) (row) => row.length > 0 && !row[0].trim().startsWith(commentCharacter)
) );
: [];
const columnCount = Math.max(...rows.map((row) => row.length)); const columnCount = Math.max(...rows.map((row) => row.length));
for (let i = 0; i < rows.length; i++) { for (let i = 0; i < rows.length; i++) {
for (let j = 0; j < columnCount; j++) { for (let j = 0; j < columnCount; j++) {