MCPcopy
hub / github.com/firecow/gitlab-ci-local / isSubpath

Method isSubpath

src/utils.ts:372–378  ·  view source on GitHub ↗
(lhs: string, rhs: string, cwd: string = process.cwd())

Source from the content-addressed store, hash-verified

370 }
371
372 static isSubpath (lhs: string, rhs: string, cwd: string = process.cwd()) {
373 const absLhs = path.isAbsolute(lhs) ? lhs : path.resolve(cwd, lhs);
374 const absRhs = path.isAbsolute(rhs) ? rhs : path.resolve(cwd, rhs);
375
376 const relative = path.relative(absRhs, absLhs);
377 return !relative.startsWith("..");
378 }
379
380 static async rsyncTrackedFiles (cwd: string, stateDir: string, target: string): Promise<{hrdeltatime: [number, number]}> {
381 const time = process.hrtime();

Callers 2

copyCacheOutMethod · 0.80
utils.test.tsFile · 0.80

Calls 1

cwdMethod · 0.80

Tested by

no test coverage detected