Skip to content

Commit 7b7ce94

Browse files
committed
fix: distinct check
1 parent 97f0421 commit 7b7ce94

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

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

2020
/**
21-
* Directives are considered distinct if they have different names, or, if they
22-
* are link directives with different URLs.
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.
2324
*/
2425
const isDirectiveMetadataDistinct = (directiveA: DirectiveNode, directiveB: DirectiveNode) => {
2526
const isLinkPair = isLinkDirective(directiveA) && isLinkDirective(directiveB);
26-
return isLinkPair ? getLinkDirectiveURL(directiveA) !== getLinkDirectiveURL(directiveB) : true;
27+
return isLinkPair ? getLinkDirectiveURL(directiveA) !== getLinkDirectiveURL(directiveB) : false;
2728
};
2829

2930
const isMatchingDirective = (a: DirectiveNode, b: DirectiveNode) => a.name.value === b.name.value;

0 commit comments

Comments
 (0)