From: Chris Duncan Date: Tue, 11 Mar 2025 17:58:09 +0000 (-0700) Subject: Test empty string instead of undefined against regexp. X-Git-Tag: v3.1.0~9^2~21 X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=cf4943dbd2b398e723fdb1493d7478b15e5c7223;p=nano-pow.git Test empty string instead of undefined against regexp. --- 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() }