-
Notifications
You must be signed in to change notification settings - Fork 282
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 typeof Model errors throughout by using typeof Model generics #868
Conversation
I forked your PR: https://github.com/node-casbin/sequelize-ts and ran the test with the following errors:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Node.js CI is failing, it should succeeds.
I'm not personally gonna spend anymore time on this. With the help from someone in Gitter I managed to produce this but then there were many more issues with it. At this point it's at the "WTF Typescript" stage that I have no clue what is going on. Someone else with more knowledge is going to have to take over |
@intellix Build is failing on formatting, run
With |
@KapitanOczywisty Could open a new PR, to fix this bug with the CI that succeeds, please ? |
Hopefully addresses #835
This is essentially me just applying it in the places that worked and then re-applying it throughout until typescript errors disappeared and it compiled/built.
It builds and all tests pass. When I include it in my own project I go from 457 errors to 107 and I don't see my original problems as in issue #835.
I'm still getting a problem with Includeable from Sequelize as it expects
typeof Model
. The new ModelType in this PR would fix it, but how do you patch existing types?For example:
Gives:
Feel free to take over, base your own work on this or throw it away entirely. I'm not attached to it :)