-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sc 30945/client dmi partners inc pulled an export #130
Sc 30945/client dmi partners inc pulled an export #130
Conversation
Codecov Report
@@ Coverage Diff @@
## master #130 +/- ##
==========================================
+ Coverage 97.04% 97.09% +0.05%
==========================================
Files 34 34
Lines 576 586 +10
==========================================
+ Hits 559 569 +10
Misses 17 17
Continue to review full report at Codecov.
|
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.
Looks like this covers masking rich types in general, but it seems like this still isn't handling the case where the masked property itself is a rich type. It is supposed to look at its boolean value to determine whether to mask or not.
lib/index.js
Outdated
@@ -55,9 +55,15 @@ const mask = function (obj, doMask = false) { | |||
for (const key in obj) { | |||
const value = obj[key]; | |||
if (key === 'valid') { continue; } | |||
obj[key] = mask(value, (obj.masked != null) || doMask); | |||
obj[key] = mask(value, (obj.masked != null || obj.masked !== undefined) || doMask); |
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.
I'm confused by this - if obj.masked
is an object, won't it always return true and therefore mask despite what the masked value is set to in that object?
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.
I see what you mean. I'll update to cover when the obj.masked
is a rich type.
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.
Yes.
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.
Provided the assertions in the tests are correct (I don't understand the business logic behind what's masked and what isn't), LGTM
Description of the change
Type of change
Related tickets
Checklists
Development and Testing
Code Review
Tracking
QA