From 7524716919c2ab01d74e1da8852f24a8b7a9fbc8 Mon Sep 17 00:00:00 2001 From: Ivan S Gill Date: Wed, 11 Dec 2024 13:42:48 -0800 Subject: [PATCH] Prettier --- lib/DataHarmonizer.js | 24 +++++++++++++++++------- lib/Validator.js | 4 +--- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/lib/DataHarmonizer.js b/lib/DataHarmonizer.js index 020d9511..a52df76b 100644 --- a/lib/DataHarmonizer.js +++ b/lib/DataHarmonizer.js @@ -1757,17 +1757,27 @@ class DataHarmonizer { // if sources exist, fetch transformed Value if (field.sources) { - if (field.multivalued === true) { //Map list of semicolon-delimited choices + if (field.multivalued === true) { + // Map list of semicolon-delimited choices // ISSUE: relying on semicolon delimiter in input for (let cellVal of mappedCellVal.split(';')) { - mappedCell.push( self.getTransformedField(headerName, cellVal.trim(), field, prefix)); + mappedCell.push( + self.getTransformedField( + headerName, + cellVal.trim(), + field, + prefix + ) + ); } + } else { + // Map single choice + mappedCell.push( + self.getTransformedField(headerName, mappedCellVal, field, prefix) + ); } - else { // Map single choice - mappedCell.push(self.getTransformedField(headerName, mappedCellVal, field, prefix)); - } - } - else { // No mapping. + } else { + // No mapping. mappedCell.push(mappedCellVal); } } diff --git a/lib/Validator.js b/lib/Validator.js index 36c29c73..7e785ca1 100644 --- a/lib/Validator.js +++ b/lib/Validator.js @@ -140,7 +140,6 @@ class Validator { this.#valueValidatorMap = new Map(); } - /* This returns a single primitve data type for a slot - a decimal, date, string etc. or possibly an enumeration. Enumerations are handled separately however (by const slotEnum = ...). Slots either use "range" @@ -150,7 +149,6 @@ class Validator { may be undefined if that is a menu too. */ getSlotType(slotDefinition) { - var slotType = this.#schema.types?.[slotDefinition.range]; if (slotType === undefined) { @@ -163,7 +161,7 @@ class Validator { } } - return slotType + return slotType; } getValidatorForSlot(slot, options = {}) {