Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix set impl function body ending up in declaration files #320

Merged
merged 1 commit into from
Mar 30, 2022

Conversation

Sikarii
Copy link
Contributor

@Sikarii Sikarii commented Mar 30, 2022

The code generation for CJS and ESM generates invalid syntax for declaration files.

// dbschema/edgeql-js/syntax/setImpl.d.ts

declare function set<Expr extends TypeSet<BaseType> | castMaps.scalarLiterals>(
  ...exprs: Expr[]
): $expr_Set<
  TypeSet<
    getPrimitiveBaseType<castMaps.literalToTypeSet<Expr>["__element__"]>,
    Cardinality.Many
  >
>;
)
      .reduce(getSharedParent),
    __cardinality__: cardinalityUtil.mergeCardinalitiesVariadic(
      exprs.map(expr => expr.__cardinality__)
    ),
    __exprs__: exprs,
  });

}

This PR should fix the function body ending up in the declaration file.

@colinhacks colinhacks merged commit 019ba25 into edgedb:master Mar 30, 2022
@Sikarii Sikarii deleted the fix-set-impl-dts branch March 30, 2022 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants