MCPcopy Create free account
hub / github.com/Tencent/libpag / getDepth

Function getDepth

web/script/restore.replace.js:64–68  ·  view source on GitHub ↗
(filePath, rootDir)

Source from the content-addressed store, hash-verified

62}
63
64function getDepth(filePath, rootDir) {
65 const relative = path.relative(rootDir, path.dirname(filePath));
66 if (!relative) return 0;
67 return relative.split(path.sep).filter(Boolean).length;
68}
69
70function buildReplacementPath(depth) {
71 const prefix = '../'.repeat(depth + 2);

Callers 1

replacePathInFilesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected