Refactor getDurationString function to use undefined instead of null
This commit is contained in:
parent
1565ad95a3
commit
70bd1d0c2a
1 changed files with 2 additions and 2 deletions
|
|
@ -89,8 +89,8 @@ export default function GenericNode({
|
|||
|
||||
// should be empty string if no duration
|
||||
// else should be `Duration: ${duration}`
|
||||
const getDurationString = (duration: number | null): string => {
|
||||
if (duration === null) {
|
||||
const getDurationString = (duration: number | undefined): string => {
|
||||
if (duration === undefined) {
|
||||
return "";
|
||||
} else {
|
||||
return `Duration: ${duration}`;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue