MCPcopy Create free account
hub / github.com/CodeForBreakfast/eventsourcing / writeBlockFile

Function writeBlockFile

scripts/validate-markdown-examples.ts:329–341  ·  view source on GitHub ↗
(tempDir: string)

Source from the content-addressed store, hash-verified

327
328const writeBlockFile =
329 (tempDir: string) =>
330 (
331 block: CodeBlock,
332 index: number
333 ): Effect.Effect<BlockFile, Error, FileSystem.FileSystem | Path.Path> => {
334 const headerLines = 0;
335 const filename = `example-${index + 1}.ts`;
336
337 return pipe(
338 joinPath(tempDir, filename),
339 Effect.flatMap(writeBlockFileContent(block.code, filename, block, headerLines))
340 );
341 };
342
343const writeAllBlockFiles = (
344 blocks: readonly CodeBlock[],

Callers 1

writeAllBlockFilesFunction · 0.85

Calls 2

joinPathFunction · 0.85
writeBlockFileContentFunction · 0.85

Tested by

no test coverage detected