1
0
silverbullet/plugos/syscalls/sandbox.ts
Zef Hemel 561aa6891f
Migrate to Deno (#86)
Big bang migration to Deno 🤯
2022-10-10 14:50:21 +02:00

16 lines
482 B
TypeScript

import { LogEntry } from "../sandbox.ts";
import { SysCallMapping, System } from "../system.ts";
export default function sandboxSyscalls(system: System<any>): SysCallMapping {
return {
"sandbox.getLogs": (): LogEntry[] => {
let allLogs: LogEntry[] = [];
for (const plug of system.loadedPlugs.values()) {
allLogs = allLogs.concat(plug.sandbox.logBuffer);
}
allLogs = allLogs.sort((a, b) => a.date - b.date);
return allLogs;
},
};
}