From cf4943dbd2b398e723fdb1493d7478b15e5c7223 Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Tue, 11 Mar 2025 10:58:09 -0700 Subject: [PATCH] Test empty string instead of undefined against regexp. --- cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli.js b/cli.js index cd5a47f..62194ff 100755 --- a/cli.js +++ b/cli.js @@ -8,7 +8,7 @@ import * as fs from 'node:fs/promises' const args = process.argv.slice(2) const hashes = [] let hash = args.pop() -while (/^[0-9A-Fa-f]{64}$/.test(hash)) { +while (/^[0-9A-Fa-f]{64}$/.test(hash ?? '')) { hashes.unshift(hash) hash = args.pop() } -- 2.34.1