Skip to content
Myr

Limit breaking changes with types (#682)

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

authored by ehmicky · committed by GitHub · parent add2f65 · Browse files · 2 files+96 added−89 removed
This commit

State

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

Diff stats

2 files+96 added−89 removed

  • other:+96 added−89 removed

2 files+96 added−89 removed

modified:index.d.ts+42 added-35 removed
81 unmodified lines
8283// Whether `result.stdout|stderr|all` is `undefined`, excluding the `buffer` option84type IgnoresStreamResult<85 StreamIndex extends string,86 OptionsType extends Options = Options,86 OptionsType extends CommonOptions = CommonOptions,87 // `result.stdin` is always `undefined`88> = StreamIndex extends '0' ? true89 // When using `stdout|stderr: 'inherit'`, or `'ignore'`, etc. , `result.std*` is `undefined`90 : OptionsType[TupleItem<StdioOptionNames, StreamIndex>] extends NoOutputStdioOption ? true
22 unmodified lines
113114// Whether `result.stdout|stderr|all` is `undefined`115type IgnoresStreamOutput<116 StreamIndex extends string,117 OptionsType extends Options = Options,117 OptionsType extends CommonOptions = CommonOptions,118> = OptionsType extends {buffer: false} ? true119 : IgnoresStreamResult<StreamIndex, OptionsType> extends true ? true : false;120121// Type of `result.stdout|stderr`122type StdioOutput<123 StreamIndex extends string,124 OptionsType extends Options = Options,124 OptionsType extends CommonOptions = CommonOptions,125> = IgnoresStreamOutput<StreamIndex, OptionsType> extends true126 ? undefined127 : StreamResult<OptionsType>;128129type StreamResult<OptionsType extends Options = Options> =129type StreamResult<OptionsType extends CommonOptions = CommonOptions> =130 // Default value for `encoding`, when `OptionsType` is `{}`131 unknown extends OptionsType['encoding'] ? string132 // Any value for `encoding`, when `OptionsType` is `Options`133 : EncodingOption extends OptionsType['encoding'] ? Uint8Array | string
7 unmodified lines
141 ? StdioOutput<'2', OptionsType>142 : StdioOutput<'1', OptionsType>;143144// Type of `result.stdio`145type StdioArrayOutput<OptionsType extends Options = Options> = MapStdioOptions<145type StdioArrayOutput<OptionsType extends CommonOptions = CommonOptions> = MapStdioOptions<146OptionsType['stdio'] extends StdioOptionsArray ? OptionsType['stdio'] : ['pipe', 'pipe', 'pipe'],147OptionsType148>;149150type MapStdioOptions<151 StdioOptionsArrayType extends StdioOptionsArray,152 OptionsType extends Options = Options,152 OptionsType extends CommonOptions = CommonOptions,153> = {154 [StreamIndex in keyof StdioOptionsArrayType]: StdioOutput<155 StreamIndex extends string ? StreamIndex : string,156 OptionsType157 >158};159160type StricterOptions<161 WideOptions extends CommonOptions,162 StrictOptions extends CommonOptions,163> = keyof WideOptions extends never ? {} : WideOptions & StrictOptions;164160export type Options<IsSync extends boolean = boolean> = {165type CommonOptions<IsSync extends boolean = boolean> = {166 /**167 Prefer locally installed binaries when looking for a binary to execute.168169 If you `$ npm install foo`, you can then `execa('foo')`.
288 unmodified lines
458 */459 readonly signal?: AbortSignal;460});461462export type Options = CommonOptions<false>;457export type SyncOptions = Options<true>;463export type SyncOptions = CommonOptions<true>;464465export type NodeOptions<OptionsType extends Options = Options> = {466 /**467 The Node.js executable to use.
19 unmodified lines
487- timing out488- being canceled489- there's not enough memory or there are already too many child processes490*/485export type ExecaReturnValue<IsSync extends boolean = boolean, OptionsType extends Options = Options> = {491type ExecaCommonReturnValue<IsSync extends boolean = boolean, OptionsType extends CommonOptions = CommonOptions> = {492 /**493 The file and arguments that were run, for logging purposes.494495 This is not escaped and should not be executed directly as a process, including using `execa()` or `execaCommand()`.
90 unmodified lines
586 */587 all?: AllOutput<OptionsType>;588});589584export type ExecaSyncReturnValue<OptionsType extends Options = Options> = ExecaReturnValue<true, OptionsType>;590export type ExecaReturnValue<OptionsType extends Options = Options> = ExecaCommonReturnValue<false, OptionsType>;591export type ExecaSyncReturnValue<OptionsType extends SyncOptions = SyncOptions> = ExecaCommonReturnValue<true, OptionsType>;592586export type ExecaError<IsSync extends boolean = boolean, OptionsType extends Options = Options> = {593type ExecaCommonError = {594 /**595 Error message when the child process failed to run. In addition to the underlying error message, it also contains some information related to why the child process errored.596597 The child process `stderr`, `stdout` and other file descriptors' output are appended to the end, separated with newlines and not interleaved.
10 unmodified lines
608609 This is `undefined` unless the child process exited due to an `error` event or a timeout.610 */611 originalMessage?: string;605} & Error & ExecaReturnValue<IsSync, OptionsType>;612} & Error;613607export type ExecaSyncError<OptionsType extends Options = Options> = ExecaError<true, OptionsType>;614export type ExecaError<OptionsType extends Options = Options> = ExecaCommonError & ExecaReturnValue<OptionsType>;615export type ExecaSyncError<OptionsType extends SyncOptions = SyncOptions> = ExecaCommonError & ExecaSyncReturnValue<OptionsType>;616617export type KillOptions = {618 /**619 Milliseconds to wait for the child process to terminate before sending `SIGKILL`.
15 unmodified lines
635 */636 all?: Readable;637638 catch<ResultType = never>(631 onRejected?: (reason: ExecaError<false, OptionsType>) => ResultType | PromiseLike<ResultType>632 ): Promise<ExecaReturnValue<false, OptionsType> | ResultType>;639 onRejected?: (reason: ExecaError<OptionsType>) => ResultType | PromiseLike<ResultType>640 ): Promise<ExecaReturnValue<OptionsType> | ResultType>;641642 /**643 Same as the original [`child_process#kill()`](https://nodejs.org/api/child_process.html#child_process_subprocess_kill_signal), except if `signal` is `SIGTERM` (the default value) and the child process is not terminated after 5 seconds, force it by sending `SIGKILL`. Note that this graceful termination does not work on Windows, because Windows [doesn't support signals](https://nodejs.org/api/process.html#process_signal_events) (`SIGKILL` and `SIGTERM` has the same effect of force-killing the process immediately.) If you want to achieve graceful termination on Windows, you have to use other means, such as [`taskkill`](https://github.com/sindresorhus/taskkill).644 */
35 unmodified lines
680};681682export type ExecaChildProcess<OptionsType extends Options = Options> = ChildProcess &683ExecaChildPromise<OptionsType> &676Promise<ExecaReturnValue<false, OptionsType>>;684Promise<ExecaReturnValue<OptionsType>>;685686/**687Executes a command using `file ...arguments`. `file` is a string or a file URL. `arguments` are an array of strings. Returns a `childProcess`.688
104 unmodified lines
793 });794}, 1000);795```796*/789export function execa<OptionsType extends Options<false> = {}>(797export function execa<OptionsType extends Options = {}>(798 file: string | URL,799 arguments?: readonly string[],800 options?: OptionsType,801): ExecaChildProcess<OptionsType>;794export function execa<OptionsType extends Options<false> = {}>(802export function execa<OptionsType extends Options = {}>(803 file: string | URL,804 options?: OptionsType,805): ExecaChildProcess<OptionsType>;806
58 unmodified lines
865 \*\/866}867```868*/861export function execaSync<OptionsType extends Options<true> = {}>(869export function execaSync<OptionsType extends SyncOptions = {}>(870 file: string | URL,871 arguments?: readonly string[],872 options?: OptionsType,865): ExecaReturnValue<true, OptionsType>;866export function execaSync<OptionsType extends Options<true> = {}>(873): ExecaSyncReturnValue<OptionsType>;874export function execaSync<OptionsType extends SyncOptions = {}>(875 file: string | URL,876 options?: OptionsType,869): ExecaReturnValue<true, OptionsType>;877): ExecaSyncReturnValue<OptionsType>;878879/**880Executes a command. The `command` string includes both the `file` and its `arguments`. Returns a `childProcess`.881
15 unmodified lines
897console.log(stdout);898//=> 'unicorns'899```900*/893export function execaCommand<OptionsType extends Options<false> = {}>(901export function execaCommand<OptionsType extends Options = {}>(902 command: string,903 options?: OptionsType904): ExecaChildProcess<OptionsType>;905
14 unmodified lines
920console.log(stdout);921//=> 'unicorns'922```923*/916export function execaCommandSync<OptionsType extends Options<true> = {}>(924export function execaCommandSync<OptionsType extends SyncOptions = {}>(925 command: string,926 options?: OptionsType919): ExecaReturnValue<true, OptionsType>;927): ExecaSyncReturnValue<OptionsType>;928921type TemplateExpression = string | number | ExecaReturnValue922| Array<string | number | ExecaReturnValue>;929type TemplateExpression = string | number | ExecaCommonReturnValue930| Array<string | number | ExecaCommonReturnValue>;931924type Execa$<OptionsType extends Options = {}> = {932type Execa$<OptionsType extends CommonOptions = {}> = {933 /**934 Returns a new instance of `$` but with different default `options`. Consecutive calls are merged to previous ones.935936 This can be used to either:
15 unmodified lines
952 await $$`echo rainbows`;953 //=> 'rainbows'954 ```955 */948 <NewOptionsType extends Options = {}>956 <NewOptionsType extends CommonOptions = {}>957 (options: NewOptionsType):958 Execa$<OptionsType & NewOptionsType>;959952 <NewOptionsType extends Options = {}>960 (templates: TemplateStringsArray, ...expressions: TemplateExpression[]):954 ExecaChildProcess<OptionsType & NewOptionsType>;961 ExecaChildProcess<StricterOptions<OptionsType, Options>>;962963 /**964 Same as $\`command\` but synchronous.965
43 unmodified lines
1009 */1010 sync(1011 templates: TemplateStringsArray,1012 ...expressions: TemplateExpression[]1006 ): ExecaReturnValue<true, OptionsType>;1013 ): ExecaSyncReturnValue<StricterOptions<OptionsType, SyncOptions>>;10141015 /**1016 Same as $\`command\` but synchronous.1017
43 unmodified lines
1061 */1062 s(1063 templates: TemplateStringsArray,1064 ...expressions: TemplateExpression[]1058 ): ExecaReturnValue<true, OptionsType>;1065 ): ExecaSyncReturnValue<StricterOptions<OptionsType, SyncOptions>>;1066};10671068/**1069Executes a command. The `command` string includes both the `file` and its `arguments`. Returns a `childProcess`.
75 unmodified lines
11451146await execaNode('scriptPath', ['argument']);1147```1148*/1142export function execaNode<OptionsType extends NodeOptions<Options<false>> = {}>(1149export function execaNode<OptionsType extends NodeOptions = {}>(1150 scriptPath: string | URL,1151 arguments?: readonly string[],1152 options?: OptionsType1153): ExecaChildProcess<OptionsType>;1147export function execaNode<OptionsType extends NodeOptions<Options<false>> = {}>(1154export function execaNode<OptionsType extends NodeOptions = {}>(1155 scriptPath: string | URL,1156 options?: OptionsType1157): ExecaChildProcess<OptionsType>;
modified:index.test-d.ts+54 added-54 removed
238 unmodified lines
239240 const ignoreFd3Result = await execa('unicorns', {stdio: ['pipe', 'pipe', 'pipe', 'ignore']});241 expectType<undefined>(ignoreFd3Result.stdio[3]);242} catch (error: unknown) {243 const execaError = error as ExecaError<false>;243 const execaError = error as ExecaError;244245 expectType<string>(execaError.message);246 expectType<number | undefined>(execaError.exitCode);247 expectType<boolean>(execaError.failed);
7 unmodified lines
255 expectType<string | undefined>(execaError.originalMessage);256257 expectType<undefined>(execaError.stdio[0]);258259 const execaStringError = error as ExecaError<false, {}>;259 const execaStringError = error as ExecaError<{}>;260 expectType<string>(execaStringError.stdout);261 expectType<string>(execaStringError.stdio[1]);262 expectType<string>(execaStringError.stderr);263 expectType<string>(execaStringError.stdio[2]);264 expectType<string | undefined>(execaStringError.all);265266 const execaBufferError = error as ExecaError<false, {encoding: 'buffer'}>;266 const execaBufferError = error as ExecaError<{encoding: 'buffer'}>;267 expectType<Uint8Array>(execaBufferError.stdout);268 expectType<Uint8Array>(execaBufferError.stdio[1]);269 expectType<Uint8Array>(execaBufferError.stderr);270 expectType<Uint8Array>(execaBufferError.stdio[2]);271 expectType<Uint8Array | undefined>(execaBufferError.all);272273 const noBufferError = error as ExecaError<false, {buffer: false}>;273 const noBufferError = error as ExecaError<{buffer: false}>;274 expectType<undefined>(noBufferError.stdout);275 expectType<undefined>(noBufferError.stdio[1]);276 expectType<undefined>(noBufferError.stderr);277 expectType<undefined>(noBufferError.stdio[2]);278 expectType<undefined>(noBufferError.all);279280 const ignoreStdoutError = error as ExecaError<false, {stdout: 'ignore'}>;280 const ignoreStdoutError = error as ExecaError<{stdout: 'ignore'}>;281 expectType<undefined>(ignoreStdoutError.stdout);282 expectType<undefined>(ignoreStdoutError.stdio[1]);283 expectType<string>(ignoreStdoutError.stderr);284 expectType<string>(ignoreStdoutError.stdio[2]);285 expectType<string | undefined>(ignoreStdoutError.all);286287 const ignoreStderrError = error as ExecaError<false, {stderr: 'ignore'}>;287 const ignoreStderrError = error as ExecaError<{stderr: 'ignore'}>;288 expectType<string>(ignoreStderrError.stdout);289 expectType<undefined>(ignoreStderrError.stderr);290 expectType<string | undefined>(ignoreStderrError.all);291292 const inheritStdoutError = error as ExecaError<false, {stdout: 'inherit'}>;292 const inheritStdoutError = error as ExecaError<{stdout: 'inherit'}>;293 expectType<undefined>(inheritStdoutError.stdout);294 expectType<string>(inheritStdoutError.stderr);295 expectType<string | undefined>(inheritStdoutError.all);296297 const inheritStderrError = error as ExecaError<false, {stderr: 'inherit'}>;297 const inheritStderrError = error as ExecaError<{stderr: 'inherit'}>;298 expectType<string>(inheritStderrError.stdout);299 expectType<undefined>(inheritStderrError.stderr);300 expectType<string | undefined>(inheritStderrError.all);301302 const ipcStdoutError = error as ExecaError<false, {stdout: 'ipc'}>;302 const ipcStdoutError = error as ExecaError<{stdout: 'ipc'}>;303 expectType<undefined>(ipcStdoutError.stdout);304 expectType<string>(ipcStdoutError.stderr);305 expectType<string | undefined>(ipcStdoutError.all);306307 const ipcStderrError = error as ExecaError<false, {stderr: 'ipc'}>;307 const ipcStderrError = error as ExecaError<{stderr: 'ipc'}>;308 expectType<string>(ipcStderrError.stdout);309 expectType<undefined>(ipcStderrError.stderr);310 expectType<string | undefined>(ipcStderrError.all);311312 const numberStdoutError = error as ExecaError<false, {stdout: 1}>;312 const numberStdoutError = error as ExecaError<{stdout: 1}>;313 expectType<undefined>(numberStdoutError.stdout);314 expectType<string>(numberStdoutError.stderr);315 expectType<string | undefined>(numberStdoutError.all);316317 const numberStderrError = error as ExecaError<false, {stderr: 1}>;317 const numberStderrError = error as ExecaError<{stderr: 1}>;318 expectType<string>(numberStderrError.stdout);319 expectType<undefined>(numberStderrError.stderr);320 expectType<string | undefined>(numberStderrError.all);321322 const streamStdoutError = error as ExecaError<false, {stdout: typeof process.stdout}>;322 const streamStdoutError = error as ExecaError<{stdout: typeof process.stdout}>;323 expectType<undefined>(streamStdoutError.stdout);324 expectType<string>(streamStdoutError.stderr);325 expectType<string | undefined>(streamStdoutError.all);326327 const streamStderrError = error as ExecaError<false, {stderr: typeof process.stdout}>;327 const streamStderrError = error as ExecaError<{stderr: typeof process.stdout}>;328 expectType<string>(streamStderrError.stdout);329 expectType<undefined>(streamStderrError.stderr);330 expectType<string | undefined>(streamStderrError.all);331}
71 unmodified lines
403 expectType<string>(numberStderrResult.stdout);404 expectType<undefined>(numberStderrResult.stderr);405 expectError(numberStderrResult.all);406} catch (error: unknown) {407 const execaError = error as ExecaError<true>;407 const execaError = error as ExecaSyncError;408409 expectType<ExecaSyncError>(execaError);410 expectType<string>(execaError.message);411 expectType<number | undefined>(execaError.exitCode);
8 unmodified lines
420 expectType<string | undefined>(execaError.originalMessage);421422 expectType<undefined>(execaError.stdio[0]);423424 const execaStringError = error as ExecaError<true, {}>;424 const execaStringError = error as ExecaSyncError<{}>;425 expectType<string>(execaStringError.stdout);426 expectType<string>(execaStringError.stdio[1]);427 expectType<string>(execaStringError.stderr);428 expectType<string>(execaStringError.stdio[2]);429 expectError(execaStringError.all);430431 const execaBufferError = error as ExecaError<true, {encoding: 'buffer'}>;431 const execaBufferError = error as ExecaSyncError<{encoding: 'buffer'}>;432 expectType<Uint8Array>(execaBufferError.stdout);433 expectType<Uint8Array>(execaBufferError.stdio[1]);434 expectType<Uint8Array>(execaBufferError.stderr);435 expectType<Uint8Array>(execaBufferError.stdio[2]);436 expectError(execaBufferError.all);437438 const ignoreStdoutError = error as ExecaError<true, {stdout: 'ignore'}>;438 const ignoreStdoutError = error as ExecaSyncError<{stdout: 'ignore'}>;439 expectType<undefined>(ignoreStdoutError.stdout);440 expectType<undefined>(ignoreStdoutError.stdio[1]);441 expectType<string>(ignoreStdoutError.stderr);442 expectType<string>(ignoreStdoutError.stdio[2]);443 expectError(ignoreStdoutError.all);444445 const ignoreStderrError = error as ExecaError<true, {stderr: 'ignore'}>;445 const ignoreStderrError = error as ExecaSyncError<{stderr: 'ignore'}>;446 expectType<string>(ignoreStderrError.stdout);447 expectType<undefined>(ignoreStderrError.stderr);448 expectError(ignoreStderrError.all);449450 const inheritStdoutError = error as ExecaError<true, {stdout: 'inherit'}>;450 const inheritStdoutError = error as ExecaSyncError<{stdout: 'inherit'}>;451 expectType<undefined>(inheritStdoutError.stdout);452 expectType<string>(inheritStdoutError.stderr);453 expectError(inheritStdoutError.all);454455 const inheritStderrError = error as ExecaError<true, {stderr: 'inherit'}>;455 const inheritStderrError = error as ExecaSyncError<{stderr: 'inherit'}>;456 expectType<string>(inheritStderrError.stdout);457 expectType<undefined>(inheritStderrError.stderr);458 expectError(inheritStderrError.all);459460 const ipcStdoutError = error as ExecaError<true, {stdout: 'ipc'}>;460 const ipcStdoutError = error as ExecaSyncError<{stdout: 'ipc'}>;461 expectType<undefined>(ipcStdoutError.stdout);462 expectType<string>(ipcStdoutError.stderr);463 expectError(ipcStdoutError.all);464465 const ipcStderrError = error as ExecaError<true, {stderr: 'ipc'}>;465 const ipcStderrError = error as ExecaSyncError<{stderr: 'ipc'}>;466 expectType<string>(ipcStderrError.stdout);467 expectType<undefined>(ipcStderrError.stderr);468 expectError(ipcStderrError.all);469470 const numberStdoutError = error as ExecaError<true, {stdout: 1}>;470 const numberStdoutError = error as ExecaSyncError<{stdout: 1}>;471 expectType<undefined>(numberStdoutError.stdout);472 expectType<string>(numberStdoutError.stderr);473 expectError(numberStdoutError.all);474475 const numberStderrError = error as ExecaError<true, {stderr: 1}>;475 const numberStderrError = error as ExecaSyncError<{stderr: 1}>;476 expectType<string>(numberStderrError.stdout);477 expectType<undefined>(numberStderrError.stderr);478 expectError(numberStderrError.all);479}
438 unmodified lines
918919expectError(execa(['unicorns', 'arg']));920expectType<ExecaChildProcess>(execa('unicorns'));921expectType<ExecaChildProcess>(execa(fileUrl));922expectType<ExecaReturnValue<false>>(await execa('unicorns'));922expectType<ExecaReturnValue>(await execa('unicorns'));923expectAssignable<{stdout: string}>(await execa('unicorns'));924expectAssignable<{stdout: Uint8Array}>(await execa('unicorns', {encoding: 'buffer'}));925expectAssignable<{stdout: string}>(await execa('unicorns', ['foo']));926expectAssignable<{stdout: Uint8Array}>(await execa('unicorns', ['foo'], {encoding: 'buffer'}));927928expectError(execaSync(['unicorns', 'arg']));929expectAssignable<ExecaReturnValue<true>>(execaSync('unicorns'));930expectAssignable<ExecaReturnValue<true>>(execaSync(fileUrl));929expectAssignable<ExecaSyncReturnValue>(execaSync('unicorns'));930expectAssignable<ExecaSyncReturnValue>(execaSync(fileUrl));931expectAssignable<{stdout: string}>(execaSync('unicorns'));932expectAssignable<{stdout: Uint8Array}>(execaSync('unicorns', {encoding: 'buffer'}));933expectAssignable<{stdout: string}>(execaSync('unicorns', ['foo']));934expectAssignable<{stdout: Uint8Array}>(execaSync('unicorns', ['foo'], {encoding: 'buffer'}));935936expectType<ExecaChildProcess>(execaCommand('unicorns'));937expectType<ExecaReturnValue<false>>(await execaCommand('unicorns'));937expectType<ExecaReturnValue>(await execaCommand('unicorns'));938expectAssignable<{stdout: string}>(await execaCommand('unicorns'));939expectAssignable<{stdout: Uint8Array}>(await execaCommand('unicorns', {encoding: 'buffer'}));940expectAssignable<{stdout: string}>(await execaCommand('unicorns foo'));941expectAssignable<{stdout: Uint8Array}>(await execaCommand('unicorns foo', {encoding: 'buffer'}));942943expectAssignable<ExecaReturnValue<true>>(execaCommandSync('unicorns'));943expectAssignable<ExecaSyncReturnValue>(execaCommandSync('unicorns'));944expectAssignable<{stdout: string}>(execaCommandSync('unicorns'));945expectAssignable<{stdout: Uint8Array}>(execaCommandSync('unicorns', {encoding: 'buffer'}));946expectAssignable<{stdout: string}>(execaCommandSync('unicorns foo'));947expectAssignable<{stdout: Uint8Array}>(execaCommandSync('unicorns foo', {encoding: 'buffer'}));948949expectError(execaNode(['unicorns', 'arg']));950expectType<ExecaChildProcess>(execaNode('unicorns'));951expectType<ExecaReturnValue<false>>(await execaNode('unicorns'));952expectType<ExecaReturnValue<false>>(await execaNode(fileUrl));951expectType<ExecaReturnValue>(await execaNode('unicorns'));952expectType<ExecaReturnValue>(await execaNode(fileUrl));953expectAssignable<{stdout: string}>(await execaNode('unicorns'));954expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', {encoding: 'buffer'}));955expectAssignable<{stdout: string}>(await execaNode('unicorns', ['foo']));956expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', ['foo'], {encoding: 'buffer'}));
5 unmodified lines
962expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', {nodeOptions: ['--async-stack-traces'], encoding: 'buffer'}));963expectAssignable<{stdout: string}>(await execaNode('unicorns', ['foo'], {nodeOptions: ['--async-stack-traces']}));964expectAssignable<{stdout: Uint8Array}>(await execaNode('unicorns', ['foo'], {nodeOptions: ['--async-stack-traces'], encoding: 'buffer'}));965966expectType<ExecaChildProcess>($`unicorns`);967expectType<ExecaReturnValue<false>>(await $`unicorns`);968expectAssignable<ExecaReturnValue<true>>($.sync`unicorns`);969expectAssignable<ExecaReturnValue<true>>($.s`unicorns`);966expectAssignable<ExecaChildProcess>($`unicorns`);967expectAssignable<ExecaReturnValue>(await $`unicorns`);968expectAssignable<ExecaSyncReturnValue>($.sync`unicorns`);969expectAssignable<ExecaSyncReturnValue>($.s`unicorns`);970971expectAssignable<ExecaChildProcess>($({})`unicorns`);972expectAssignable<{stdout: string}>(await $({})`unicorns`);973expectAssignable<{stdout: string}>($({}).sync`unicorns`);
25 unmodified lines
999expectAssignable<ExecaChildProcess>($({})({encoding: 'buffer'})`unicorns foo`);1000expectAssignable<{stdout: Uint8Array}>(await $({})({encoding: 'buffer'})`unicorns foo`);1001expectAssignable<{stdout: Uint8Array}>($({})({encoding: 'buffer'}).sync`unicorns foo`);10021003expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${'foo'}`);1004expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${'foo'}`);1005expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${1}`);1006expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${1}`);1007expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${['foo', 'bar']}`);1008expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${['foo', 'bar']}`);1009expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${[1, 2]}`);1010expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${[1, 2]}`);1011expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${await $`echo foo`}`);1012expectError<ExecaReturnValue<false>>(await $`unicorns ${$`echo foo`}`);1013expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${$.sync`echo foo`}`);1014expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${[await $`echo foo`, 'bar']}`);1015expectError<ExecaReturnValue<false>>(await $`unicorns ${[$`echo foo`, 'bar']}`);1016expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${[$.sync`echo foo`, 'bar']}`);1017expectAssignable<ExecaReturnValue<false>>(await $`unicorns ${true.toString()}`);1018expectAssignable<ExecaReturnValue<true>>($.sync`unicorns ${false.toString()}`);1019expectError<ExecaReturnValue<false>>(await $`unicorns ${true}`);1020expectError<ExecaReturnValue<true>>($.sync`unicorns ${false}`);1003expectAssignable<ExecaReturnValue>(await $`unicorns ${'foo'}`);1004expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${'foo'}`);1005expectAssignable<ExecaReturnValue>(await $`unicorns ${1}`);1006expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${1}`);1007expectAssignable<ExecaReturnValue>(await $`unicorns ${['foo', 'bar']}`);1008expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${['foo', 'bar']}`);1009expectAssignable<ExecaReturnValue>(await $`unicorns ${[1, 2]}`);1010expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${[1, 2]}`);1011expectAssignable<ExecaReturnValue>(await $`unicorns ${await $`echo foo`}`);1012expectError<ExecaReturnValue>(await $`unicorns ${$`echo foo`}`);1013expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${$.sync`echo foo`}`);1014expectAssignable<ExecaReturnValue>(await $`unicorns ${[await $`echo foo`, 'bar']}`);1015expectError<ExecaReturnValue>(await $`unicorns ${[$`echo foo`, 'bar']}`);1016expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${[$.sync`echo foo`, 'bar']}`);1017expectAssignable<ExecaReturnValue>(await $`unicorns ${true.toString()}`);1018expectAssignable<ExecaSyncReturnValue>($.sync`unicorns ${false.toString()}`);1019expectError<ExecaReturnValue>(await $`unicorns ${true}`);1020expectError<ExecaSyncReturnValue>($.sync`unicorns ${false}`);