function parseWeekString(str) {
  const matches = weekRe.exec(str);
  if (!matches) {
    return null;
  }
  const year = Number(matches[1]);
  if (year <= 0) {
    return null;
  }
  const week = Number(matches[2]);
  if (week < 1 || week > weekNumberOfLastDay(year)) {
    return null;
  }
  return { year, week };
}
function parseWeekString(str) {
  const matches = weekRe.exec(str);
  if (!matches) {
    return null;
  }
  const year = Number(matches[1]);
  if (year <= 0) {
    return null;
  }
  const week = Number(matches[2]);
  if (week < 1 || week > weekNumberOfLastDay(year)) {
    return null;
  }
  return { year, week };
}
function parseWeekString ( str ) { const matches = weekRe . exec ( str ) ; if ( ! matches ) { return null ; } const year = Number ( matches [ 1 ] ) ; if ( year <= 0 ) { return null ; } const week = Number ( matches [ 2 ] ) ; if ( week < 1 || week > weekNumberOfLastDay ( year ) ) { return null ; } return { year , week } ; }
https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#parse-a-week-string
https : // html . spec . whatwg . org / multipage / common - microsyntaxes . html#parse - a - week - string