code: function getComparator(sortOrder) {
    if (typeof sortOrder === 'function') {
      return sortOrder;
    }
  
    const comparators = {
      [ASC]: ascendingSort,
      [DESC]: descendingSort,
      [ASC_LENGTH]: lengthSort,
      [DESC_LENGTH]: lengthReverseSort
    };
  
    return comparators[sortOrder];
  }
docs: Returns appropriate comparator as per the sort string.
  If a function is supplied, it returns the function itself.
  
  @param {String|Function} sortOrder
  @returns {Function}