Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansg44 committed Aug 22, 2024
1 parent 2c8005b commit 5843a34
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/DataHarmonizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1822,11 +1822,12 @@ class DataHarmonizer {
null,
])
);
const valsToCheck = headerNamesToCheck.map(
(e) => inputRow[sourceFieldNameMap[e]]
);
const valsToCheck = headerNamesToCheck.map((headerName) => {
const valToCheck = inputRow[sourceFieldNameMap[headerName]];
// TODO trim because copy pasting from excel == '\r\n'; wider issue?
const firstNonNullVal = valsToCheck.find((e) => !nullValsSet.has(e.trim()));
return typeof valToCheck === 'string' ? valToCheck.trim() : valToCheck;
});
const firstNonNullVal = valsToCheck.find((e) => !nullValsSet.has(e));
return firstNonNullVal ? firstNonNullVal : '';
}

Expand Down

0 comments on commit 5843a34

Please sign in to comment.