Skip to content

Commit

Permalink
Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansg44 committed Aug 20, 2024
1 parent da5f483 commit 2c8005b
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/DataHarmonizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1815,17 +1815,16 @@ class DataHarmonizer {
* @param sourceFieldNameMap
* @return {string}
*/
getFirstNonNullField(
headerNamesToCheck,
inputRow,
sourceFieldNameMap
) {
getFirstNonNullField(headerNamesToCheck, inputRow, sourceFieldNameMap) {
const nullValsSet = new Set(
Object.keys(this.schema.enums.NullValueMenu.permissible_values)
.concat(['', null])
Object.keys(this.schema.enums.NullValueMenu.permissible_values).concat([
'',
null,
])
);
const valsToCheck = headerNamesToCheck.map(
(e) => inputRow[sourceFieldNameMap[e]]
);
const valsToCheck =
headerNamesToCheck.map((e) => inputRow[sourceFieldNameMap[e]]);
// TODO trim because copy pasting from excel == '\r\n'; wider issue?
const firstNonNullVal = valsToCheck.find((e) => !nullValsSet.has(e.trim()));
return firstNonNullVal ? firstNonNullVal : '';
Expand Down

0 comments on commit 2c8005b

Please sign in to comment.