fix(types): adds missing function signature to Model.prototype.previous() types#13042
Conversation
|
The type |
|
@Keimeno good call, I will update the PR with |
Co-authored-by: john gravois <jagravois@gmail.com>
…12811 sequelize#12655) Co-authored-by: sliterok <korobatov2011@yandex.ru> Co-authored-by: William Gurzoni <william_luizat@hotmail.com>
* test(mysql, mariadb): improve transaction tests - Greatly improve test for `SELECT ... LOCK IN SHARE MODE` - Greatly improve test for deadlock handling * fix(mysql): release connection on deadlocks This is a follow-up for a problem not covered by sequelize#12841. * refactor(mariadb): `query.js` similar to mysql's * Update comments with a reference to this PR
|
Hello! Thanks for the PR. I see a lot of formatting changes here though, such as newlines and changing single-quotes to double-quotes, maybe you have prettier enabled or something, can you undo those and focus your PR on the exact intended change please? |
|
@danielschwartz happened to me all the time as well 😃. A hacky fix that I'm using:
"pathSettings.rules": [
{
"path": "sequelize",
"settings": {
"editor.formatOnSave": false,
}
}
]This automatically disables the |
|
We need to tag @papb for that, this PR was probably overlooked. It's good if you additionally add typing tests with expect-type, but that can also be done in a separate PR. |
|
Hello! I am sorry for the delay. Can you please fix the conflict and add a test? For good examples on how to test typescript typings, check the following PRs: #11368 #11379 #11520. As @Keimeno said, you can also use expect-type if you need more complex assertions. |
|
@papb this should be good to go. I've fixed the merge conflict caused by the latest release and also added a test. Let me know if you need anything else to get this merged in. |
|
🎉 This PR is included in version 6.6.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request check-list
Please make sure to review and check all of these items:
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
In the type definition for
previous()on a model instance, the only specified signature is for when you pass in an argument to get a specific properties previous value. However, Sequelize will let you callprevious()with no arguments and get an object back that maps all changed properties to their previous values. This PR adds that additional function signature to the type definitions so you can useprevious()that way as well.