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

feat(orm): exclude function properties from FieldName type #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Char2sGu
Copy link
Contributor

Summary of changes

Exclude function properties from FieldName type.

Relinquishment of Rights

Please mark following checkbox to confirm that you relinquish all rights of your changes:

  • I waive and relinquish all rights regarding this changes (including code, text, and images) to Deepkit UG (limited), Germany. This changes (including code, text, and images) are under MIT license without name attribution, copyright notice, and permission notice requirement.

@Char2sGu
Copy link
Contributor Author

Types will not be computed when its argument is another generic type argument, thus we might have to use many type assertions in our code, which destroys the user experience:

function fn<Entity extends { username: string }>() {
  const field: FieldName<Entity> = "username"; // this throws a type error unless we use `as FieldName<Entity>`
}

Therefore this PR cannot be merged for now, except we find a solution some day.

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

1 participant