mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-01 19:58:15 +00:00
10 lines
255 B
TypeScript
10 lines
255 B
TypeScript
export function fromUTF8Array(data: BufferSource): string {
|
|
const decoder = new TextDecoder();
|
|
return decoder.decode(data);
|
|
}
|
|
|
|
export function toUTF8Array(str: string): Uint8Array {
|
|
const encoder = new TextEncoder();
|
|
return encoder.encode(str);
|
|
}
|