type IWithName = {
    name: string;
};

export function sortByName<T extends IWithName>(a: T, b: T) {
    return sortStrings(a.name, b.name);
}

export function sortStrings(a: string, b: string) {
    return a.toLowerCase().localeCompare(b.toLowerCase());
}
