From 58607ca6415181e33e2b8adb02ea9462c7d7b294 Mon Sep 17 00:00:00 2001 From: Daniel Cassidy Date: Fri, 21 Jun 2019 22:17:20 +0100 Subject: [PATCH] node: Correct type of SpawnSyncReturns. (#36263) * node: Correct type of SpawnSyncReturns. * cross-spawn: Fix tests for updated node types * node: Correct SpawnSyncReturns in v10 and v11. --- types/cross-spawn/cross-spawn-tests.ts | 4 ++-- types/node/child_process.d.ts | 4 ++-- types/node/v10/child_process.d.ts | 4 ++-- types/node/v11/child_process.d.ts | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/types/cross-spawn/cross-spawn-tests.ts b/types/cross-spawn/cross-spawn-tests.ts index f6dac4ea72..4f25577a0b 100644 --- a/types/cross-spawn/cross-spawn-tests.ts +++ b/types/cross-spawn/cross-spawn-tests.ts @@ -12,8 +12,8 @@ const r1: Error | undefined = spawn.sync('foo').error; const r2: string[] = spawn.sync('foo').output; const r3: Buffer = spawn.sync('foo').stdout; const r4: Buffer = spawn.sync('foo').stderr; -const r5: number = spawn.sync('foo').status; -const r6: string = spawn.sync('foo').signal; +const r5: number | null = spawn.sync('foo').status; +const r6: string | null = spawn.sync('foo').signal; const r7: string = spawn.sync('foo', {encoding: 'utf8'}).stdout; spawn.sync('foo', ['bar']); diff --git a/types/node/child_process.d.ts b/types/node/child_process.d.ts index 20c4f4cc97..f26a6385c2 100644 --- a/types/node/child_process.d.ts +++ b/types/node/child_process.d.ts @@ -310,8 +310,8 @@ declare module "child_process" { output: string[]; stdout: T; stderr: T; - status: number; - signal: string; + status: number | null; + signal: string | null; error?: Error; } function spawnSync(command: string): SpawnSyncReturns; diff --git a/types/node/v10/child_process.d.ts b/types/node/v10/child_process.d.ts index 442e8ae654..125b275931 100644 --- a/types/node/v10/child_process.d.ts +++ b/types/node/v10/child_process.d.ts @@ -292,8 +292,8 @@ declare module "child_process" { output: string[]; stdout: T; stderr: T; - status: number; - signal: string; + status: number | null; + signal: string | null; error?: Error; } function spawnSync(command: string): SpawnSyncReturns; diff --git a/types/node/v11/child_process.d.ts b/types/node/v11/child_process.d.ts index 20c4f4cc97..f26a6385c2 100644 --- a/types/node/v11/child_process.d.ts +++ b/types/node/v11/child_process.d.ts @@ -310,8 +310,8 @@ declare module "child_process" { output: string[]; stdout: T; stderr: T; - status: number; - signal: string; + status: number | null; + signal: string | null; error?: Error; } function spawnSync(command: string): SpawnSyncReturns;