export function removeNonRegLetter(str: string, reg = letterReg): string {
let needUpperCase = false
let ret = ''
for (const c of str) {
if (reg.test(c)) {
ret += needUpperCase ? c.toUpperCase() : c
needUpperCase = false
} else {
needUpperCase = true
}
}
return ret
}
removeNonRegLetter first param SHOULD BE string|RegExp
Versions
Reproduction
remote vite.config.js:
run build and:
THE CODE IS:
https://github.com/originjs/vite-plugin-federation/blob/76e847a9af25f98a3c51afd3c8cf039f6ec5ac23/packages/lib/src/prod/shared-production.ts#L49
get external and use removeNonRegLetter
https://github.com/originjs/vite-plugin-federation/blob/76e847a9af25f98a3c51afd3c8cf039f6ec5ac23/packages/lib/src/utils/index.ts#L169
removeNonRegLetter
first param SHOULD BEstring|RegExp
https://rollupjs.org/configuration-options/#external