"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decompress = exports.compress = void 0;
const tslib_1 = require("tslib");
const util_1 = require("util");
const zlib_1 = tslib_1.__importDefault(require("zlib"));
const brotliCompress = (0, util_1.promisify)(zlib_1.default.brotliCompress);
const brotliDecompress = (0, util_1.promisify)(zlib_1.default.brotliDecompress);
async function compress(input) {
    const buf = await brotliCompress(input);
    return buf.toString('base64');
}
exports.compress = compress;
async function decompress(input) {
    const buf = Buffer.from(input, 'base64');
    const str = await brotliDecompress(buf);
    return str.toString('utf8');
}
exports.decompress = decompress;
//# sourceMappingURL=compress.js.map