const { text_encoder_new, text_encoder_encode } = Deno.core.ops;
class TextEncoder {
#handle;
constructor() {
this.#handle = text_encoder_new();
}
encode(input) {
return text_encoder_encode(this.#handle, String(input));
}
}
globalThis.TextEncoder = TextEncoder;