lib/jsdom/living/helpers/dates-and-times.js
function parseTimeString(str) {
  const matches = timeRe.exec(str);
  if (!matches) {
    return null;
  }
  const hour = Number(matches[1]);
  if (hour < 0 || hour > 23) {
    return null;
  }
  const minute = Number(matches[2]);
  if (minute < 0 || minute > 59) {
    return null;
  }
  const second = matches[3] !== undefined ? Math.trunc(Number(matches[3])) : 0;
  if (second < 0 || second >= 60) {
    return null;
  }
  const millisecond = matches[4] !== undefined ? Number(matches[4]) : 0;
  return { hour, minute, second, millisecond };
}
function parseTimeString(str) {
  const matches = timeRe.exec(str);
  if (!matches) {
    return null;
  }
  const hour = Number(matches[1]);
  if (hour < 0 || hour > 23) {
    return null;
  }
  const minute = Number(matches[2]);
  if (minute < 0 || minute > 59) {
    return null;
  }
  const second = matches[3] !== undefined ? Math.trunc(Number(matches[3])) : 0;
  if (second < 0 || second >= 60) {
    return null;
  }
  const millisecond = matches[4] !== undefined ? Number(matches[4]) : 0;
  return { hour, minute, second, millisecond };
}
function parseTimeString ( str ) { const matches = timeRe . exec ( str ) ; if ( ! matches ) { return null ; } const hour = Number ( matches [ 1 ] ) ; if ( hour < 0 || hour > 23 ) { return null ; } const minute = Number ( matches [ 2 ] ) ; if ( minute < 0 || minute > 59 ) { return null ; } const second = matches [ 3 ] !== undefined ? Math . trunc ( Number ( matches [ 3 ] ) ) : 0 ; if ( second < 0 || second >= 60 ) { return null ; } const millisecond = matches [ 4 ] !== undefined ? Number ( matches [ 4 ] ) : 0 ; return { hour , minute , second , millisecond } ; }
https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#parse-a-time-string
https : // html . spec . whatwg . org / multipage / common - microsyntaxes . html#parse - a - time - string