MCPcopy Create free account
hub / github.com/cloudflare/computer / materialize

Function materialize

packages/dofs/src/fs/writeFile.ts:74–79  ·  view source on GitHub ↗
(content: string | Uint8Array)

Source from the content-addressed store, hash-verified

72}
73
74async function materialize(content: string | Uint8Array): Promise<Uint8Array> {
75 if (typeof content === "string") {
76 return new TextEncoder().encode(content);
77 }
78 return content;
79}
80
81// sha256 with a synchronous code path so writeFile can be called both
82// from async drivers (the FS API) and from sync drivers (the

Callers 1

writeFileFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected