mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-17 17:14:18 +02:00
New: Project Aphrodite
This commit is contained in:
13
frontend/src/Utilities/Array/getIndexOfFirstCharacter.js
Normal file
13
frontend/src/Utilities/Array/getIndexOfFirstCharacter.js
Normal file
@@ -0,0 +1,13 @@
|
||||
import _ from 'lodash';
|
||||
|
||||
export default function getIndexOfFirstCharacter(items, character) {
|
||||
return _.findIndex(items, (item) => {
|
||||
const firstCharacter = item.sortTitle.charAt(0);
|
||||
|
||||
if (character === '#') {
|
||||
return !isNaN(firstCharacter);
|
||||
}
|
||||
|
||||
return firstCharacter === character;
|
||||
});
|
||||
}
|
5
frontend/src/Utilities/Array/sortByName.js
Normal file
5
frontend/src/Utilities/Array/sortByName.js
Normal file
@@ -0,0 +1,5 @@
|
||||
function sortByName(a, b) {
|
||||
return a.name.localeCompare(b.name);
|
||||
}
|
||||
|
||||
export default sortByName;
|
Reference in New Issue
Block a user