diff options
Diffstat (limited to 'os.ts')
-rw-r--r-- | os.ts | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -1,5 +1,6 @@ import { main as pb } from "./msg.pb"; -import { TypedArray, ModuleInfo } from "./types"; +import { ModuleInfo } from "./types"; +import { typedArrayToArrayBuffer } from "./util"; export function exit(code = 0): void { sendMsgFromObject({ @@ -28,11 +29,6 @@ export function sourceCodeCache( throwOnError(res); } -function typedArrayToArrayBuffer(ta: TypedArray): ArrayBuffer { - const ab = ta.buffer.slice(ta.byteOffset, ta.byteOffset + ta.byteLength); - return ab as ArrayBuffer; -} - export function sendMsgFromObject(obj: pb.IMsg): null | pb.Msg { const msg = pb.Msg.fromObject(obj); const ui8 = pb.Msg.encode(msg).finish(); |