Skip to content

Commit

Permalink
WIP: Reduced how the colToProp functionality #7031
Browse files Browse the repository at this point in the history
  • Loading branch information
wszymanski committed Jul 21, 2020
1 parent bf08361 commit c0b1549
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions src/dataMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,23 +190,12 @@ class DataMap {
/**
* Returns property name that corresponds with the given column index.
*
* @param {string|number} column Visual column index or another passed argument.
* @returns {string|number|null} Column property, physical column index or passed argument.
* @param {string|number} column Visual column index.
* @returns {string|number|null} Column property which may be also a physical column index.
*/
colToProp(column) {
// TODO: Should it work? Please, look at the test:
// "it should return the provided property name, when the user passes a property name as a column number".
if (Number.isInteger(column) === false) {
return column;
}

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];
Expand Down

0 comments on commit c0b1549

Please sign in to comment.