Files
flatbuffers/ts/flexbuffers/flexbuffers-util.ts
Björn Harrtell b46db38f57 [JS/TS] Rewrite flexbuffers JS to TS (#6148)
* Partial TS rewrite

* Completed port but bugs remain

* Expose builder function

* Break out and fix stack-value and formatting
2020-10-19 13:11:35 -07:00

9 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);
}