mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(vant-cli): decamelize ReDoS (#10351)
* [Security] Fix ReDoS Fix ReDoS * Fix ReDoS Fix ReDoS
This commit is contained in:
parent
e9451af1be
commit
bc4e1cd17e
@ -4,7 +4,7 @@ const isMobile = /ios|iphone|ipod|ipad|android/.test(ua);
|
||||
export function decamelize(str, sep = '-') {
|
||||
return str
|
||||
.replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2')
|
||||
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2')
|
||||
.replace(/([A-Z])([A-Z][a-z\d]+)/g, '$1' + sep + '$2')
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ export function pascalize(str: string): string {
|
||||
export function decamelize(str: string, sep = '-') {
|
||||
return str
|
||||
.replace(/([a-z\d])([A-Z])/g, '$1' + sep + '$2')
|
||||
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + sep + '$2')
|
||||
.replace(/([A-Z])([A-Z][a-z\d]+)/g, '$1' + sep + '$2')
|
||||
.toLowerCase();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user