deepkit-framework
deepkit-framework copied to clipboard
feat(orm): exclude function properties from `FieldName` type
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:
- [x] 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.
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.