From d7a92496875c8d1cb27c1ccac92089d194348743 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 7 Apr 2023 12:11:29 +0200 Subject: [PATCH] Fix undefined only check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- prepare.js | 2 +- random.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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)) } -- 2.34.1