Skip to content

Commit

Permalink
reverted some changes #7031
Browse files Browse the repository at this point in the history
  • Loading branch information
wszymanski committed Jul 9, 2020
1 parent ebe3261 commit abdaf57
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/dataMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,18 +202,23 @@ class DataMap {

const physicalColumn = this.instance.toPhysicalColumn(column);

// Beyond the table boundaries. // TODO: This conditional may be temporary.
if (physicalColumn === null) {
return null;
}

// Cached property.
if (this.colToPropCache && isDefined(this.colToPropCache[physicalColumn])) {
return this.colToPropCache[physicalColumn];
}

return column;
return physicalColumn;
}

/**
* Translates property into visual column index.
*
* @param {string|number} prop Column property which may be also a visual column index.
* @param {string|number} prop Column property which may be also a physical column index.
* @returns {string|number|null} Visual column index or passed argument.
*/
propToCol(prop) {
Expand All @@ -223,8 +228,8 @@ class DataMap {
return this.instance.toVisualColumn(cachedPhysicalIndex);
}

// Property may be a visual column index.
return prop;
// Property may be a physical column index.
return this.instance.toVisualColumn(prop);
}

/**
Expand Down Expand Up @@ -615,13 +620,7 @@ class DataMap {

// try to get value under property `prop` (includes dot)
if (dataRow && dataRow.hasOwnProperty && hasOwnProperty(dataRow, prop)) {
let property = prop;

if (Number.isInteger(prop)) {
property = this.instance.toPhysicalColumn(prop); // Property being a string is equivalent to a physical column index.
}

value = dataRow[property];
value = dataRow[prop];

} else if (typeof prop === 'string' && prop.indexOf('.') > -1) {
const sliced = prop.split('.');
Expand Down

0 comments on commit abdaf57

Please sign in to comment.