caseinsesitive compare
This commit is contained in:
@@ -35,7 +35,10 @@ export class QuotasComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
compare(a: number | string | String, b: number | string | String, isAsc: boolean) {
|
||||
compare(a: number | string , b: number | string , isAsc: boolean) {
|
||||
if (typeof a === 'string' && typeof b === 'string') {
|
||||
return a.localeCompare(b,undefined, { sensitivity: 'accent' } ) * (isAsc ? 1 : -1);
|
||||
}
|
||||
return (a < b ? -1 : 1) * (isAsc ? 1 : -1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user