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

Function parseRequestArgs

packages/storage-plugin/lib/plugin.ts:135–147  ·  view source on GitHub ↗
(req: Request, requiredKeys: string[])

Source from the content-addressed store, hash-verified

133}
134
135function parseRequestArgs(req: Request, requiredKeys: string[]): Record<string, any> {
136 if (!util.isPlainObject(req.body)) {
137 throw new StorageArgumentError(`The request body must be a valid JSON object`);
138 }
139 for (const key of requiredKeys) {
140 if (!Object.hasOwn(req.body, key)) {
141 throw new StorageArgumentError(
142 `The required argument '${key}' is missing (expected ${JSON.stringify(requiredKeys)})`,
143 );
144 }
145 }
146 return req.body;
147}
148
149async function prepareWebSockets(
150 httpServer: AppiumServer,

Callers 1

plugin.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected