MCPcopy Create free account
hub / github.com/Tele-AI/doc-ops-mcp / writeFileWithEncoding

Function writeFileWithEncoding

src/index.ts:493–499  ·  view source on GitHub ↗
(finalPath: string, content: string, encoding: string)

Source from the content-addressed store, hash-verified

491}
492
493async function writeFileWithEncoding(finalPath: string, content: string, encoding: string) {
494 // 验证路径安全性(已移除路径限制)
495 const validatedPath = validatePath(finalPath);
496
497 await fs.mkdir(path.dirname(validatedPath), { recursive: true });
498 await fs.writeFile(validatedPath, content, encoding);
499}
500
501// Write document function
502async function writeDocument(

Callers 1

writeDocumentFunction · 0.85

Calls 1

validatePathFunction · 0.70

Tested by

no test coverage detected