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

Function tsName

javascript/selenium-webdriver/bidi_schema_diff_test.mjs:73–81  ·  view source on GitHub ↗

dotted CDDL name → cddl2ts PascalCase name (mirrors normalizeDottedName).

(name)

Source from the content-addressed store, hash-verified

71
72/** dotted CDDL name → cddl2ts PascalCase name (mirrors normalizeDottedName). */
73function tsName(name) {
74 return name
75 .split('.')
76 .map((part) => {
77 const titled = part.charAt(0).toUpperCase() + part.slice(1)
78 return titled.replace(/([A-Z]{2,})(?=[A-Z][a-z]|$)/g, (m) => m[0] + m.slice(1).toLowerCase())
79 })
80 .join('')
81}
82
83const OPEN = '{(['
84const CLOSE = '})]'

Callers 1

diffAgainstCddl2tsFunction · 0.85

Calls 3

splitMethod · 0.80
charAtMethod · 0.80
mapMethod · 0.45

Tested by

no test coverage detected