From 949b57b47307fdd065eebf4d701c443ae3ac6af5 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Fri, 5 Feb 2021 14:23:26 -0800 Subject: [PATCH] Improve types Summary: The any type was masking how the log object is actually initialised. Sorry for the deluge of drive-by diffs. Something more substantial is coming. Reviewed By: mweststrate Differential Revision: D26250580 fbshipit-source-id: 5ba3f450ac1a646616868a8fd8b3cb42fb14dcc8 --- desktop/app/src/devices/IOSDevice.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop/app/src/devices/IOSDevice.tsx b/desktop/app/src/devices/IOSDevice.tsx index 4fa9b9e51..4c3fe718c 100644 --- a/desktop/app/src/devices/IOSDevice.tsx +++ b/desktop/app/src/devices/IOSDevice.tsx @@ -40,7 +40,7 @@ type RawLogEntry = { }; export default class IOSDevice extends BaseDevice { - log: any; + log?: child_process.ChildProcessWithoutNullStreams; buffer: string; private recordingProcess?: ChildProcess; private recordingLocation?: string; @@ -49,7 +49,7 @@ export default class IOSDevice extends BaseDevice { super(serial, deviceType, title, 'iOS'); this.icon = 'icons/ios.svg'; this.buffer = ''; - this.log = this.startLogListener(); + this.startLogListener(); } screenshot(): Promise { @@ -128,7 +128,7 @@ export default class IOSDevice extends BaseDevice { }); this.log.on('exit', () => { - this.log = null; + this.log = undefined; }); } @@ -144,7 +144,7 @@ export default class IOSDevice extends BaseDevice { console.error('Could not parse iOS log stream.', e); // restart log stream this.log.kill(); - this.log = null; + this.log = undefined; this.startLogListener(retries - 1); } }