MCPcopy Create free account
hub / github.com/donghaxkim/react-rewrite / isWithinProjectRoot

Function isWithinProjectRoot

packages/cli/src/path-resolver.ts:4–6  ·  view source on GitHub ↗
(resolvedPath: string, projectRoot: string)

Source from the content-addressed store, hash-verified

2import * as path from "node:path";
3
4function isWithinProjectRoot(resolvedPath: string, projectRoot: string): boolean {
5 return resolvedPath === projectRoot || resolvedPath.startsWith(projectRoot + path.sep);
6}
7
8/**
9 * Canonicalize an incoming file path from the overlay into an absolute path

Callers 1

resolveProjectFilePathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected