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

Function enumConstantKey

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

Source from the content-addressed store, hash-verified

1095// separators to underscores, and guard a still-invalid leading digit, before
1096// screamingSnakeCase's uppercasing, so every generated key actually parses.
1097function enumConstantKey(value) {
1098 const key = screamingSnakeCase(String(value).replace(/[-\s]+/g, '_'))
1099 return /^[0-9]/.test(key) ? `_${key}` : key
1100}
1101
1102// A frozen, inspectable object literal for an enum's values — the JS-idiomatic
1103// 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