Refactor getDurationString function to use undefined instead of null

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-02-23 12:53:45 -03:00
commit 70bd1d0c2a

View file

@ -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}`;