"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TextEncoder = exports.packageInfo = void 0;
const tslib_1 = require("tslib");
const node_util_1 = tslib_1.__importDefault(require("node:util"));
const x_global_1 = require("@pezkuwi/x-global");
var packageInfo_js_1 = require("./packageInfo.js");
Object.defineProperty(exports, "packageInfo", { enumerable: true, get: function () { return packageInfo_js_1.packageInfo; } });
class Fallback {
    #encoder;
    constructor() {
        this.#encoder = new node_util_1.default.TextEncoder();
    }
    // For a Jest 26.0.1 environment, Buffer !== Uint8Array
    encode(value) {
        return Uint8Array.from(this.#encoder.encode(value));
    }
}
exports.TextEncoder = (0, x_global_1.extractGlobal)('TextEncoder', Fallback);
