New: Custom Filtering for UI (#234)

This commit is contained in:
Qstick
2018-03-14 21:28:46 -04:00
committed by GitHub
parent c6873014c7
commit 7354e02bff
154 changed files with 3498 additions and 1370 deletions
@@ -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;
});
}