Skip to content

Commit

Permalink
remove redundant type cast and add a toString
Browse files Browse the repository at this point in the history
  • Loading branch information
aubin-tchoi committed Dec 4, 2024
1 parent 825cf7f commit 83c6b89
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions front/lib/api/tables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,10 @@ export async function rowsFromCsv({
const valuesByCol: Record<string, string[]> = Object.create(null);
for await (const anyRecord of parser) {
if (i++ >= rowIndex) {
const record = anyRecord as string[];
for (const [i, h] of header.entries()) {
try {
valuesByCol[h] ??= [];
(valuesByCol[h] as string[]).push(record[i] ?? "");
valuesByCol[h].push((anyRecord[i] ?? "").toString());
} catch (e) {
logger.error(
// temporary log to fix the valuesByCol[h].push is not a function error
Expand Down

0 comments on commit 83c6b89

Please sign in to comment.