swc/bundler/tests/.cache/deno/f609961b5238d3311e10ded9ca571259424ed9c7.ts
강동윤 bbaf619f63
fix(bundler): Fix bugs (#1437)
swc_bundler:
 - [x] Fix wrapped esms. (denoland/deno#9307)
 - [x] Make test secure.
2021-03-02 17:33:03 +09:00

49 lines
861 B
TypeScript

// Loaded from https://deno.land/x/case/upperCase.ts
import { LanguageSpecific } from "./types.ts";
const LANGUAGES: LanguageSpecific = {
tr: {
regexp: /[\u0069]/g,
map: {
i: "\u0130",
},
},
az: {
regexp: /[\u0069]/g,
map: {
i: "\u0130",
},
},
lt: {
regexp: /[\u0069\u006A\u012F]\u0307|\u0069\u0307[\u0300\u0301\u0303]/g,
map: {
: "\u0049",
: "\u004A",
į̇: "\u012E",
i̇̀: "\u00CC",
i̇́: "\u00CD",
i̇̃: "\u0128",
},
},
};
export default function (str: string, locale?: string): string {
str = str == null ? "" : String(str);
if (!locale) {
return str.toUpperCase();
}
const lang = LANGUAGES[locale];
if (lang) {
str = str.replace(lang.regexp, function (m) {
return lang.map[m];
});
}
return str.toUpperCase();
}