"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const curry_1 = require("@arrows/composition/curry");
const _setSize_ = (size, arr) => {
    return size <= arr.length
        ? arr.slice(0, size)
        : arr.slice(0).concat(Array.from({ length: size - arr.length }));
};
/**
 * Creates a new array trimmed/extended to a provided size.
 * If the new array is longer than the initial one,
 * additional indexes will be set to undefined.
 *
 * @param size Required size
 * @param arr Initial array
 * @returns New array
 */
const setSize_ = curry_1.default(_setSize_);
exports.setSize_ = setSize_;
exports.default = setSize_;
