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

Function fieldName

javascript/selenium-webdriver/project_bidi_schema.mjs:270–275  ·  view source on GitHub ↗
(wire)

Source from the content-addressed store, hash-verified

268const IDENTIFIER = /^[A-Za-z][A-Za-z0-9]*$/
269
270function fieldName(wire) {
271 if (IDENTIFIER.test(wire)) return wire
272 const [head, ...rest] = wire.split(/[^A-Za-z0-9]+/).filter(Boolean)
273 if (!head) return wire
274 return head + rest.map((part) => part[0].toUpperCase() + part.slice(1)).join('')
275}
276
277function projectField(prop) {
278 // A vendor-prefixed key (moz:allowPrivateBrowsing) keeps its wire form: extractVendor

Callers 1

projectFieldFunction · 0.85

Calls 4

filterMethod · 0.80
splitMethod · 0.80
testMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected