Skip to content
Myr

Fix fd-specific options to account for `ipc` (#1241)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Sindre Sorhus · committed by GitHub · parent 68986b7 · Browse files · 12 files+135 added−56 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

12 files+135 added−56 removed

  • tests:+89 added−20 removed
  • other:+46 added−36 removed

12 files+135 added−56 removed

modified:lib/arguments/specific.js+10 added-9 removed
modified:test/helpers/verbose.js+9 added-2 removed
1 unmodified line
2import {stripVTControlCharacters} from 'node:util';3import {replaceSymbols} from 'figures';4import {foobarString} from './input.js';5import {nestedSubprocess} from './nested.js';6import {fullStdio} from './stdio.js';78const isWindows = platform === 'win32';9export const QUOTE = isWindows ? '"' : '\'';1010export const runErrorSubprocess = async (t, verbose, isSync = false, expectExitCode = true) => {11 const {stderr, nestedResult} = await nestedSubprocess('noop-fail.js', ['1', foobarString], {verbose, isSync});11export const runErrorSubprocess = async (t, verbose, isSync = false, options = {}) => {12 const {expectExitCode = true, ...subprocessOptions} = options;13 const {stderr, nestedResult} = await nestedSubprocess('noop-fail.js', ['1', foobarString], {verbose, isSync, ...subprocessOptions});14 t.true(nestedResult instanceof Error);15 if (expectExitCode) {16 t.true(stderr.includes('exit code 2'));17 }
27 unmodified lines
45 output = '. .',46 ...options47}) => nestedSubprocess('noop-verbose.js', [output], {48 ipc: !isSync,49 ...getStdioForFd3Option(fdNumber, secondFdNumber),50 optionsFixture,51 optionsInput: {52 type,53 eventProperty,
5 unmodified lines
59 isSync,60 ...options,61});6263export const getStdioForFd3Option = (...values) => values.some(value => hasFd3Option(value)) ? fullStdio : {};6465const hasFd3Option = value => value === 'fd3' || (typeof value === 'object' && value !== null && Object.hasOwn(value, 'fd3'));6667export const getCommandLine = stderr => getCommandLines(stderr)[0];68export const getCommandLines = stderr => getNormalizedLines(stderr).filter(line => isCommandLine(line));69const isCommandLine = line => line.includes(' $ ') || line.includes(' | ');70export const getOutputLine = stderr => getOutputLines(stderr)[0];
34 unmodified lines
modified:test/io/max-buffer.js+20 added
127 unmodified lines
128 const {isMaxBuffer} = await getMaxBufferSubprocess(execa, 2, {maxBuffer: {stdout: 1}});129 t.false(isMaxBuffer);130});131132test('maxBuffer.fd3 is invalid without stdio[3], even with ipc', t => {133 const {message} = t.throws(() => {134 execa('ipc-send-twice.js', {ipc: true, maxBuffer: {fd3: 1}});135 });136 t.true(message.includes('"maxBuffer.fd3" is invalid: that file descriptor does not exist.'));137});138139test('maxBuffer.fd3 and maxBuffer.ipc are distinct', async t => {140 const {isMaxBuffer, ipcOutput} = await execa('ipc-send-twice.js', {141 ipc: true,142 stdio: ['ignore', 'pipe', 'pipe', 'pipe'],143 maxBuffer: {144 fd3: 1,145 ipc: 2,146 },147 });148 t.false(isMaxBuffer);149 t.deepEqual(ipcOutput, foobarArray);150});151152test('maxBuffer.stdout is used for other file descriptors with fd-specific options, sync', async t => {153 const length = 1;154 const {shortMessage, stderr} = await runMaxBuffer(t, execaSync, 2, {maxBuffer: {stdout: length}});155 assertErrorMessage(t, shortMessage, {execaMethod: execaSync, fdNumber: 2, length});
153 unmodified lines
modified:test/ipc/buffer-messages.js+13 added
modified:test/verbose/complete.js+7 added-6 removed
9 unmodified lines
10 getCompletionLine,11 getCompletionLines,12 testTimestamp,13 getVerboseOption,14 getStdioForFd3Option,15 stdoutNoneOption,16 stdoutShortOption,17 stdoutFullOption,18 stderrNoneOption,
9 unmodified lines
2829setFixtureDirectory();3031const testPrintCompletion = async (t, verbose, isSync) => {31 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {verbose, isSync});32 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {verbose, ...getStdioForFd3Option(verbose), isSync});33 t.is(getCompletionLine(stderr), `${testTimestamp} [0] √ (done in 0ms)`);34};3536test('Prints completion, verbose "short"', testPrintCompletion, 'short', false);
17 unmodified lines
54test('Prints completion, verbose "short", fd-specific ipc, sync', testPrintCompletion, ipcShortOption, true);55test('Prints completion, verbose "full", fd-specific ipc, sync', testPrintCompletion, ipcFullOption, true);5657const testNoPrintCompletion = async (t, verbose, isSync) => {57 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {verbose, isSync});58 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {verbose, ...getStdioForFd3Option(verbose), isSync});59 t.is(stderr, '');60};6162test('Does not print completion, verbose "none"', testNoPrintCompletion, 'none', false);62test('Does not print completion, verbose default"', testNoPrintCompletion, undefined, false);63test('Does not print completion, verbose default', testNoPrintCompletion, undefined, false);64test('Does not print completion, verbose "none", fd-specific stdout', testNoPrintCompletion, stdoutNoneOption, false);65test('Does not print completion, verbose "none", fd-specific stderr', testNoPrintCompletion, stderrNoneOption, false);66test('Does not print completion, verbose "none", fd-specific fd3', testNoPrintCompletion, fd3NoneOption, false);67test('Does not print completion, verbose "none", fd-specific ipc', testNoPrintCompletion, ipcNoneOption, false);67test('Does not print completion, verbose default", fd-specific', testNoPrintCompletion, {}, false);68test('Does not print completion, verbose default, fd-specific', testNoPrintCompletion, {}, false);69test('Does not print completion, verbose "none", sync', testNoPrintCompletion, 'none', true);69test('Does not print completion, verbose default", sync', testNoPrintCompletion, undefined, true);70test('Does not print completion, verbose default, sync', testNoPrintCompletion, undefined, true);71test('Does not print completion, verbose "none", fd-specific stdout, sync', testNoPrintCompletion, stdoutNoneOption, true);72test('Does not print completion, verbose "none", fd-specific stderr, sync', testNoPrintCompletion, stderrNoneOption, true);73test('Does not print completion, verbose "none", fd-specific fd3, sync', testNoPrintCompletion, fd3NoneOption, true);74test('Does not print completion, verbose "none", fd-specific ipc, sync', testNoPrintCompletion, ipcNoneOption, true);74test('Does not print completion, verbose default", fd-specific, sync', testNoPrintCompletion, {}, true);75test('Does not print completion, verbose default, fd-specific, sync', testNoPrintCompletion, {}, true);7677const testPrintCompletionError = async (t, isSync) => {78 const stderr = await runErrorSubprocess(t, 'short', isSync);79 t.is(getCompletionLine(stderr), `${testTimestamp} [0] × (done in 0ms)`);
51 unmodified lines
modified:test/verbose/error.js+7 added-4 removed
1import test from 'ava';2import {setFixtureDirectory} from '../helpers/fixtures-directory.js';3import {foobarString, foobarRed} from '../helpers/input.js';3import {foobarString} from '../helpers/input.js';4import {nestedSubprocess} from '../helpers/nested.js';5import {6 QUOTE,7 runErrorSubprocess,
1 unmodified line
9 getErrorLine,10 getErrorLines,11 testTimestamp,12 getVerboseOption,13 getStdioForFd3Option,14 stdoutNoneOption,15 stdoutShortOption,16 stdoutFullOption,17 stderrNoneOption,
8 unmodified lines
26} from '../helpers/verbose.js';2728setFixtureDirectory();2930const redFoobarString = `\u001B[31m${foobarString}\u001B[39m`;3132const testPrintError = async (t, verbose, isSync) => {30 const stderr = await runErrorSubprocess(t, verbose, isSync);33 const stderr = await runErrorSubprocess(t, verbose, isSync, getStdioForFd3Option(verbose));34 t.is(getErrorLine(stderr), `${testTimestamp} [0] × Command failed with exit code 2: noop-fail.js 1 ${foobarString}`);35};3637test('Prints error, verbose "short"', testPrintError, 'short', false);
17 unmodified lines
55test('Prints error, verbose "short", fd-specific ipc, sync', testPrintError, ipcShortOption, true);56test('Prints error, verbose "full", fd-specific ipc, sync', testPrintError, ipcFullOption, true);5758const testNoPrintError = async (t, verbose, isSync) => {56 const stderr = await runErrorSubprocess(t, verbose, isSync, false);59 const stderr = await runErrorSubprocess(t, verbose, isSync, {expectExitCode: false, ...getStdioForFd3Option(verbose)});60 t.is(getErrorLine(stderr), undefined);61};6263test('Does not print error, verbose "none"', testNoPrintError, 'none', false);
87 unmodified lines
151 ]);152});153154test('Escapes and strips color sequences from error', async t => {152 const {stderr} = await t.throwsAsync(nestedSubprocess('noop-forever.js', [foobarRed], {parentFixture: 'nested-fail.js', verbose: 'short'}));155 const {stderr} = await t.throwsAsync(nestedSubprocess('noop-forever.js', [redFoobarString], {parentFixture: 'nested-fail.js', verbose: 'short'}));156 t.deepEqual(getErrorLines(stderr), [157 `${testTimestamp} [0] × Command was killed with SIGTERM (Termination): noop-forever.js ${QUOTE}\\u001b[31m${foobarString}\\u001b[39m${QUOTE}`,158 `${testTimestamp} [0] × ${foobarString}`,159 ]);
9 unmodified lines
modified:test/verbose/ipc.js+18 added-2 removed
1import {on} from 'node:events';2import {inspect} from 'node:util';3import test from 'ava';4import {red} from 'yoctocolors';5import {execa} from '../../index.js';6import {setFixtureDirectory} from '../helpers/fixtures-directory.js';5import {foobarString, foobarRed, foobarObject} from '../helpers/input.js';7import {foobarString, foobarObject} from '../helpers/input.js';8import {nestedSubprocess, nestedInstance} from '../helpers/nested.js';9import {fullStdio} from '../helpers/stdio.js';10import {11 getIpcLine,12 getIpcLines,13 testTimestamp,
11 unmodified lines
2526test('Prints IPC, verbose "full"', testPrintIpc, 'full');27test('Prints IPC, verbose "full", fd-specific', testPrintIpc, ipcFullOption);2829test('verbose.fd3 is invalid without stdio[3], even with ipc', t => {30 const {message} = t.throws(() => {31 execa('ipc-send.js', {ipc: true, verbose: {fd3: 'full'}});32 });33 t.true(message.includes('"verbose.fd3" is invalid: that file descriptor does not exist.'));34});3536test('verbose.fd3 does not affect IPC', async t => {37 const {nestedResult, stderr} = await nestedSubprocess('ipc-send.js', {ipc: true, verbose: {fd3: 'full'}, ...fullStdio});38 t.deepEqual(nestedResult.ipcOutput, [foobarString]);39 t.is(getIpcLine(stderr), undefined);40});4142const testNoPrintIpc = async (t, verbose) => {43 const {stderr} = await nestedSubprocess('ipc-send.js', {ipc: true, verbose});44 t.is(getIpcLine(stderr), undefined);45};
52 unmodified lines
98 t.is(getIpcLine(stderr), `${testTimestamp} [0] * ã`);99});100101test('Strips color sequences from IPC', async t => {86 const {stderr} = await nestedSubprocess('ipc-send.js', [foobarRed], {ipc: true, verbose: 'full'});102 const {stderr} = await nestedSubprocess('ipc-send.js', [red(foobarString)], {ipc: true, verbose: 'full'}, {env: {FORCE_COLOR: '1', NO_COLOR: undefined}});103 t.is(getIpcLine(stderr), `${testTimestamp} [0] * ${foobarString}`);104});105106test('Escapes control characters from IPC', async t => {
17 unmodified lines
modified:test/verbose/output-enable.js+3 added-2 removed
1import test from 'ava';2import {red} from 'yoctocolors';3import {setFixtureDirectory} from '../helpers/fixtures-directory.js';3import {foobarString, foobarRed, foobarUtf16Uint8Array} from '../helpers/input.js';4import {foobarString, foobarUtf16Uint8Array} from '../helpers/input.js';5import {fullStdio} from '../helpers/stdio.js';6import {nestedSubprocess} from '../helpers/nested.js';7import {8 runErrorSubprocess,
96 unmodified lines
105 t.is(getOutputLine(stderr), `${testTimestamp} [0] ã`);106});107108test('Strips color sequences from stdout', async t => {108 const {stderr} = await nestedSubprocess('noop.js', [foobarRed], {verbose: 'full'});109 const {stderr} = await nestedSubprocess('noop.js', [red(foobarString)], {verbose: 'full'}, {env: {FORCE_COLOR: '1', NO_COLOR: undefined}});110 t.is(getOutputLine(stderr), `${testTimestamp} [0] ${foobarString}`);111});112113test('Escapes control characters from stdout', async t => {
32 unmodified lines
modified:test/verbose/start.js+12 added-4 removed
1import test from 'ava';2import {setFixtureDirectory} from '../helpers/fixtures-directory.js';3import {foobarString, foobarRed} from '../helpers/input.js';3import {foobarString} from '../helpers/input.js';4import {nestedSubprocess} from '../helpers/nested.js';5import {6 QUOTE,7 runErrorSubprocess,
1 unmodified line
9 getCommandLine,10 getCommandLines,11 testTimestamp,12 getVerboseOption,13 getStdioForFd3Option,14 stdoutNoneOption,15 stdoutShortOption,16 stdoutFullOption,17 stderrNoneOption,
8 unmodified lines
26} from '../helpers/verbose.js';2728setFixtureDirectory();2930const redFoobarString = `\u001B[31m${foobarString}\u001B[39m`;3132const testPrintCommand = async (t, verbose, worker, isSync) => {30 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {verbose, worker, isSync});33 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {34 verbose,35 ...getStdioForFd3Option(verbose),36 worker,37 isSync,38 });39 t.is(getCommandLine(stderr), `${testTimestamp} [0] $ noop.js ${foobarString}`);40};4142test('Prints command, verbose "short"', testPrintCommand, 'short', false, false);
37 unmodified lines
80test('Prints command, verbose "short", fd-specific ipc, worker, sync', testPrintCommand, ipcShortOption, true, true);81test('Prints command, verbose "full", fd-specific ipc, worker, sync', testPrintCommand, ipcFullOption, true, true);8283const testNoPrintCommand = async (t, verbose, isSync) => {76 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {verbose, isSync});84 const {stderr} = await nestedSubprocess('noop.js', [foobarString], {verbose, ...getStdioForFd3Option(verbose), isSync});85 t.is(stderr, '');86};8788test('Does not print command, verbose "none"', testNoPrintCommand, 'none', false);
69 unmodified lines
158 t.is(getCommandLine(stderr), `${testTimestamp} [0] $ noop.js ${QUOTE}ã${QUOTE}`);159});160161test('Escapes color sequences from command', async t => {154 const {stderr} = await nestedSubprocess('noop.js', [foobarRed], {verbose: 'short'});162 const {stderr} = await nestedSubprocess('noop.js', [redFoobarString], {verbose: 'short'});163 t.true(getCommandLine(stderr).includes(`${QUOTE}\\u001b[31m${foobarString}\\u001b[39m${QUOTE}`));164});165166test('Escapes control characters from command', async t => {
3 unmodified lines
modified:test-d/arguments/specific.test-d.ts+10 added-10 removed
7 unmodified lines
8await execa('unicorns', {maxBuffer: {stdout: 0, stderr: 0} as const});9await execa('unicorns', {maxBuffer: {all: 0}});10await execa('unicorns', {maxBuffer: {fd1: 0}});11await execa('unicorns', {maxBuffer: {fd2: 0}});12await execa('unicorns', {maxBuffer: {fd3: 0}});12await execa('unicorns', {maxBuffer: {fd3: 0}, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});13await execa('unicorns', {maxBuffer: {ipc: 0}});14expectError(await execa('unicorns', {maxBuffer: {stdout: '0'}}));1516execaSync('unicorns', {maxBuffer: {}});
3 unmodified lines
20execaSync('unicorns', {maxBuffer: {stdout: 0, stderr: 0} as const});21execaSync('unicorns', {maxBuffer: {all: 0}});22execaSync('unicorns', {maxBuffer: {fd1: 0}});23execaSync('unicorns', {maxBuffer: {fd2: 0}});24execaSync('unicorns', {maxBuffer: {fd3: 0}});24execaSync('unicorns', {maxBuffer: {fd3: 0}, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});25execaSync('unicorns', {maxBuffer: {ipc: 0}});26expectError(execaSync('unicorns', {maxBuffer: {stdout: '0'}}));2728await execa('unicorns', {verbose: {}});
3 unmodified lines
32await execa('unicorns', {verbose: {stdout: 'none', stderr: 'none'} as const});33await execa('unicorns', {verbose: {all: 'none'}});34await execa('unicorns', {verbose: {fd1: 'none'}});35await execa('unicorns', {verbose: {fd2: 'none'}});36await execa('unicorns', {verbose: {fd3: 'none'}});36await execa('unicorns', {verbose: {fd3: 'none'}, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});37await execa('unicorns', {verbose: {ipc: 'none'}});38expectError(await execa('unicorns', {verbose: {stdout: 'other'}}));3940execaSync('unicorns', {verbose: {}});
3 unmodified lines
44execaSync('unicorns', {verbose: {stdout: 'none', stderr: 'none'} as const});45execaSync('unicorns', {verbose: {all: 'none'}});46execaSync('unicorns', {verbose: {fd1: 'none'}});47execaSync('unicorns', {verbose: {fd2: 'none'}});48execaSync('unicorns', {verbose: {fd3: 'none'}});48execaSync('unicorns', {verbose: {fd3: 'none'}, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});49execaSync('unicorns', {verbose: {ipc: 'none'}});50expectError(execaSync('unicorns', {verbose: {stdout: 'other'}}));5152await execa('unicorns', {stripFinalNewline: {}});
3 unmodified lines
56await execa('unicorns', {stripFinalNewline: {stdout: true, stderr: true} as const});57await execa('unicorns', {stripFinalNewline: {all: true}});58await execa('unicorns', {stripFinalNewline: {fd1: true}});59await execa('unicorns', {stripFinalNewline: {fd2: true}});60await execa('unicorns', {stripFinalNewline: {fd3: true}});60await execa('unicorns', {stripFinalNewline: {fd3: true}, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});61await execa('unicorns', {stripFinalNewline: {ipc: true}});62expectError(await execa('unicorns', {stripFinalNewline: {stdout: 'true'}}));6364execaSync('unicorns', {stripFinalNewline: {}});
3 unmodified lines
68execaSync('unicorns', {stripFinalNewline: {stdout: true, stderr: true} as const});69execaSync('unicorns', {stripFinalNewline: {all: true}});70execaSync('unicorns', {stripFinalNewline: {fd1: true}});71execaSync('unicorns', {stripFinalNewline: {fd2: true}});72execaSync('unicorns', {stripFinalNewline: {fd3: true}});72execaSync('unicorns', {stripFinalNewline: {fd3: true}, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});73execaSync('unicorns', {stripFinalNewline: {ipc: true}});74expectError(execaSync('unicorns', {stripFinalNewline: {stdout: 'true'}}));7576await execa('unicorns', {lines: {}});
3 unmodified lines
80await execa('unicorns', {lines: {stdout: true, stderr: true} as const});81await execa('unicorns', {lines: {all: true}});82await execa('unicorns', {lines: {fd1: true}});83await execa('unicorns', {lines: {fd2: true}});84await execa('unicorns', {lines: {fd3: true}});84await execa('unicorns', {lines: {fd3: true}, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});85await execa('unicorns', {lines: {ipc: true}});86expectError(await execa('unicorns', {lines: {stdout: 'true'}}));8788execaSync('unicorns', {lines: {}});
3 unmodified lines
92execaSync('unicorns', {lines: {stdout: true, stderr: true} as const});93execaSync('unicorns', {lines: {all: true}});94execaSync('unicorns', {lines: {fd1: true}});95execaSync('unicorns', {lines: {fd2: true}});96execaSync('unicorns', {lines: {fd3: true}});96execaSync('unicorns', {lines: {fd3: true}, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});97execaSync('unicorns', {lines: {ipc: true}});98expectError(execaSync('unicorns', {lines: {stdout: 'true'}}));99100await execa('unicorns', {buffer: {}});
3 unmodified lines
104await execa('unicorns', {buffer: {stdout: true, stderr: true} as const});105await execa('unicorns', {buffer: {all: true}});106await execa('unicorns', {buffer: {fd1: true}});107await execa('unicorns', {buffer: {fd2: true}});108await execa('unicorns', {buffer: {fd3: true}});108await execa('unicorns', {buffer: {fd3: true}, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});109await execa('unicorns', {buffer: {ipc: true}});110expectError(await execa('unicorns', {buffer: {stdout: 'true'}}));111112execaSync('unicorns', {buffer: {}});
3 unmodified lines
116execaSync('unicorns', {buffer: {stdout: true, stderr: true} as const});117execaSync('unicorns', {buffer: {all: true}});118execaSync('unicorns', {buffer: {fd1: true}});119execaSync('unicorns', {buffer: {fd2: true}});120execaSync('unicorns', {buffer: {fd3: true}});120execaSync('unicorns', {buffer: {fd3: true}, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});121execaSync('unicorns', {buffer: {ipc: true}});122expectError(execaSync('unicorns', {buffer: {stdout: 'true'}}));123124expectError(await execa('unicorns', {preferLocal: {}}));
35 unmodified lines
modified:test-d/return/no-buffer-specific.test-d.ts+7 added
43 unmodified lines
44expectType<string>(noBufferFd3Result.all);45expectType<undefined>(noBufferFd3Result.stdio[3]);46expectType<string>(noBufferFd3Result.stdio[4]);4748const noBufferIpcResult = await execa('unicorns', {buffer: {ipc: false}, ipc: true, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});49expectType<string>(noBufferIpcResult.stdio[3]);50expectType<[]>(noBufferIpcResult.ipcOutput);5152const noBufferStdoutResultSync = execaSync('unicorns', {all: true, buffer: {stdout: false}});53expectType<undefined>(noBufferStdoutResultSync.stdout);54expectType<undefined>(noBufferStdoutResultSync.stdio[1]);55expectType<string>(noBufferStdoutResultSync.stderr);
35 unmodified lines
91expectType<string>(noBufferFd3ResultSync.stdio[2]);92expectType<string>(noBufferFd3ResultSync.all);93expectType<undefined>(noBufferFd3ResultSync.stdio[3]);94expectType<string>(noBufferFd3ResultSync.stdio[4]);9596const noBufferIpcStdioResultSync = execaSync('unicorns', {buffer: {ipc: false}, stdio: ['pipe', 'pipe', 'pipe', 'pipe']});97expectType<string>(noBufferIpcStdioResultSync.stdio[3]);
modified:types/arguments/specific.d.ts+19 added-17 removed
27 unmodified lines
2829type FdNumberToFromOption<30 FdNumber extends string,31 GenericOptionKeys extends GenericFromOption,32> = FdNumber extends '1'33 ? 'stdout' extends GenericOptionKeys34 ? 'stdout'35 : 'fd1' extends GenericOptionKeys36 ? 'fd1'37 : 'all' extends GenericOptionKeys38 ? 'all'39 : never40 : FdNumber extends '2'41 ? 'stderr' extends GenericOptionKeys42 ? 'stderr'43 : 'fd2' extends GenericOptionKeys44 ? 'fd2'32> = FdNumber extends 'ipc'33 ? 'ipc' extends GenericOptionKeys34 ? 'ipc'35 : never36 : FdNumber extends '1'37 ? 'stdout' extends GenericOptionKeys38 ? 'stdout'39 : 'fd1' extends GenericOptionKeys40 ? 'fd1'41 : 'all' extends GenericOptionKeys42 ? 'all'43 : never44 : FdNumber extends '2'45 ? 'stderr' extends GenericOptionKeys46 ? 'stderr'48 : `fd${FdNumber}` extends GenericOptionKeys49 ? `fd${FdNumber}`50 : 'ipc' extends GenericOptionKeys51 ? 'ipc'47 : 'fd2' extends GenericOptionKeys48 ? 'fd2'49 : 'all' extends GenericOptionKeys50 ? 'all'51 : never52 : `fd${FdNumber}` extends GenericOptionKeys53 ? `fd${FdNumber}`54 : never;5556export {};