Skip to content

Commit

Permalink
bug(web): fix connection annotations
Browse files Browse the repository at this point in the history
We weren't parsing connection annotations correctly (we had all the
logic, we just weren't calling it.)

This fixes that.

Signed-off-by: Adam Jacob <[email protected]>
  • Loading branch information
adamhjk committed Jun 25, 2024
1 parent 51a2857 commit 42e47ca
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/ts-lib/src/connection-annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ export function connectionAnnotationFitsReference(
{ tokens: targetCa }: ConnectionAnnotation,
{ tokens: referenceCa }: ConnectionAnnotation,
) {
// If the length is longer than 1, we assume you have already parsed the
// connection annotations. Otherwise, we need to parse them.
if (targetCa.length === 1) {
// @ts-ignore
targetCa = parseConnectionAnnotation(targetCa[0]);
}
if (referenceCa.length === 1) {
// @ts-ignore
referenceCa = parseConnectionAnnotation(referenceCa[0]);
}
// a fitting target annotation is either the same as the reference one or a supertype thereof
const lowerTargetCa = _.map(targetCa, (a) => a.toLowerCase());
const lowerReferenceCa = _.map(referenceCa, (a) => a.toLowerCase());
Expand Down

0 comments on commit 42e47ca

Please sign in to comment.