MCPcopy Create free account
hub / github.com/appium/appium / normalizeServerArgs

Method normalizeServerArgs

packages/appium/lib/cli/parser.ts:112–121  ·  view source on GitHub ↗

* Normalizes server arg keys from schema names to parser destination names. * * This mutates and returns the same object.

(obj: T)

Source from the content-addressed store, hash-verified

110 * This mutates and returns the same object.
111 */
112 static normalizeServerArgs<T extends LooseArgsMap>(obj: T): T {
113 const mutableObj = obj as LooseArgsMap;
114 for (const spec of getAllArgSpecs().values()) {
115 if (!spec.extType && mutableObj[spec.name] !== undefined && spec.rawDest !== spec.name) {
116 mutableObj[spec.rawDest] = mutableObj[spec.name] ?? mutableObj[spec.rawDest];
117 delete mutableObj[spec.name];
118 }
119 }
120 return obj;
121 }
122
123 /**
124 * Given an object full of arguments as returned by `argparser.parse_args`,

Callers 2

parsePreConfigArgsMethod · 0.80
parser.spec.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected