MCPcopy Index your code
hub / github.com/nodejs/node / writeFileEnsuringDirectories

Function writeFileEnsuringDirectories

test/fixtures/snapshot/typescript.js:18520–18530  ·  view source on GitHub ↗
(path, data, writeByteOrderMark, writeFile, createDirectory, directoryExists)

Source from the content-addressed store, hash-verified

18518 }
18519 }
18520 function writeFileEnsuringDirectories(path, data, writeByteOrderMark, writeFile, createDirectory, directoryExists) {
18521 // PERF: Checking for directory existence is expensive. Instead, assume the directory exists
18522 // and fall back to creating it if the file write fails.
18523 try {
18524 writeFile(path, data, writeByteOrderMark);
18525 }
18526 catch (_a) {
18527 ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(path)), createDirectory, directoryExists);
18528 writeFile(path, data, writeByteOrderMark);
18529 }
18530 }
18531 ts.writeFileEnsuringDirectories = writeFileEnsuringDirectories;
18532 function getLineOfLocalPosition(sourceFile, pos) {
18533 var lineStarts = ts.getLineStarts(sourceFile);

Callers

nothing calls this directly

Calls 2

ensureDirectoriesExistFunction · 0.85
writeFileFunction · 0.70

Tested by

no test coverage detected