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
Remove util type checks #3135
Remove util type checks #3135
Conversation
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.
Thanks for this PR, left an inline suggestion.
app/actions/StatisticsActions.js
Outdated
@@ -391,7 +390,7 @@ export const exportStatToCSV = (opts) => (dispatch, getState) => { | |||
// called once for each data line | |||
const progressFunction = (time, series) => { | |||
const values = allSeries.map((s) => | |||
!isUndefined(series[s.name]) ? s.valueFormatFunc(series[s.name]) : null | |||
series[s.name] !== undefined ? s.valueFormatFunc(series[s.name]) : null |
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.
This isn't enough, you could also check if typeof x === "undefined" but I would rather use lodash isUndefined
func for that.
Lodash may have it's own version of isNumber, isNullOrUndefined
funcs as well, checkout their documentation.
133af32
to
76ed888
Compare
Thanks @amassarwi, you're totally right. Just to be clearer: |
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.
Noice 👍
needs rebase |
76ed888
to
fcbdd88
Compare
Rebased. |
Quite a few conflicts that will need to be dealt with. |
fcbdd88
to
6ad7791
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.
Nice job. Thanks for this!
Closes #3131.