Skip to content

fix(types): adds 'hooks' to CreateOptions#11736

Merged
papb merged 6 commits into
sequelize:masterfrom
eratio08:master
Jan 21, 2020
Merged

fix(types): adds 'hooks' to CreateOptions#11736
papb merged 6 commits into
sequelize:masterfrom
eratio08:master

Conversation

@eratio08

@eratio08 eratio08 commented Dec 10, 2019

Copy link
Copy Markdown
Contributor

Pull Request check-list

Please make sure to review and check all of these items:

  • Does npm run test or npm run test-DIALECT pass with this change (including linting)?
  • Does the description below contain a link to an existing issue (Closes #[issue]) or a description of the issue you are solving?
  • Have you added new tests to prevent regressions?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
  • Did you update the typescript typings accordingly (if applicable)?
  • Did you follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Adds the missing hooks field to the CreateOptions type mentioned here https://sequelize.org/v5/class/lib/model.js~Model.html#static-method-create

@codecov

codecov Bot commented Dec 10, 2019

Copy link
Copy Markdown

Codecov Report

Merging #11736 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master   #11736   +/-   ##
=======================================
  Coverage   96.27%   96.27%           
=======================================
  Files          94       94           
  Lines        9203     9203           
=======================================
  Hits         8860     8860           
  Misses        343      343
Impacted Files Coverage Δ
lib/dialects/postgres/connection-manager.js 95.77% <ø> (ø) ⬆️
lib/model.js 96.54% <100%> (ø) ⬆️
lib/dialects/mariadb/data-types.js 100% <100%> (ø) ⬆️
lib/dialects/postgres/data-types.js 96.26% <100%> (ø) ⬆️
lib/query-interface.js 92.19% <100%> (ø) ⬆️
lib/dialects/mysql/data-types.js 98.43% <100%> (ø) ⬆️
lib/dialects/abstract/query-generator.js 97.02% <100%> (ø) ⬆️
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 669cae4...02f3db3. Read the comment docs.

@sushantdhiman sushantdhiman added the typescript For issues and PRs. Things that involve typescript, such as typings and intellisense. label Dec 12, 2019

@SimonSchick SimonSchick left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you instead move the hooks property to a separate interface and let everything that supports the hooks property inherit from it, much cleaner than even more copy/paste.

image

@eratio08
eratio08 requested a review from SimonSchick December 12, 2019 15:59

@papb papb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, just one request: please rename this HookOptions interface you created to Hookable, makes more sense to me and adheres to the style of other similar interfaces.

@papb
papb dismissed SimonSchick’s stale review January 16, 2020 05:15

Dismissing this review since this request was already addressed

@papb papb added the status: awaiting response For issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action label Jan 16, 2020
@eratio08
eratio08 requested a review from papb January 21, 2020 20:12
@papb
papb merged commit ba9a2f6 into sequelize:master Jan 21, 2020
@papb

papb commented Jan 21, 2020

Copy link
Copy Markdown
Member

@eratio08 Thank you very much 😬

@papb papb removed the status: awaiting response For issues and PRs. OP must respond (or change something, if it is a PR). Maintainers have no action label Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

typescript For issues and PRs. Things that involve typescript, such as typings and intellisense.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants