Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@skava/packages / features / Pagination / PageLimit.js
Size: Mime:
import { toNumber } from 'exotic';
/**
 * @todo @@packages @action
 */
export function setPageLimit(productLimits, limit) {
    function checkProductLimit(item) {
        item.isDisabled = toNumber(item.label) < limit ? false : true;
        return item;
    }
    function pagePerProductSorting(first, second) {
        const firstLabel = toNumber(first.label);
        const secondLabel = toNumber(second.label);
        if (firstLabel < secondLabel) {
            return -1;
        }
        if (firstLabel > secondLabel) {
            return 1;
        }
        return 0;
    }
    const productLimitsPerPage = productLimits.filter(checkProductLimit);
    return productLimitsPerPage.sort(pagePerProductSorting);
}
//# sourceMappingURL=PageLimit.js.map