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

Empty string should be converted to undefined #1168 #1197

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

AlexandraBuzila
Copy link
Member

No description provided.

@@ -145,7 +145,11 @@ export const coreReducer = (
};
} else {
const oldData: any = _.get(state.data, action.path);
const newData = action.updater(oldData);
let newData = action.updater(oldData);
if (newData === '' && newData.constructor.name === 'String') {
Copy link
Member

Choose a reason for hiding this comment

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

do we need the newData.constructor.name === 'String' check?

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think so

Copy link
Member Author

Choose a reason for hiding this comment

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

It seems like it's not needed, since only strings and dates produce an empty string when cleared and the data type for dates is string anyway. I pushed an updated commit.

@coveralls
Copy link

coveralls commented Dec 19, 2018

Coverage Status

Coverage increased (+0.4%) to 87.951% when pulling 6bed38d on AlexandraBuzila:fix-1168 into 61c7530 on eclipsesource:master.

@edgarmueller edgarmueller merged commit 73f0cec into eclipsesource:master Dec 19, 2018
@edgarmueller edgarmueller added this to the 2.1.0 milestone Jan 30, 2019
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.

4 participants