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

Function projectField

javascript/selenium-webdriver/project_bidi_schema.mjs:277–294  ·  view source on GitHub ↗
(prop)

Source from the content-addressed store, hash-verified

275}
276
277function projectField(prop) {
278 // A vendor-prefixed key (moz:allowPrivateBrowsing) keeps its wire form: extractVendor
279 // routes it out of the shared types, and the vendor pipeline drops the namespace itself.
280 const vendor = prop['x-selenium-vendor']
281 const field = {
282 name: vendor ? prop.Name : fieldName(prop.Name),
283 wire: prop.Name,
284 required: (prop.Occurrence?.n ?? 1) >= 1,
285 type: withOperator(projectRef(prop.Type), prop.Operator),
286 }
287 // Provenance stamped by a vendor overlay (generate_bidi.mjs). Carried on the field so
288 // extractVendor can route it out of the shared schema; stripped there before it ships.
289 if (vendor) {
290 field.vendor = vendor
291 field.via = prop['x-selenium-vendor-via']
292 }
293 return field
294}
295
296// A group whose members are all anonymous refs (a top-level `a // b // c`
297// choice, e.g. session.ProxyConfiguration, or a single-member dispatch root

Callers 1

projectRecordFunction · 0.85

Calls 3

fieldNameFunction · 0.85
withOperatorFunction · 0.85
projectRefFunction · 0.85

Tested by

no test coverage detected