use includes instead of indexOf

use _.uniq instead of filter&indexOf
This commit is contained in:
Barış Soner Uşaklı
2018-10-20 14:40:48 -04:00
parent a6c70412db
commit 26d4e0852f
57 changed files with 156 additions and 208 deletions

View File

@@ -32,9 +32,7 @@ pagination.create = function (currentPage, pageCount, queryObj) {
pagesToShow.push(startPage + i);
}
pagesToShow = pagesToShow.filter(function (page, index, array) {
return page > 0 && page <= pageCount && array.indexOf(page) === index;
}).sort(function (a, b) {
pagesToShow = _.uniq(pagesToShow).filter(page => page > 0 && page <= pageCount).sort(function (a, b) {
return a - b;
});