[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
This commit is contained in:
Björn Harrtell
2020-10-19 22:11:35 +02:00
committed by GitHub
parent 9fa1d27059
commit b46db38f57
14 changed files with 1096 additions and 1057 deletions

View File

@@ -0,0 +1,9 @@
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);
}