code: function tableDataSorter( direction, sortType ) {
    return function( a, b ) {
      const sign = direction === DIRECTIONS.DOWN ? -1 : 1;
      let order = 0;
      const regex = /[^\d.-]/g;
  
      // Set a and b to the first Array in each Array-of-Arrays
      a = a[0];
      b = b[0];
  
      // For number sort, convert a & b to numbers.
      if ( sortType === 'number' ) {
        a = Number( a.replace( regex, '' ) );
        b = Number( b.replace( regex, '' ) );
      }
  
      // Sort the values
      if ( a < b ) {
        order = sign * -1;
      } else if ( a > b ) {
        order = sign;
      }
  
      return order;
    };
  }
docs: TODO Fix complexity issue /* eslint-disable complexity 
  Function used to create a function for sorting table data.
  Passed to Array.sort method.
  
  @param {number} direction - A number where a negative number indicates a
  reverse sort.
  @param {string} sortType - A string used for sort types. By default,
  the values are sorted by their native type. If this value is set to
  'number', then the cells' numeric values are used.
  @returns {Function} - A function to be used by the Array.sort method,
  where the parameters 'a' and 'b' is each an Array (of Arrays) to be sorted.