Repository navigation
feat(types): make Model.getAttributes stricter - #14017
Conversation
Model.getAttributes stricter
|
EDIT2: My phone didn't show that this was already in the v6 project so nevermind that. The expiring TODO is still nice to add EDIT: in any case, this is a nice usage for expiring TODOs |
|
I don't think we'll remove it in v7 because I think it's widely used. Maybe v8 |
|
Hm, a bit biased but the script I made (which I've yet to adapt for general sequelize usage) uses I'd also be hesitant to touch |
|
Edit: I've reworded this comment because my previous iteration was a bit hard to read I don't think this PR would interfere with your script, you can still override This would bring typings closer to reality for users that are not using your script, while still letting your script provide even stronger types. Regarding first typing
I don't think we'll be able to make TS infer everything. I mean we could, using even more Branded Types, but it'd be verbose. I'm not against it at all, but baby steps. |
|
I think I like it :) |
|
🎉 This PR is included in version 7.0.0-alpha.7 🎉 The release is available on: Your semantic-release bot 📦🚀 |

Pull Request Checklist
npm run testornpm run test-DIALECTpass with this change (including linting)?Description Of Change
Follow up to #13728
The typings for
Model.getAttributesnow declare returning an object where the keys are the attributes declared on the model.This PR deprecates
Model.rawAttributes& recommends usingModel.getAttributesinstead. I've done this because we cannot strictly typerawAttributes.