mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-21 15:53:50 +02:00
Make sorting of group instances stable (#1419)
This commit is contained in:
@@ -89,6 +89,22 @@ function compareByDisplayName(a, b) {
|
||||
return a.displayName.localeCompare(b.displayName);
|
||||
}
|
||||
|
||||
/**
|
||||
* ascending
|
||||
* @param {object} a
|
||||
* @param {object} b
|
||||
* @returns
|
||||
*/
|
||||
function compareById(a, b) {
|
||||
if (
|
||||
typeof a.id !== 'string' ||
|
||||
typeof b.id !== 'string'
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
return a.id.localeCompare(b.id);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {object} a
|
||||
@@ -252,6 +268,7 @@ export {
|
||||
compareByCreatedAtAscending,
|
||||
compareByUpdatedAt,
|
||||
compareByDisplayName,
|
||||
compareById,
|
||||
compareByMemberCount,
|
||||
compareByPrivate,
|
||||
compareByStatus,
|
||||
|
||||
Reference in New Issue
Block a user