Skip to content

Commit 511b977

Browse files
committed
child-process: undo unrelated style changes
Auto-formatting cause unnecessary indentations. These style changes are removed.
1 parent 1994e4c commit 511b977

File tree

1 file changed

+29
-38
lines changed

1 file changed

+29
-38
lines changed

lib/child_process.js

Lines changed: 29 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,9 @@ function normalizeExecArgs(command, options, callback) {
143143

144144
exports.exec = function exec(command /* , options, callback */) {
145145
var opts = normalizeExecArgs.apply(null, arguments);
146-
return exports.execFile(
147-
opts.file,
148-
opts.options,
149-
opts.callback);
146+
return exports.execFile(opts.file,
147+
opts.options,
148+
opts.callback);
150149
};
151150

152151
const customPromiseExecFunction = (orig) => {
@@ -382,7 +381,7 @@ const _deprecatedCustomFds = deprecate(
382381
return fd === -1 ? 'pipe' : fd;
383382
});
384383
}, 'child_process: options.customFds option is deprecated. ' +
385-
'Use options.stdio instead.', 'DEP0006');
384+
'Use options.stdio instead.', 'DEP0006');
386385

387386
function _convertCustomFds(options) {
388387
if (options.customFds && !options.stdio) {
@@ -400,7 +399,7 @@ function normalizeSpawnArguments(file, args, options) {
400399
if (Array.isArray(args)) {
401400
args = args.slice(0);
402401
} else if (args !== undefined &&
403-
(args === null || typeof args !== 'object')) {
402+
(args === null || typeof args !== 'object')) {
404403
throw new ERR_INVALID_ARG_TYPE('args', 'object', args);
405404
} else {
406405
options = args;
@@ -414,16 +413,15 @@ function normalizeSpawnArguments(file, args, options) {
414413

415414
// Validate the cwd, if present.
416415
if (options.cwd != null &&
417-
typeof options.cwd !== 'string') {
416+
typeof options.cwd !== 'string') {
418417
throw new ERR_INVALID_ARG_TYPE('options.cwd', 'string', options.cwd);
419418
}
420419

421420
// Validate detached, if present.
422421
if (options.detached != null &&
423-
typeof options.detached !== 'boolean') {
424-
throw new ERR_INVALID_ARG_TYPE(
425-
'options.detached',
426-
'boolean', options.detached);
422+
typeof options.detached !== 'boolean') {
423+
throw new ERR_INVALID_ARG_TYPE('options.detached',
424+
'boolean', options.detached);
427425
}
428426

429427
// Validate the uid, if present.
@@ -438,35 +436,31 @@ function normalizeSpawnArguments(file, args, options) {
438436

439437
// Validate the shell, if present.
440438
if (options.shell != null &&
441-
typeof options.shell !== 'boolean' &&
442-
typeof options.shell !== 'string') {
443-
throw new ERR_INVALID_ARG_TYPE(
444-
'options.shell',
445-
['boolean', 'string'], options.shell);
439+
typeof options.shell !== 'boolean' &&
440+
typeof options.shell !== 'string') {
441+
throw new ERR_INVALID_ARG_TYPE('options.shell',
442+
['boolean', 'string'], options.shell);
446443
}
447444

448445
// Validate argv0, if present.
449446
if (options.argv0 != null &&
450-
typeof options.argv0 !== 'string') {
447+
typeof options.argv0 !== 'string') {
451448
throw new ERR_INVALID_ARG_TYPE('options.argv0', 'string', options.argv0);
452449
}
453450

454451
// Validate windowsHide, if present.
455452
if (options.windowsHide != null &&
456453
typeof options.windowsHide !== 'boolean') {
457-
throw new ERR_INVALID_ARG_TYPE(
458-
'options.windowsHide',
459-
'boolean',
460-
options.windowsHide);
454+
throw new ERR_INVALID_ARG_TYPE('options.windowsHide',
455+
'boolean', options.windowsHide);
461456
}
462457

463458
// Validate windowsVerbatimArguments, if present.
464459
if (options.windowsVerbatimArguments != null &&
465-
typeof options.windowsVerbatimArguments !== 'boolean') {
466-
throw new ERR_INVALID_ARG_TYPE(
467-
'options.windowsVerbatimArguments',
468-
'boolean',
469-
options.windowsVerbatimArguments);
460+
typeof options.windowsVerbatimArguments !== 'boolean') {
461+
throw new ERR_INVALID_ARG_TYPE('options.windowsVerbatimArguments',
462+
'boolean',
463+
options.windowsVerbatimArguments);
470464
}
471465

472466
// Make a shallow copy so we don't clobber the user's options object.
@@ -588,10 +582,9 @@ function spawnSync(/* file, args, options */) {
588582
} else if (typeof input === 'string') {
589583
pipe.input = Buffer.from(input, options.encoding);
590584
} else {
591-
throw new ERR_INVALID_ARG_TYPE(
592-
`options.stdio[${i}]`,
593-
['Buffer', 'Uint8Array', 'string'],
594-
input);
585+
throw new ERR_INVALID_ARG_TYPE(`options.stdio[${i}]`,
586+
['Buffer', 'Uint8Array', 'string'],
587+
input);
595588
}
596589
}
597590
}
@@ -667,10 +660,9 @@ function validateTimeout(timeout) {
667660

668661
function validateMaxBuffer(maxBuffer) {
669662
if (maxBuffer != null && !(typeof maxBuffer === 'number' && maxBuffer >= 0)) {
670-
throw new ERR_OUT_OF_RANGE(
671-
'options.maxBuffer',
672-
'a positive number',
673-
maxBuffer);
663+
throw new ERR_OUT_OF_RANGE('options.maxBuffer',
664+
'a positive number',
665+
maxBuffer);
674666
}
675667
}
676668

@@ -679,9 +671,8 @@ function sanitizeKillSignal(killSignal) {
679671
if (typeof killSignal === 'string' || typeof killSignal === 'number') {
680672
return convertToValidSignal(killSignal);
681673
} else if (killSignal != null) {
682-
throw new ERR_INVALID_ARG_TYPE(
683-
'options.killSignal',
684-
['string', 'number'],
685-
killSignal);
674+
throw new ERR_INVALID_ARG_TYPE('options.killSignal',
675+
['string', 'number'],
676+
killSignal);
686677
}
687678
}

0 commit comments

Comments
 (0)