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

Function checkParentDir

lib/internal/fs/cp/cp.js:140–146  ·  view source on GitHub ↗
(destStat, src, dest, opts)

Source from the content-addressed store, hash-verified

138}
139
140async function checkParentDir(destStat, src, dest, opts) {
141 const destParent = dirname(dest);
142 const dirExists = await pathExists(destParent);
143 if (dirExists) return getStatsForCopy(destStat, src, dest, opts);
144 await mkdir(destParent, { recursive: true });
145 return getStatsForCopy(destStat, src, dest, opts);
146}
147
148function pathExists(dest) {
149 return PromisePrototypeThen(

Callers 1

cpFnFunction · 0.85

Calls 4

dirnameFunction · 0.85
pathExistsFunction · 0.85
getStatsForCopyFunction · 0.85
mkdirFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…