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

Improve function types and bump libraries #429

Merged
merged 2 commits into from
Jan 11, 2022
Merged

Improve function types and bump libraries #429

merged 2 commits into from
Jan 11, 2022

Conversation

rkuykendall
Copy link
Contributor

@rkuykendall rkuykendall commented Jan 11, 2022

image

if (isString(value)) {
return value.trim();
if (isNumber(value)) {
return String(value);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the only functional change here, and it's reflected in the test suite.

Choose a reason for hiding this comment

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

was this change necessary for the ant design upgrade?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope. Just seemed like a good change. getOrDefault should probably return a string, right? If not, I can change it to string | number

Choose a reason for hiding this comment

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

I would leave it as string | number, since I see this function as defaulting only if the value is empty. but don't feel strongly either way. doesn't look like it's being used for numbers currently.

if (isString(value)) {
return value.trim();
if (isNumber(value)) {
return String(value);

Choose a reason for hiding this comment

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

was this change necessary for the ant design upgrade?

@rkuykendall rkuykendall merged commit 403428c into master Jan 11, 2022
@rkuykendall rkuykendall deleted the libraries branch January 11, 2022 15:46
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.

None yet

2 participants