MCPcopy Index your code
hub / github.com/nodejs/node / normalizeExecFileArgs

Function normalizeExecFileArgs

lib/child_process.js:265–299  ·  view source on GitHub ↗
(file, args, options, callback)

Source from the content-addressed store, hash-verified

263});
264
265function normalizeExecFileArgs(file, args, options, callback) {
266 if (ArrayIsArray(args)) {
267 args = ArrayPrototypeSlice(args);
268 } else if (args != null && typeof args === 'object') {
269 callback = options;
270 options = args;
271 args = null;
272 } else if (typeof args === 'function') {
273 callback = args;
274 options = null;
275 args = null;
276 }
277
278 args ??= [];
279
280 if (typeof options === 'function') {
281 callback = options;
282 } else if (options != null) {
283 validateObject(options, 'options');
284 }
285
286 options ??= kEmptyObject;
287
288 if (callback != null) {
289 validateFunction(callback, 'callback');
290 }
291
292 // Validate argv0, if present.
293 if (options.argv0 != null) {
294 validateString(options.argv0, 'options.argv0');
295 validateArgumentNullCheck(options.argv0, 'options.argv0');
296 }
297
298 return { file, args, options, callback };
299}
300
301/**
302 * Spawns the specified file as a shell.

Callers 2

execFileFunction · 0.85
execFileSyncFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…