MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / optionsArg

Function optionsArg

__tests__/child-process-windows-hide.test.ts:117–124  ·  view source on GitHub ↗

The options argument of a spawner call, or undefined when none is passed.

(call: ts.CallExpression, spawner: string)

Source from the content-addressed store, hash-verified

115
116/** The options argument of a spawner call, or undefined when none is passed. */
117function optionsArg(call: ts.CallExpression, spawner: string): ts.Expression | undefined {
118 const [, second, third] = call.arguments;
119 if (SPAWNERS[spawner] === 'command') return second;
120 // (file, options) is allowed when the args array is omitted: an object there
121 // is the options, literal or not (`execFileSync('git', opts)`).
122 if (call.arguments.length === 2 || (second && ts.isObjectLiteralExpression(second))) return second;
123 return third;
124}
125
126function unwrap(expr: ts.Expression): ts.Expression {
127 let e = expr;

Callers 1

visitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected