You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

sortHelpers.ts 288B

123456789101112
  1. export const compare = (a: string, b: string, sort: string): number => {
  2. if (sort === 'asc') {
  3. if (a > b) return 1;
  4. else if (b > a) return -1;
  5. return 0;
  6. } else if (sort === 'desc') {
  7. if (a > b) return -1;
  8. else if (b > a) return 1;
  9. return 0;
  10. }
  11. return 0;
  12. };