From 782953741f54ad130dc77362900619134cd4fa98 Mon Sep 17 00:00:00 2001 From: Vince Au Date: Thu, 12 May 2022 00:11:05 +1000 Subject: [PATCH] refactor: remove type checks from extractDmg --- src/dolphin/install/extractDmg.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/dolphin/install/extractDmg.ts b/src/dolphin/install/extractDmg.ts index 1d0d1288b..aa84a1296 100644 --- a/src/dolphin/install/extractDmg.ts +++ b/src/dolphin/install/extractDmg.ts @@ -6,12 +6,8 @@ import dmg from "dmg"; import * as fs from "fs-extra"; export async function extractDmg(filename: string, destination: string): Promise { - if (typeof filename !== "string" || !filename.endsWith(".dmg")) { - throw new TypeError(`Expected the path of a dmg file, got ${typeof filename}`); - } - - if (destination && typeof destination !== "string") { - throw new TypeError(`Expected the destination to be a string, got ${typeof destination}`); + if (!filename.endsWith(".dmg")) { + throw new Error(`Expected a dmg file, got ${filename}`); } const mountPath = await mountDmg(filename);