Skip to content
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

feat(types): handle Numbers passed as Objects #10492

Merged
merged 1 commit into from Mar 2, 2019

Conversation

2 participants
@gabegorelick
Copy link
Contributor

gabegorelick commented Mar 2, 2019

This adds support for Number types that aren't represented as actual Javascript Number instances. For example, BigInt (new in Node 10), Decimal.js, etc. Anything with a .toString should work.

Fixes #10491

Pull Request check-list

  • 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 follow the commit message conventions explained in CONTRIBUTING.md?

Description of change

Fixes #10491

feat(types): handle Numbers passed as Objects
This adds support for Number types that aren't represented as
actual Javascript Number instances. For example, BigInt (new in
Node 10), Decimal.js, etc.

Fixes #10491
@@ -53,6 +53,7 @@
"@types/bluebird": "^3.5.26",
"@types/node": "^10.12.27",
"@types/validator": "^10.9.0",
"big-integer": "^1.6.42",

This comment has been minimized.

@gabegorelick
@codecov

This comment has been minimized.

Copy link

codecov bot commented Mar 2, 2019

Codecov Report

Merging #10492 into master will increase coverage by 3.14%.
The diff coverage is 83.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10492      +/-   ##
==========================================
+ Coverage   93.01%   96.15%   +3.14%     
==========================================
  Files          91       92       +1     
  Lines        9261     9501     +240     
==========================================
+ Hits         8614     9136     +522     
+ Misses        647      365     -282
Impacted Files Coverage Δ
lib/data-types.js 94.38% <83.33%> (-0.16%) ⬇️
lib/dialects/sqlite/query.js 98.71% <0%> (ø)
lib/dialects/abstract/query-generator.js 97.57% <0%> (+0.71%) ⬆️
lib/dialects/postgres/connection-manager.js 94.61% <0%> (+0.76%) ⬆️
lib/dialects/abstract/query.js 90.45% <0%> (+1.06%) ⬆️
lib/transaction.js 100% <0%> (+2.73%) ⬆️
lib/query-interface.js 91.89% <0%> (+3.43%) ⬆️
lib/dialects/sqlite/query-interface.js 100% <0%> (+84.37%) ⬆️
lib/dialects/sqlite/query-generator.js 96.34% <0%> (+93.15%) ⬆️

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 5cdd3bf...183646a. Read the comment docs.

@sushantdhiman sushantdhiman merged commit 5adaf10 into sequelize:master Mar 2, 2019

3 of 4 checks passed

codecov/patch 83.33% of diff hit (target 93.01%)
Details
codecov/project 96.15% (+3.14%) compared to 5cdd3bf
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

gabegorelick added a commit to gabegorelick/sequelize that referenced this pull request Mar 2, 2019

feat(types): handle Numbers passed as Objects
This adds support for Number types that aren't represented as
actual Javascript Number instances. For example, BigInt (new in
Node 10), Decimal.js, etc.

Backports sequelize#10492 to v4

@gabegorelick gabegorelick referenced this pull request Mar 2, 2019

Merged

Backport Number serialization to v4 #10496

4 of 5 tasks complete

@gabegorelick gabegorelick deleted the gabegorelick:number-serialization branch Mar 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.