Skip to content

Commit

Permalink
Silent cleanup of picklist items to align with MULTIVALUED_DELIMITER
Browse files Browse the repository at this point in the history
  • Loading branch information
ddooley committed Jan 3, 2025
1 parent 96e7dd7 commit 00d026f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/DataHarmonizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -2781,9 +2781,19 @@ class DataHarmonizer {

if (datatype === 'Provenance') {
checkProvenance(cellChanges, fullVersion, cellVal, row, col);
} else if (field.flatVocabulary) {
}
// Clean up capitalization and spacing. This applies to both single
// and multivalued
else if (field.flatVocabulary) {
if (field.multivalued === true) {
const [, update] = validateValsAgainstVocab(cellVal, field);
let [, update] = validateValsAgainstVocab(cellVal, field);
if (!update) {
// Inefficient 2nd check: problem is cellVal containing only
// caps or non-trimmed items doesn't trigger quiet update
const update_val = formatMultivaluedValue(parseMultivaluedValue(cellVal));
if (cellVal != update_val)
update = update_val;
}
if (update) {
data[row][col] = update;
cellChanges.push([row, col, update, 'thisChange']);
Expand Down

0 comments on commit 00d026f

Please sign in to comment.