Skip to content

Commit

Permalink
jsdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
ivansg44 committed Aug 22, 2024
1 parent 59e17b2 commit 9edbb4f
Showing 1 changed file with 38 additions and 17 deletions.
55 changes: 38 additions & 17 deletions lib/DataHarmonizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1763,14 +1763,27 @@ class DataHarmonizer {
}

/**
* Given a table row, output a value based on the following conditional:
* ```
* if (value in headerNameToCheck == valToMatch) {
* return value in headerNameToOutput;
* } else {
* return "";
* }
* ```
* TODO is there any need for additional complexities in getMappedField?
* i.e., transforming field
* @param headerNameToCheck
* @param valToMatch
* @param headerNameToOutput
* @param inputRow
* @param sourceFieldNameMap
* @return TODO
* @param {string} headerNameToCheck Field name of user-inputted vals to check
* against `valToMatch`.
* @param {string} valToMatch Value to match user-inputted vals against during
* conditional.
* @param {string} headerNameToOutput Field name of user-inputted vals to
* return if conditional is satisfied.
* @param {string[]} inputRow Table row.
* @param {Object<string, number>} sourceFieldNameMap `getFieldNameMap` return
* val.
* @return {string} `valToMatch` if condition is satisfied; empty str
* otherwise.
*/
getIfThenField(
headerNameToCheck,
Expand All @@ -1785,12 +1798,17 @@ class DataHarmonizer {
}

/**
* TODO
* @param headerNameToCheck
* @param matchedValsSet
* @param inputRow
* @param sourceFieldNameMap
* @return {string}
* Given a table row, find the intersection of user-inputted values in
* `headerNameToCheck` and vals in `matchedValsSet`.
* @param {string} headerNameToCheck Field name of user-inputted vals to
* intersect against `matchedValsSet`.
* @param {Set<string>} matchedValsSet Set of values that user-inputted vals
* are intersected against.
* @param {string[]} inputRow Table row.
* @param {Object<string, number>} sourceFieldNameMap `getFieldNameMap` return
* val.
* @return {string} Intersection of user-inputted values in
* `headerNameToCheck` and vals in `matchedValsSet`.
*/
getMatchedValsField(
headerNameToCheck,
Expand All @@ -1809,11 +1827,14 @@ class DataHarmonizer {
}

/**
* TODO
* @param headerNamesToCheck
* @param inputRow
* @param sourceFieldNameMap
* @return {string}
* Given a table row, and an ordered collection of field names, return the
* first non-null field val.
* @param {string[]} headerNamesToCheck Field names of user-inputted vals to
* check for non-null vals, in 0-indexed order.
* @param {string[]} inputRow Table row.
* @param {Object<string, number>} sourceFieldNameMap `getFieldNameMap` return
* val.
* @return {string} First non-null val in `headerNamesToCheck`.
*/
getFirstNonNullField(headerNamesToCheck, inputRow, sourceFieldNameMap) {
const nullValsSet = new Set(
Expand Down

0 comments on commit 9edbb4f

Please sign in to comment.