[Pkg-javascript-commits] [node-diffie-hellman] 65/88: fix split logic

Bastien Roucariès rouca at moszumanska.debian.org
Thu May 4 10:19:17 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-diffie-hellman.

commit ed2ea465d024b13347b3d6e378c34314c8dced2b
Author: Calvin Metcalf <calvin.metcalf at gmail.com>
Date:   Mon Oct 26 18:31:30 2015 -0400

    fix split logic
---
 test.js | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/test.js b/test.js
index 589713f..3aea4e6 100644
--- a/test.js
+++ b/test.js
@@ -6,7 +6,16 @@ var mods = [
    'modp1', 'modp2', 'modp5', 'modp14', 'modp15', 'modp16', 'modp17', 'modp18'
 ];
 function isNode10() {
-  return process.version && process.version.split('.').length === 3 && parseInt(process.version.split('.')[1], 10) === 10 && process.version.split('.')[0] === 'v0';
+  if (!process.version) {
+    return false;
+  }
+  var split = process.version.split('.');
+  if (split.length !== 3) {
+    return false;
+  }
+  if (parseInt(split[1], 10) === 10 && split[0] === 'v0') {
+    return true;
+  }
 }
  var lens = [
   2, 8, 16, 17, 18, 20, 21, 22, 64, 65, 128, 384, 512, 1024,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-diffie-hellman.git



More information about the Pkg-javascript-commits mailing list