MCPcopy Index your code
hub / github.com/angular/angular-cli / isInside

Function isInside

packages/angular/cli/src/utilities/config.ts:264–273  ·  view source on GitHub ↗
(base: string, potential: string)

Source from the content-addressed store, hash-verified

262
263function findProjectByPath(workspace: AngularWorkspace, location: string): string | null {
264 const isInside = (base: string, potential: string): boolean => {
265 const absoluteBase = path.resolve(workspace.basePath, base);
266 const absolutePotential = path.resolve(workspace.basePath, potential);
267 const relativePotential = path.relative(absoluteBase, absolutePotential);
268 if (!relativePotential.startsWith('..') && !path.isAbsolute(relativePotential)) {
269 return true;
270 }
271
272 return false;
273 };
274
275 const projects = Array.from(workspace.projects)
276 .map(([name, project]) => [project.root, name] as [string, string])

Callers 1

findProjectByPathFunction · 0.85

Calls 1

resolveMethod · 0.80

Tested by

no test coverage detected