-
Notifications
You must be signed in to change notification settings - Fork 272
feat: add more support for undefined format to number and time formatters #308
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.
lgtm!
Codecov Report
@@ Coverage Diff @@
## master #308 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 103 103
Lines 1223 1225 +2
Branches 300 300
=====================================
+ Hits 1223 1225 +2
Continue to review full report at Codecov.
|
Deploy preview for superset-ui ready! Built with commit 4f9db76 |
formatterId === null || typeof formatterId === 'undefined' || formatterId === '' | ||
? this.defaultKey | ||
: formatterId | ||
}`.trim(); |
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 appreciate the explicitness, but could this be simplified as formatterId ?? (formatterId || this.defaultKey)
.
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.
eslint
will try to change ||
to ??
🏆 Enhancements
Follow up from feat: make formatTime and formatNumber accept undefined type #307 , make
formatTime
,getTimeFormatter
,formatNumber
,getNumberFormatter
handleundefined
format.Bring back support for empty string as format. This was due to the recent change from
||
to??
.The code used to be
format || defaultFormat
, and it was changed byeslint
auto-fix toformat ?? defaultFormat
.