mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-06-04 19:57:20 +02:00
ENiGMA 1/2 WILL USE SPACES FROM THIS POINT ON VS TABS
* Really just to make GitHub formatting happy. Arg.
This commit is contained in:
parent
5ddf04c882
commit
e9787cee3e
135 changed files with 27397 additions and 27397 deletions
|
@ -12,19 +12,19 @@ exports.sortAreasOrConfs = sortAreasOrConfs;
|
|||
// Otherwise, use a locale comparison on the sort key or name as a fallback
|
||||
//
|
||||
function sortAreasOrConfs(areasOrConfs, type) {
|
||||
let entryA;
|
||||
let entryB;
|
||||
let entryA;
|
||||
let entryB;
|
||||
|
||||
areasOrConfs.sort((a, b) => {
|
||||
entryA = type ? a[type] : a;
|
||||
entryB = type ? b[type] : b;
|
||||
areasOrConfs.sort((a, b) => {
|
||||
entryA = type ? a[type] : a;
|
||||
entryB = type ? b[type] : b;
|
||||
|
||||
if(_.isNumber(entryA.sort) && _.isNumber(entryB.sort)) {
|
||||
return entryA.sort - entryB.sort;
|
||||
} else {
|
||||
const keyA = entryA.sort ? entryA.sort.toString() : entryA.name;
|
||||
const keyB = entryB.sort ? entryB.sort.toString() : entryB.name;
|
||||
return keyA.localeCompare(keyB, { sensitivity : false, numeric : true } ); // "natural" compare
|
||||
}
|
||||
});
|
||||
if(_.isNumber(entryA.sort) && _.isNumber(entryB.sort)) {
|
||||
return entryA.sort - entryB.sort;
|
||||
} else {
|
||||
const keyA = entryA.sort ? entryA.sort.toString() : entryA.name;
|
||||
const keyB = entryB.sort ? entryB.sort.toString() : entryB.name;
|
||||
return keyA.localeCompare(keyB, { sensitivity : false, numeric : true } ); // "natural" compare
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue