mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-30 21:30:01 +00:00
[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:
9
ts/flexbuffers/flexbuffers-util.ts
Normal file
9
ts/flexbuffers/flexbuffers-util.ts
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user