import _ from 'lodash';
if (!Array.randomNumbers)
    Array.randomNumbers = (length, max) => _.range(_.random(max === undefined ? 1 : max, length));
if (!Array.combine)
    Array.combine = (...arrays) => {
        if (arrays.length === 0)
            return [];
        if (arrays.length === 1)
            return arrays[0].map((e) => [e]);
        const [first, ...rest] = arrays;
        const combinationsOfRest = Array.combine(...rest);
        return _.flatMap(first, (element) => combinationsOfRest.map((combination) => [element, ...combination]));
    };
if (!Array.prototype.mostOccuring)
    Array.prototype.mostOccuring = function () {
        const elementsToCount = this.reduce((acc, item) => {
            acc[item] = (acc[item] || 0) + 1;
            return acc;
        }, {});
        const maxCount = Math.max(...Object.values(elementsToCount));
        const items = Object.keys(elementsToCount).filter((key) => elementsToCount[key] === maxCount);
        return { item: items[0], count: maxCount };
    };
if (!Array.prototype.includesArray)
    Array.prototype.includesArray = function (array) {
        return array.every((e) => this.includes(e));
    };
//# sourceMappingURL=array.js.map