Skip to content

Commit dcefcd5

Browse files
committed
refactor: improved naming
1 parent 7b7ce94 commit dcefcd5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/merge/src/typedefs-mergers/directives.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ const getLinkDirectiveURL = (directive: DirectiveNode): string | undefined => {
1818
};
1919

2020
/**
21-
* Directives by default do not carry distinctual metadata, thus are not
22-
* considered distinct by default by this function. However @link directives are
23-
* only considered distinct if they have different URLs.
21+
* Directives by default do not carry arguments that make them distinct, thus
22+
* are not considered distinct by default by this function. However @link
23+
* directives are only considered distinct if they have different URLs.
2424
*/
25-
const isDirectiveMetadataDistinct = (directiveA: DirectiveNode, directiveB: DirectiveNode) => {
25+
const isDirectiveDistinctByArguments = (directiveA: DirectiveNode, directiveB: DirectiveNode) => {
2626
const isLinkPair = isLinkDirective(directiveA) && isLinkDirective(directiveB);
2727
return isLinkPair ? getLinkDirectiveURL(directiveA) !== getLinkDirectiveURL(directiveB) : false;
2828
};
@@ -35,7 +35,7 @@ function directiveAlreadyExists(
3535
): boolean {
3636
return !!directivesArr.find(directive => {
3737
const isDirectiveNameMatching = directive.name.value === otherDirective.name.value;
38-
return isDirectiveNameMatching && !isDirectiveMetadataDistinct(directive, otherDirective);
38+
return isDirectiveNameMatching && !isDirectiveDistinctByArguments(directive, otherDirective);
3939
});
4040
}
4141

0 commit comments

Comments
 (0)