function _processPlaceholderCustomFormattedIcu(icu) {
  // Split on custom-formatted ICU: {var, number, type}
  const parts = icu.message.split(
    /\{(\w+), (\w+), (\w+)\}/g);
  icu.message = '';
  let idx = 0;

  const rawNameCache = new Map();

  while (parts.length) {
    // Seperate out the match into parts.
    const [preambleText, rawName, format, formatType] = parts.splice(0, 4);
    icu.message += preambleText;

    if (!rawName || !format || !formatType) continue;
    // Check that custom-formatted ICU not using non-supported format ex:
    // * using a second arg anything other than "number"
    // * using a third arg that is not millis, secs, bytes, %, or extended %
    if (!format.match(/^number$/)) {
      throw Error(`Unsupported custom-formatted ICU format var "${format}" in message "${icu.message}"`);
    }
    if (!formatType.match(/milliseconds|seconds|bytes|percent|extendedPercent/)) {
      throw Error(`Unsupported custom-formatted ICU type var "${formatType}" in message "${icu.message}"`);
    }

    let index;
    const previousRawName = rawNameCache.get(rawName);
    if (previousRawName) {
      const [prevFormat, prevFormatType, prevIndex] = previousRawName;
      if (prevFormat !== format || prevFormatType !== formatType) {
        throw new Error(`must use same format and formatType for a given name. Invalid for: ${rawName}`);
      }

      index = prevIndex;
    } else {
      index = idx++;
      rawNameCache.set(rawName, [format, formatType, index]);
    }

    // Append ICU replacements if there are any.
    const placeholderName = `CUSTOM_ICU_${index}`;
    icu.message += `$${placeholderName}$`;
    let example;

    // Make some good examples.
    switch (formatType) {
      case 'seconds':
        example = '2.4';
        break;
      case 'percent':
        example = '54.6%';
        break;
      case 'extendedPercent':
        example = '37.92%';
        break;
      case 'milliseconds':
      case 'bytes':
        example = '499';
        break;
      default:
        // This shouldn't be possible, but if the above formatType regex fails, this is fallback.
        throw Error('Unknown formatType');
    }

    icu.placeholders[placeholderName] = {
      content: `{${rawName}, number, ${formatType}}`,
      example,
    };
  }
}
Convert custom-formatted ICU syntax into placeholders with examples.
Custom formats defined in i18n.js in "format" object.

Before:
 icu: 'This audit took {timeInMs, number, milliseconds} ms.'
After:
 icu: 'This audit took $CUSTOM_ICU_0' ms.
 placeholders: {
   CUSTOM_ICU_0 {
     content: {timeInMs, number, milliseconds},
     example: 499,
   }
 }

@param {IncrementalCtc} icu