MCPcopy Create free account
hub / github.com/vercel/vercel / isSubpath

Function isSubpath

packages/python-analysis/src/util/fs.ts:61–64  ·  view source on GitHub ↗
(somePath: Path, parentPath: Path)

Source from the content-addressed store, hash-verified

59 * isSubpath('/a/x', '/a/b') // false - x is not under b
60 */
61export function isSubpath(somePath: Path, parentPath: Path): boolean {
62 const rel = path.relative(parentPath, somePath);
63 return rel === '' || (!rel.startsWith('..') && !path.isAbsolute(rel));
64}

Callers 1

discoverPythonPackageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected