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

PR fix: Add test for null attribute #66

Merged
merged 4 commits into from
Feb 27, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Feb 27, 2023

This adds on top of #65 and adds a test for this, as well as streamlining this check in the transformAttribute method.

@mydea mydea requested a review from Lms24 February 27, 2023 08:43
@mydea mydea self-assigned this Feb 27, 2023
@@ -242,32 +242,35 @@ export function transformAttribute(
maskAllText: boolean,
maskTextFn: MaskTextFn | undefined,
): string {
if (!value) {
Copy link
Member

@Lms24 Lms24 Feb 27, 2023

Choose a reason for hiding this comment

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

l: should we change value's type to string | undefined | null in the function signature to reflect that it apparently can be undefined/null?

Copy link
Member Author

Choose a reason for hiding this comment

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

makes sense!

Copy link
Member Author

@mydea mydea Feb 27, 2023

Choose a reason for hiding this comment

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

hmm, it seems there is actually a longer tail to this (as a lot of types seem to depend on the return value of this being string.)

So IMHO it's correct, but let's look at this separately maybe then!

EDIT: nevermind, I ended up fixing the type!

@mydea mydea merged commit f40f0cf into lms/fix-undefined-in-defaultMaskFn Feb 27, 2023
@mydea mydea deleted the fn/fix-transform-attribute branch February 27, 2023 09:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants