"use strict";
/*
 * @poppinss/file-generator
 *
 * (c) Poppinss
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateXlsx = void 0;
const path_1 = require("path");
const crypto_1 = require("crypto");
const promises_1 = require("fs/promises");
const generate_1 = require("../generate");
/**
 * Generates a fake xlxs file for the given file size.
 *
 * @example
 * generate(1000 * 1000 * 2) // Generates a 2mb file
 */
async function generateXlsx(fileSize, fileName) {
    const mime = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
    const name = fileName || `${(0, crypto_1.randomUUID)()}.xlsx`;
    const contents = (0, generate_1.generate)(fileSize, await (0, promises_1.readFile)((0, path_1.join)(__dirname, './fake.xlsx')));
    return { contents, mime, size: contents.length, name };
}
exports.generateXlsx = generateXlsx;
