message: parseBcp47Tag: Don't call toLowerCase() on undefined
diff: @@ -72,7 +72,7 @@ export const parseBcp47Tag = (bcp47_tag: string) => {
  const bcp47_regex =
  /^(?:(en-gb-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-be-fr|sgn-be-nl|sgn-ch-de)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang))$|^((?:[a-z]{2,3}(?:(?:-[a-z]{3}){1,3})?)|[a-z]{4}|[a-z]{5,8})(?:-([a-z]{4}))?(?:-([a-z]{2}|\d{3}))?((?:-(?:[\da-z]{5,8}|\d[\da-z]{3}))*)?((?:-[\da-wyz](?:-[\da-z]{2,8})+)*)?(-x(?:-[\da-z]{1,8})+)?$|^(x(?:-[\da-z]{1,8})+)$/i;
  const res = bcp47_regex.exec(bcp47_tag);
  - return { language: res?.[3].toLowerCase(), country: res?.[5].toLowerCase() };
  + return { language: res?.[3]?.toLowerCase(), country: res?.[5]?.toLowerCase() };
  };
  /**
  