MCPcopy Create free account
hub / github.com/nodejs/node / isSrcSubdir

Function isSrcSubdir

lib/internal/fs/cp/cp.js:189–193  ·  view source on GitHub ↗
(src, dest)

Source from the content-addressed store, hash-verified

187// Return true if dest is a subdir of src, otherwise false.
188// It only checks the path strings.
189function isSrcSubdir(src, dest) {
190 const srcArr = normalizePathToArray(src);
191 const destArr = normalizePathToArray(dest);
192 return ArrayPrototypeEvery(srcArr, (cur, i) => destArr[i] === cur);
193}
194
195async function getStatsForCopy(destStat, src, dest, opts) {
196 const statFn = opts.dereference ? stat : lstat;

Callers 3

checkPathsFunction · 0.85
onLinkFunction · 0.85
onLinkFunction · 0.85

Calls 1

normalizePathToArrayFunction · 0.85

Tested by

no test coverage detected