"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toArray = toArray;
exports.asyncMap = asyncMap;
exports.unique = unique;
exports.chunk = chunk;
function toArray(value) {
    return Array.isArray(value) ? value : [value];
}
async function asyncMap(items, callback) {
    const result = [];
    for (let i = 0; i < items.length; i++)
        result.push(await callback(items[i], i));
    return result;
}
function unique(items) {
    return [...new Set(items)];
}
function chunk(items, size) {
    if (size <= 0)
        throw new Error('chunk size must be greater than zero');
    const result = [];
    for (let i = 0; i < items.length; i += size)
        result.push(items.slice(i, i + size));
    return result;
}
//# sourceMappingURL=array.js.map