Skip to content

Commit

Permalink
chore(core): Addressing PR feedback adding Elvis chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
fguitton committed May 3, 2022
1 parent 9fe94d0 commit 9dafbd4
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions packages/nx/src/utils/project-graph-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ export function projectHasTarget(
project: ProjectGraphProjectNode,
target: string
) {
return !!(
project.data &&
project.data.targets &&
project.data.targets[target]
);
return !!project?.data?.targets?.[target];
}

export function projectHasTargetAndConfiguration(
Expand All @@ -24,17 +20,12 @@ export function projectHasTargetAndConfiguration(
) {
return (
projectHasTarget(project, target) &&
project.data.targets[target].configurations &&
project.data.targets[target].configurations[configuration]
project.data.targets[target].configurations?.[configuration]
);
}

export function projectHasTag(project: ProjectGraphProjectNode, tag: string) {
return !!(
project.data &&
project.data.tags &&
project.data.tags.includes(tag)
);
return !!project?.data?.tags?.includes(tag);
}

export function mergeNpmScriptsWithTargets(
Expand Down

0 comments on commit 9dafbd4

Please sign in to comment.