lib/Map/TableStructure.js
function areColumnsEqualLength(columns) {
  if (columns.length <= 1) {
    return true;
  }
  var firstLength = columns[0].values.length;
  var columnsWithTheSameLength = columns.slice(1).filter(function(column) {
    return column.values.length === firstLength;
  });
  return columnsWithTheSameLength.length === columns.length - 1;
}
function areColumnsEqualLength(columns) {
  if (columns.length <= 1) {
    return true;
  }
  var firstLength = columns[0].values.length;
  var columnsWithTheSameLength = columns.slice(1).filter(function(column) {
    return column.values.length === firstLength;
  });
  return columnsWithTheSameLength.length === columns.length - 1;
}
function areColumnsEqualLength ( columns ) { if ( columns . length <= 1 ) { return true ; } var firstLength = columns [ 0 ] . values . length ; var columnsWithTheSameLength = columns . slice ( 1 ) . filter ( function ( column ) { return column . values . length === firstLength ; } ) ; return columnsWithTheSameLength . length === columns . length - 1 ; }
Normally a TableStructure is generated from a csvString, using loadFromCsv, or via loadFromJson.
However, if its columns are set directly, we should check the columns are all the same length.
@private
@param  {Concept[]} columns Array of columns to check.
@return {Boolean} True if the columns are all the same length, false otherwise.
Normally a TableStructure is generated from a csvString using loadFromCsv or via loadFromJson . However if its columns are set directly we should check the columns are all the same length .