swc/bundler/tests/.cache/deno/50ef99b3983986e9a4e3ff30a3862e2d4c5d5812.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

23 lines
467 B
TypeScript

// Loaded from https://deno.land/x/case/swapCase.ts
import upperCase from "./upperCase.ts";
import lowerCase from "./lowerCase.ts";
export default function (str: string, locale?: string): string {
if (str == null) {
return "";
}
let result: string = "";
for (let i: number = 0; i < str.length; i++) {
const c: string = str[i];
const u: string = upperCase(c, locale);
result += u === c ? lowerCase(c, locale) : u;
}
return result;
}