MCPcopy
hub / github.com/angular/angular-cli / updateTsConfig

Function updateTsConfig

packages/schematics/angular/library/index.ts:45–56  ·  view source on GitHub ↗
(packageName: string, ...paths: string[])

Source from the content-addressed store, hash-verified

43];
44
45function updateTsConfig(packageName: string, ...paths: string[]) {
46 return (host: Tree) => {
47 if (!host.exists('tsconfig.json')) {
48 return host;
49 }
50
51 const file = new JSONFile(host, 'tsconfig.json');
52 const jsonPath = ['compilerOptions', 'paths', packageName];
53 const value = file.get(jsonPath);
54 file.modify(jsonPath, Array.isArray(value) ? [...value, ...paths] : paths);
55 };
56}
57
58function addTsProjectReference(...paths: string[]) {
59 return (host: Tree) => {

Callers 1

index.tsFile · 0.70

Calls 3

getMethod · 0.95
modifyMethod · 0.95
existsMethod · 0.65

Tested by

no test coverage detected