MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / writeViewModule

Function writeViewModule

packages/node/src/__tests__/nodeAppHotReload.test.ts:36–48  ·  view source on GitHub ↗
(root: string, label: string)

Source from the content-addressed store, hash-verified

34}
35
36function writeViewModule(root: string, label: string): string {
37 mkdirSync(root, { recursive: true });
38 const file = join(root, "view.mjs");
39 writeFileSync(
40 file,
41 [
42 `export function view(state) { return { kind: "text", text: ${JSON.stringify(label)} + ":" + String(state.value), props: {} }; }`,
43 "",
44 ].join("\n"),
45 "utf8",
46 );
47 return file;
48}
49
50function writeRoutesModule(root: string, label: string): string {
51 mkdirSync(root, { recursive: true });

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected