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

Function glob

packages/angular/cli/src/commands/mcp/host.ts:352–368  ·  view source on GitHub ↗
(pattern: string, options: { cwd: string })

Source from the content-addressed store, hash-verified

350 return baseHost.readFile(path, encoding);
351 },
352 glob(pattern: string, options: { cwd: string }) {
353 if (pattern.includes('..')) {
354 throw new Error(
355 `Access denied: glob pattern '${pattern}' contains path traversal sequences.`,
356 );
357 }
358
359 checkPath(options.cwd);
360
361 const firstWildcardIndex = pattern.search(/[*?[{]/);
362 const basePath = firstWildcardIndex >= 0 ? pattern.substring(0, firstWildcardIndex) : pattern;
363
364 const targetDir = resolve(options.cwd, basePath);
365 checkPath(targetDir);
366
367 return baseHost.glob(pattern, options);
368 },
369 executeNgCommand(
370 args: readonly string[],
371 options: Parameters<Host['executeNgCommand']>[1] = {},

Callers 2

copyAssetsFunction · 0.85

Calls 3

checkPathFunction · 0.85
globMethod · 0.80
resolveFunction · 0.50

Tested by

no test coverage detected