From: Jérôme Benoit Date: Fri, 7 Apr 2023 10:11:29 +0000 (+0200) Subject: Fix undefined only check X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d7a92496875c8d1cb27c1ccac92089d194348743;p=benchmarks-js.git Fix undefined only check Signed-off-by: Jérôme Benoit --- diff --git a/prepare.js b/prepare.js index 433f6f6..d879b74 100644 --- a/prepare.js +++ b/prepare.js @@ -1,4 +1,4 @@ -const isCIEnvironment = process.env.CI !== undefined +const isCIEnvironment = process.env.CI != null if (isCIEnvironment === false) { // eslint-disable-next-line n/no-unpublished-require require('husky').install() diff --git a/random.js b/random.js index 272d8e6..1518347 100644 --- a/random.js +++ b/random.js @@ -74,7 +74,7 @@ Benchmark.suite( ), Benchmark.add('Crypto random integer generator', (max = maximum, min = 0) => { max = Math.floor(max) - if (min !== undefined && min !== 0) { + if (min != null && min !== 0) { min = Math.ceil(min) return Math.floor(crypto.randomInt(min, max + 1)) }