"use strict";
/**
 * These are a collection of functions for non-TypeScript users so that they can access some of
 * useful methods offered on the `Array` class in the JavaScript standard library.
 *
 * If you are a TypeScript user, you should never use these functions, and instead use the more
 * idiomatic object-oriented approach.
 *
 * @module
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.some = exports.map = exports.join = exports.forEach = exports.find = exports.filter = exports.every = void 0;
/**
 * Helper function for non-TypeScript users to check if every element in the array is equal to a
 * condition.
 *
 * Internally, this just calls `Array.every`.
 */
function every(array, func) {
    return array.every(func);
}
exports.every = every;
/**
 * Helper function for non-TypeScript users to filter the elements in an array. Returns the filtered
 * array.
 *
 * Internally, this just calls `Array.filter`.
 */
function filter(array, func) {
    return array.filter(func);
}
exports.filter = filter;
/**
 * Helper function for non-TypeScript users to find an element in an array.
 *
 * Internally, this just calls `Array.find`.
 */
function find(array, func) {
    return array.find(func);
}
exports.find = find;
/**
 * Helper function for non-TypeScript users to iterate over an array.
 *
 * Internally, this just calls `Array.forEach`.
 */
function forEach(array, func) {
    array.forEach(func); // eslint-disable-line unicorn/no-array-for-each
}
exports.forEach = forEach;
// `includes` is not included since there is a normal array helper function of that name.
/**
 * Helper function for non-TypeScript users to convert an array to a string with the specified
 * separator.
 *
 * Internally, this just calls `Array.join`.
 */
function join(array, separator) {
    return array.join(separator);
}
exports.join = join;
/**
 * Helper function for non-TypeScript users to convert all of the elements in an array to something
 * else.
 *
 * Internally, this just calls `Array.map`.
 */
function map(array, func) {
    return array.map(func);
}
exports.map = map;
/**
 * Helper function for non-TypeScript users to check if one or more elements in the array is equal
 * to a condition.
 *
 * Internally, this just calls `Array.some`.
 */
function some(array, func) {
    return array.some(func);
}
exports.some = some;
