MCPcopy Create free account
hub / github.com/angular/components / getProjectFromWorkspace

Function getProjectFromWorkspace

src/cdk/schematics/utils/get-project.ts:16–33  ·  view source on GitHub ↗
(
  workspace: WorkspaceDefinition,
  projectName: string | undefined,
)

Source from the content-addressed store, hash-verified

14 * couldn't be found.
15 */
16export function getProjectFromWorkspace(
17 workspace: WorkspaceDefinition,
18 projectName: string | undefined,
19): ProjectDefinition {
20 if (!projectName) {
21 // TODO(crisbeto): some schematics APIs have the project name as optional so for now it's
22 // simpler to allow undefined and checking it at runtime. Eventually we should clean this up.
23 throw new SchematicsException('Project name is required.');
24 }
25
26 const project = workspace.projects.get(projectName);
27
28 if (!project) {
29 throw new SchematicsException(`Could not find project in workspace: ${projectName}`);
30 }
31
32 return project;
33}

Callers 7

setup-project.tsFile · 0.90
index.spec.tsFile · 0.90
insertThemeFunction · 0.90
addThemeStyleToTargetFunction · 0.90
addFontsToIndexFunction · 0.90
isStandaloneSchematicFunction · 0.90
buildComponentFunction · 0.90

Calls 1

getMethod · 0.65

Tested by

no test coverage detected