Apply dependencies update
[benchmarks-js.git] / random.js
index 272d8e6969c23f71c234cad66ca93d8ffbe889dd..c3e5c4a8383c3821c223c40921a95ea63da8bb3e 100644 (file)
--- a/random.js
+++ b/random.js
@@ -1,9 +1,9 @@
+const crypto = require('crypto')
 const Benchmark = require('benny')
 const {
   secureRandom,
   secureRandomWithRandomValues
 } = require('./benchmark-utils')
-const crypto = require('crypto')
 
 const maximum = 281474976710654
 
@@ -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))
     }