From 473bbba2ce08402991e768aeca6b20dbf2370677 Mon Sep 17 00:00:00 2001 From: GP Date: Fri, 17 Apr 2020 19:59:20 +0530 Subject: [PATCH] Try to see if we're comparing the empty array returned by default. --- src/main.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index 56446e30..45d6fb3e 100644 --- a/src/main.ts +++ b/src/main.ts @@ -18,7 +18,8 @@ const getOptionalArray = (name: string, def: string[] = []) => { const input = getInput(name, { required: false }); return !input.length ? def : input.split(' '); }; -const flattenArray = (arr: any[]): any[] => [].concat(...arr); +const areObjectsEqual = (obj1: object | [], obj2: object | []): boolean => + JSON.stringify(obj1) === JSON.stringify(obj2); export function downloadToFile( url: string, @@ -104,10 +105,7 @@ export function run( return reject(err); } - if ( - Array.isArray(coverageLocations) && - flattenArray(coverageLocations).length > 0 - ) { + if (!areObjectsEqual(coverageLocations, [])) { debug( `Parsing ${ coverageLocations.length