function coerceLocale(value) {
  if (value === undefined) return;

  if (typeof value !== 'string') throw new Error(`Invalid value: Argument 'locale' must be a string`);
  return /** @type {LH.Locale} */ (value);
}
Verifies value is a string, then coerces type to LH.Locale for convenience. However, don't
allowlist specific locales. Why? So we can support the user who requests 'es-MX' (unsupported)
and we'll fall back to 'es' (supported).
@param {unknown} value
@return {LH.Locale|undefined}