Skip to content

Commit e8fa77e

Browse files
SchnWalterfilipesilva
authored andcommitted
refactor(@schematics/angular): use ProjectType string enum
1 parent 5154997 commit e8fa77e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/schematics/angular/utility/workspace.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
import { virtualFs, workspaces } from '@angular-devkit/core';
99
import { Rule, Tree } from '@angular-devkit/schematics';
10+
import { ProjectType } from './workspace-models';
1011

1112
function createHost(tree: Tree): workspaces.WorkspaceHost {
1213
return {
@@ -74,7 +75,7 @@ export async function getWorkspace(tree: Tree, path = '/') {
7475
*/
7576
export function buildDefaultPath(project: workspaces.ProjectDefinition): string {
7677
const root = project.sourceRoot ? `/${project.sourceRoot}/` : `/${project.root}/src/`;
77-
const projectDirName = project.extensions['projectType'] === 'application' ? 'app' : 'lib';
78+
const projectDirName = project.extensions['projectType'] === ProjectType.Application ? 'app' : 'lib';
7879

7980
return `${root}${projectDirName}`;
8081
}

0 commit comments

Comments
 (0)