static validateTimingBudget(timingBudget) {
    const {metric, budget, ...invalidRest} = timingBudget;
    Budget.assertNoExcessProperties(invalidRest, 'Timing Budget');

    /** @type {Array<LH.Budget.TimingMetric>} */
    const validTimingMetrics = [
      'first-contentful-paint',
      'interactive',
      'first-meaningful-paint',
      'max-potential-fid',
      'total-blocking-time',
      'speed-index',
      'largest-contentful-paint',
      'cumulative-layout-shift',
    ];
    // Assume metric is an allowed string, throw if not.
    if (!validTimingMetrics.includes(/** @type {LH.Budget.TimingMetric} */ (metric))) {
      throw new Error(
        `Invalid timing metric: ${metric}. \n` +
          `Valid timing metrics are: ${validTimingMetrics.join(', ')}`
      );
    }
    if (!isNumber(budget)) {
      throw new Error(`Invalid budget: ${budget}`);
    }
    return {
      metric: /** @type {LH.Budget.TimingMetric} */ (metric),
      budget,
    };
  }
@param {Record<string, unknown>} timingBudget
@return {LH.Budget.TimingBudget}