fast-iterable
Version:
Provides LINQ-like fluent api operations for iterables and async iterables (ES2018+).
18 lines (17 loc) • 495 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getPartitionComparer = void 0;
function partitionLengthComparer(size) {
let i = 1;
return function () {
const result = i < size;
i = result ? i + 1 : 1;
return result;
};
}
function getPartitionComparer(criteria) {
return typeof criteria === 'number'
? partitionLengthComparer(criteria)
: criteria;
}
exports.getPartitionComparer = getPartitionComparer;