mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2025-09-27 04:21:27 +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;
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user