-
Notifications
You must be signed in to change notification settings - Fork 578
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(util-dynamodb): add option to convert class instance to map #1969
Conversation
reason: binary is of type object and the check needs to be done before typeof object
This will marshall objects with typeof === "object" using convertToMapAttr
Codecov Report
@@ Coverage Diff @@
## master #1969 +/- ##
==========================================
+ Coverage 79.30% 79.83% +0.52%
==========================================
Files 368 368
Lines 15132 15553 +421
Branches 3222 3369 +147
==========================================
+ Hits 12001 12417 +416
- Misses 3131 3136 +5
Continue to review full report at Codecov.
|
Reason: we already convert null, binary, array, sets, pure JavaScript objects which also belong to Object.Prototype inheritance chain. This configuration converts other objects, aka different constructor.
efb97fa
to
87d236c
Compare
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.
🚢🚢 wow this closes a lot of issues!
Reason: converting undefined, null and binary attributes is already moved outside the function to support convertClassInstanceToMap configuration
Number(1) creates JavaScript primitive value, while new Number(1) creates the Number class instance
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Issue
Refs: #1647
Closes: #1535
Closes: #1865
Closes: #1534
Closes: #1861
Closes: #1102
Closes: #1534
Description
adds option to convert class instance to map in
@aws-sdk/util-dynamodb
Testing
Unit tests for marshall and convertToAttr functions
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.