Skip to content

Collection of handy online tools for developers, with great UX.

211 B
Raw Blame
export { byOrder };

function byOrder({ order }: { order: 'asc' | 'desc' | null | undefined }) {
  return (a: string, b: string) => {
    return order === 'asc' ? a.localeCompare(b) : b.localeCompare(a);
  };
}