mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
fix: conversion to snake case (#18707)
Fixes https://github.com/microsoft/playwright/issues/18695
This commit is contained in:
parent
194abc35cd
commit
0765182a4d
@ -36,7 +36,8 @@ export function toTitleCase(name: string) {
|
||||
}
|
||||
|
||||
export function toSnakeCase(name: string): string {
|
||||
return name.replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase();
|
||||
// E.g. ignoreHTTPSErrors => ignore_https_errors.
|
||||
return name.replace(/([a-z0-9])([A-Z])/g, '$1_$2').replace(/([A-Z])([A-Z][a-z])/g, '$1_$2').toLowerCase();
|
||||
}
|
||||
|
||||
export function cssEscape(s: string): string {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user