MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / normalizeDottedName

Function normalizeDottedName

javascript/selenium-webdriver/generate_bidi.mjs:543–555  ·  view source on GitHub ↗

* Convert a dotted CDDL name to PascalCase TypeScript name. * "browsingContext.Info" → "BrowsingContextInfo"

(name)

Source from the content-addressed store, hash-verified

541 * "browsingContext.Info""BrowsingContextInfo"
542 */
543function normalizeDottedName(name) {
544 return name
545 .split('.')
546 .map((part) => {
547 const titled = part.charAt(0).toUpperCase() + part.slice(1)
548 // Normalize acronym runs to match cddl2ts output:
549 // CSPParameters → CspParameters HTMLCollection → HtmlCollection
550 // Rule: 2+ uppercase letters followed by an uppercase+lowercase pair (or end
551 // of string) → keep only the first uppercase and lowercase the rest.
552 return titled.replace(/([A-Z]{2,})(?=[A-Z][a-z]|$)/g, (m) => m[0] + m.slice(1).toLowerCase())
553 })
554 .join('')
555}
556
557/**
558 * Walk the `CommandData` or `EventData` union type hierarchy and collect all

Callers 2

modelToCommandsFunction · 0.85
modelToEventsFunction · 0.85

Calls 3

splitMethod · 0.80
charAtMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected