Leon4gr45's picture
Include updated package-lock.json (part 12)
391a73c verified
Raw
History Blame Contribute Delete
281 Bytes
import { toUint8Array } from "../bytes/index.js";
export function encode(text) {
return new TextEncoder().encode(text);
}
export function decode(data) {
return new TextDecoder("utf-8", { fatal: false }).decode(toUint8Array(data));
}
export const utf8 = { encode, decode };