mirror of
https://github.com/home-assistant/frontend.git
synced 2026-03-02 23:10:47 +00:00
14 lines
244 B
TypeScript
14 lines
244 B
TypeScript
export const compare = (a: string, b: string) => {
|
|
if (a < b) {
|
|
return -1;
|
|
}
|
|
if (a > b) {
|
|
return 1;
|
|
}
|
|
|
|
return 0;
|
|
};
|
|
|
|
export const caseInsensitiveCompare = (a: string, b: string) =>
|
|
compare(a.toLowerCase(), b.toLowerCase());
|