mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-04-24 08:46:15 -04:00

* feat(list-converter): a small converter who deals with column based data and do some stuff with it * Update src/tools/list-converter/index.ts * Update src/tools/list-converter/index.ts * Update src/tools/list-converter/index.ts --------- Co-authored-by: Corentin THOMASSET <corentin.thomasset74@gmail.com> fix(list-format): fix e2e
7 lines
211 B
TypeScript
7 lines
211 B
TypeScript
export { byOrder };
|
|
|
|
function byOrder({ order }: { order: 'asc' | 'desc' | null | undefined }) {
|
|
return (a: string, b: string) => {
|
|
return order === 'asc' ? a.localeCompare(b) : b.localeCompare(a);
|
|
};
|
|
}
|