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 26, 2022
1 parent 6d4e15a commit 3295a75
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 3295a75

Please sign in to comment.