From f6a33d407644a2b42a1564e721f351c9e80d6a9a Mon Sep 17 00:00:00 2001 From: Frazer Smith Date: Sun, 5 Jan 2025 10:24:56 +0000 Subject: [PATCH] refactor: remove unused catch bindings --- index.js | 4 ++-- install.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 8a1656d..741c016 100644 --- a/index.js +++ b/index.js @@ -153,7 +153,7 @@ Hook.prototype.log = function log (lines, exit) { */ Hook.prototype.initialize = function initialize () { ['git', 'npm'].forEach(function each (binary) { - try { this[binary] = which.sync(binary) } catch (e) {} + try { this[binary] = which.sync(binary) } catch {} }, this) // @@ -164,7 +164,7 @@ Hook.prototype.initialize = function initialize () { try { process.env.PATH += path.delimiter + path.dirname(process.env._) this.npm = which.sync('npm') - } catch (e) { + } catch { return this.log(this.format(Hook.log.binary, 'npm'), 0) } } diff --git a/install.js b/install.js index e6d4f6f..4ce2bf2 100644 --- a/install.js +++ b/install.js @@ -91,7 +91,7 @@ if (exists(precommit) && !fs.lstatSync(precommit).isSymbolicLink()) { // We cannot create a symlink over an existing file so make sure it's gone and // finish the installation process. // -try { fs.unlinkSync(precommit) } catch (e) {} +try { fs.unlinkSync(precommit) } catch {} // Create generic precommit hook that launches this modules hook (as well // as stashing - unstashing the unstaged changes)