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

Function argify

packages/docutils/lib/utils/cli.ts:7–19  ·  view source on GitHub ↗
(obj: Record<string, string | number | boolean | undefined>)

Source from the content-addressed store, hash-verified

5 * to `false`, so they will only be added to the array if the value is `true`.
6 */
7export const argify = (obj: Record<string, string | number | boolean | undefined>): string[] => {
8 const args: string[] = [];
9 for (const [key, value] of Object.entries(obj)) {
10 if (value === true) {
11 args.push(`--${key}`);
12 } else if (value === false || value === undefined) {
13 continue;
14 } else {
15 args.push(`--${key}`, String(value));
16 }
17 }
18 return args;
19};
20
21/**
22 * Converts a string to kebab-case.

Callers 2

deployFunction · 0.85
util.spec.tsFile · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected