From bd3307d709d5b2eb1567bc2a43c39eb9fa1e28c2 Mon Sep 17 00:00:00 2001 From: Will Bjorn <30843002+wibjorn@users.noreply.github.com> Date: Wed, 28 Oct 2020 14:24:32 -0700 Subject: [PATCH 1/2] Fix typo in index.d.ts --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 8e1050a94a..cb3363a738 100644 --- a/index.d.ts +++ b/index.d.ts @@ -434,7 +434,7 @@ declare const execa: { // Cancelling a spawned process const subprocess = execa('node'); - setTimeout(() => { spawned.cancel() }, 1000); + setTimeout(() => { subprocess.cancel() }, 1000); try { await subprocess; } catch (error) { From be1bb27b1eaafff9722faecc793147cdc662f36d Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Wed, 28 Oct 2020 22:40:09 +0100 Subject: [PATCH 2/2] Update index.d.ts --- index.d.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index cb3363a738..fbf199aa8c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -432,9 +432,15 @@ declare const execa: { console.log(stdout); //=> 'unicorns' + // Cancelling a spawned process + const subprocess = execa('node'); - setTimeout(() => { subprocess.cancel() }, 1000); + + setTimeout(() => { + subprocess.cancel() + }, 1000); + try { await subprocess; } catch (error) {