I want to convert time from the format.
I want to get the following effect, for example:
03 s -> 3s;
01 h 04 m 05 s -> 1 h 4 m 5 s;
01h -> 1h;
01h 15 m 07 s -> 1h 15 m 7 s
I use library timelite / time.
 let time = 00:00:03
 let a = add(time);
 let b = str(a);
 convert = (time) => {
    const [hour, minute, sec] = time.split(':');
    if (hour !== "00") {
      return `${hour} h ${minute} m ${sec} s`;
    }
    if (minute !== "00") {
      return `${minute} m ${sec} s`;
    }
    return `${sec} s`;
  }
console.log(convert(b))  //output 03s
