"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.findDuplicates = exports.filterAndSeparate = void 0;
/****
 *
 * separates an single array into an array of successes and an array of fails
 * success is based on the truthiness of an predicate function
 *
 * successes are the first value of the return tuple
 *****/
function filterAndSeparate(items, predicate) {
    const truthy = [];
    const falsey = [];
    for (const item of items) {
        if (predicate(item)) {
            truthy.push(item);
        }
        else {
            falsey.push(item);
        }
    }
    return [truthy, falsey];
}
exports.filterAndSeparate = filterAndSeparate;
/*
  from an array of items, returns of all duplicates found
*/
function findDuplicates(items) {
    return items.filter((item, index) => items.indexOf(item) !== index);
}
exports.findDuplicates = findDuplicates;

//# sourceMappingURL=../maps/core/ArrayUtilities.js.map
