From 904cb0491db397141e76d45d7c03c285563abe8f Mon Sep 17 00:00:00 2001 From: Levan Abashidze Date: Mon, 30 Apr 2018 23:26:08 +0400 Subject: [PATCH 1/5] Update ip.js --- lib/ip.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/ip.js b/lib/ip.js index c1799a8..349a83e 100644 --- a/lib/ip.js +++ b/lib/ip.js @@ -414,3 +414,14 @@ ip.fromLong = function(ipl) { (ipl >> 8 & 255) + '.' + (ipl & 255) ); }; + + +ip.range(ip1, ip2){ + let ip1l = ip.toLong(ip1); + let ip22 = ip.toLong(ip2); + var ipList = []; + for (var i = Math.min(ip1l, ip22); i <= Math.max(ip1l, ip22); i++) { + ipList.push(i) + } + return ipList.map(ip.fromLong); +} From 49e15b15bf46e5d81d464ec769a1f3b905535b7e Mon Sep 17 00:00:00 2001 From: Levan Abashidze Date: Mon, 30 Apr 2018 23:28:21 +0400 Subject: [PATCH 2/5] Update ip.js --- lib/ip.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/ip.js b/lib/ip.js index 349a83e..81cd8cb 100644 --- a/lib/ip.js +++ b/lib/ip.js @@ -416,12 +416,12 @@ ip.fromLong = function(ipl) { }; -ip.range(ip1, ip2){ - let ip1l = ip.toLong(ip1); - let ip22 = ip.toLong(ip2); - var ipList = []; - for (var i = Math.min(ip1l, ip22); i <= Math.max(ip1l, ip22); i++) { - ipList.push(i) - } - return ipList.map(ip.fromLong); +ip.range = function(ip1, ip2){ + let ip1l = ip.toLong(ip1); + let ip22 = ip.toLong(ip2); + var ipList = []; + for (var i = Math.min(ip1l, ip22); i <= Math.max(ip1l, ip22); i++) { + ipList.push(i); + } + return ipList.map(ip.fromLong); } From b66808017da7b91fec20a9d2bcd822a6108231f8 Mon Sep 17 00:00:00 2001 From: Levan Abashidze Date: Mon, 30 Apr 2018 23:44:48 +0400 Subject: [PATCH 3/5] Fix spelling --- lib/ip.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ip.js b/lib/ip.js index 81cd8cb..9e7bd8d 100644 --- a/lib/ip.js +++ b/lib/ip.js @@ -418,10 +418,10 @@ ip.fromLong = function(ipl) { ip.range = function(ip1, ip2){ let ip1l = ip.toLong(ip1); - let ip22 = ip.toLong(ip2); + let ip2l = ip.toLong(ip2); var ipList = []; - for (var i = Math.min(ip1l, ip22); i <= Math.max(ip1l, ip22); i++) { - ipList.push(i); + for (var i = Math.min(ip1l, ip2l); i <= Math.max(ip1l, ip2l); i++) { + ipList.push(i); } return ipList.map(ip.fromLong); } From 3cba8e9904d921dc745900b03683862f01fdaf41 Mon Sep 17 00:00:00 2001 From: Levan Abashidze Date: Mon, 30 Apr 2018 23:52:03 +0400 Subject: [PATCH 4/5] Update ip.js --- lib/ip.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ip.js b/lib/ip.js index 9e7bd8d..883383a 100644 --- a/lib/ip.js +++ b/lib/ip.js @@ -416,7 +416,7 @@ ip.fromLong = function(ipl) { }; -ip.range = function(ip1, ip2){ +ip.range = function(ip1, ip2) { let ip1l = ip.toLong(ip1); let ip2l = ip.toLong(ip2); var ipList = []; From a1a7fbda0eccc7d9a75f9b1d5e5f16863bb18676 Mon Sep 17 00:00:00 2001 From: Levan Abashidze Date: Mon, 30 Apr 2018 23:54:50 +0400 Subject: [PATCH 5/5] Update ip.js --- lib/ip.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ip.js b/lib/ip.js index 883383a..d8ccb07 100644 --- a/lib/ip.js +++ b/lib/ip.js @@ -417,11 +417,11 @@ ip.fromLong = function(ipl) { ip.range = function(ip1, ip2) { - let ip1l = ip.toLong(ip1); - let ip2l = ip.toLong(ip2); + var ip1l = ip.toLong(ip1); + var ip2l = ip.toLong(ip2); var ipList = []; for (var i = Math.min(ip1l, ip2l); i <= Math.max(ip1l, ip2l); i++) { ipList.push(i); } return ipList.map(ip.fromLong); -} +};