File size: 427 Bytes
391a73c
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.utf8 = void 0;
exports.encode = encode;
exports.decode = decode;
const index_js_1 = require("../bytes/index.js");
function encode(text) {
    return new TextEncoder().encode(text);
}
function decode(data) {
    return new TextDecoder("utf-8", { fatal: false }).decode((0, index_js_1.toUint8Array)(data));
}
exports.utf8 = { encode, decode };