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

Function enumConstantKey

javascript/selenium-webdriver/generate_bidi.mjs:1167–1170  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

1165// separators to underscores, and guard a still-invalid leading digit, before
1166// screamingSnakeCase's uppercasing, so every generated key actually parses.
1167function enumConstantKey(value) {
1168 const key = screamingSnakeCase(String(value).replace(/[-\s]+/g, '_'))
1169 return /^[0-9]/.test(key) ? `_${key}` : key
1170}
1171
1172// A frozen, inspectable object literal for an enum's values — the JS-idiomatic
1173// answer to Ruby's `Network::INTERCEPT_PHASE` constant (see

Callers 1

Calls 2

screamingSnakeCaseFunction · 0.85
testMethod · 0.45

Tested by

no test coverage detected