function canonicalizeUnicodeLocaleId(locale) {
        locale.lang = canonicalizeUnicodeLanguageId(locale.lang);
        if (locale.extensions) {
            for (var _i = 0, _a = locale.extensions; _i < _a.length; _i++) {
                var extension = _a[_i];
                switch (extension.type) {
                    case 'u':
                        extension.keywords = canonicalizeKVs(extension.keywords);
                        if (extension.attributes) {
                            extension.attributes = canonicalizeAttrs(extension.attributes);
                        }
                        break;
                    case 't':
                        if (extension.lang) {
                            extension.lang = canonicalizeUnicodeLanguageId(extension.lang);
                        }
                        extension.fields = canonicalizeKVs(extension.fields);
                        break;
                    default:
                        extension.value = extension.value.toLowerCase();
                        break;
                }
            }
            locale.extensions.sort(compareExtension);
        }
        return locale;
    }
Canonicalize based on
https://www.unicode.org/reports/tr35/tr35.html#Canonical_Unicode_Locale_Identifiers
https://tc39.es/ecma402/#sec-canonicalizeunicodelocaleid
IMPORTANT: This modifies the object inline
@param locale