export function padToHoursMinutesSeconds(timestamp) {
  const shortTimestampPattern = /^\d{1,2}:\d\d$/;
  const paddedTimestamp = `00:${timestamp}`;

  if (shortTimestampPattern.test(timestamp)) {
    return (paddedTimestamp);
  } else {
    return (timestamp);
  }
}

const padToHoursMinutesSeconds: (s: string) => string = (timestamp: string) => {
  const shortTimestampPattern: RegExp = /^\d{1,2}:\d\d$/;
  const paddedTimestamp: string = `00:${timestamp}`;

  if (shortTimestampPattern.test(timestamp)) {
    return paddedTimestamp;
  } else {
    return timestamp;
  }
};

export { padToHoursMinutesSeconds };

Add type annotations to timestamp-padding function
Add type annotations to timestamp-padding function
