Plug format now changed to YAML

This commit is contained in:
Zef Hemel
2022-03-27 11:26:13 +02:00
parent a382ab3baa
commit 621e55dbcf
20 changed files with 225 additions and 254 deletions
+10
View File
@@ -0,0 +1,10 @@
import { SysCallMapping } from "../system";
import { EventFeature } from "../feature/event";
export function eventSyscalls(eventFeature: EventFeature): SysCallMapping {
return {
async dispatch(ctx, eventName: string, data: any) {
return eventFeature.dispatchEvent(eventName, data);
},
};
}
+2 -2
View File
@@ -3,11 +3,11 @@ import { SysCallMapping } from "../system";
export function fetchSyscalls(): SysCallMapping {
return {
async fetchJson(ctx, url: RequestInfo, init: RequestInit) {
async json(ctx, url: RequestInfo, init: RequestInit) {
let resp = await fetch(url, init);
return resp.json();
},
async fetchText(ctx, url: RequestInfo, init: RequestInit) {
async text(ctx, url: RequestInfo, init: RequestInit) {
let resp = await fetch(url, init);
return resp.text();
},
@@ -12,7 +12,6 @@ test("Test store", async () => {
let plug = await system.load(
"test",
{
hooks: {},
functions: {
test1: {
code: `(() => {
-1
View File
@@ -28,7 +28,6 @@ test("Test store", async () => {
let plug = await system.load(
"test",
{
hooks: {},
functions: {
test1: {
code: `(() => {