summaryrefslogtreecommitdiff
path: root/os.ts
diff options
context:
space:
mode:
Diffstat (limited to 'os.ts')
-rw-r--r--os.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/os.ts b/os.ts
index 3d3639dc3..82baac25d 100644
--- a/os.ts
+++ b/os.ts
@@ -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();