@@ -281,7 +281,7 @@ function getWindowsNics() {
281281function getWindowsDNSsuffixes ( ) {
282282 let iface = { } ;
283283
284- let dnsSuffixes = {
284+ const dnsSuffixes = {
285285 primaryDNS : '' ,
286286 exitCode : 0 ,
287287 ifaces : [ ]
@@ -374,7 +374,7 @@ function getWindowsWirelessIfaceSSID(interfaceName) {
374374 }
375375}
376376function getWindowsIEEE8021x ( connectionType , iface , ifaces ) {
377- let i8021x = {
377+ const i8021x = {
378378 state : 'Unknown' ,
379379 protocol : 'Unknown'
380380 } ;
@@ -947,7 +947,7 @@ function networkInterfaces(callback, rescan, defaultString) {
947947 ip6 = ip6link ;
948948 ip6subnet = ip6linksubnet ;
949949 }
950- const iface = dev . split ( ':' ) [ 0 ] . trim ( ) . toLowerCase ( ) ;
950+ const iface = dev . split ( ':' ) [ 0 ] . trim ( ) ;
951951 let ifaceSanitized = '' ;
952952 const s = util . isPrototypePolluted ( ) ? '---' : util . sanitizeShellString ( iface ) ;
953953 const l = util . mathMin ( s . length , 2000 ) ;
@@ -1290,7 +1290,7 @@ function networkStats(ifaces, callback) {
12901290 Object . setPrototypeOf ( ifaces , util . stringObj ) ;
12911291 }
12921292
1293- ifaces = ifaces . trim ( ) . toLowerCase ( ) . replace ( / , + / g, '|' ) ;
1293+ ifaces = ifaces . trim ( ) . replace ( / , + / g, '|' ) ;
12941294 ifacesArray = ifaces . split ( '|' ) ;
12951295 }
12961296
@@ -1334,11 +1334,11 @@ function networkStats(ifaces, callback) {
13341334
13351335function networkStatsSingle ( iface ) {
13361336 function parseLinesWindowsPerfData ( sections ) {
1337- let perfData = [ ] ;
1337+ const perfData = [ ] ;
13381338 for ( let i in sections ) {
13391339 if ( { } . hasOwnProperty . call ( sections , i ) ) {
13401340 if ( sections [ i ] . trim ( ) !== '' ) {
1341- let lines = sections [ i ] . trim ( ) . split ( '\r\n' ) ;
1341+ const lines = sections [ i ] . trim ( ) . split ( '\r\n' ) ;
13421342 perfData . push ( {
13431343 name : util
13441344 . getValue ( lines , 'Name' , ':' )
@@ -1595,7 +1595,7 @@ function getProcessName(processes, pid) {
15951595function networkConnections ( callback ) {
15961596 return new Promise ( ( resolve ) => {
15971597 process . nextTick ( ( ) => {
1598- let result = [ ] ;
1598+ const result = [ ] ;
15991599 if ( _linux || _freebsd || _openbsd || _netbsd ) {
16001600 let cmd =
16011601 'export LC_ALL=C; netstat -tunap | grep "ESTABLISHED\\|SYN_SENT\\|SYN_RECV\\|FIN_WAIT1\\|FIN_WAIT2\\|TIME_WAIT\\|CLOSE\\|CLOSE_WAIT\\|LAST_ACK\\|LISTEN\\|CLOSING\\|UNKNOWN"; unset LC_ALL' ;
@@ -1689,13 +1689,6 @@ function networkConnections(callback) {
16891689 }
16901690 }
16911691 }
1692- // if (line.length >= 7 && line[6].indexOf('users:') > -1) {
1693- // const proc = line[6].replace('users:(("', '').replace(/"/g, '').split(',');
1694- // if (proc.length > 2) {
1695- // process = proc[0].split(' ')[0].split(':')[0];
1696- // pid = parseInt(proc[1], 10);
1697- // }
1698- // }
16991692 if ( connstate ) {
17001693 result . push ( {
17011694 protocol : line [ 0 ] ,
@@ -1806,7 +1799,7 @@ function networkConnections(callback) {
18061799 if ( line . length >= 4 ) {
18071800 let localip = line [ 1 ] ;
18081801 let localport = '' ;
1809- let localaddress = line [ 1 ] . split ( ':' ) ;
1802+ const localaddress = line [ 1 ] . split ( ':' ) ;
18101803 if ( localaddress . length > 1 ) {
18111804 localport = localaddress [ localaddress . length - 1 ] ;
18121805 localaddress . pop ( ) ;
@@ -1815,14 +1808,14 @@ function networkConnections(callback) {
18151808 localip = localip . replace ( / \[ / g, '' ) . replace ( / \] / g, '' ) ;
18161809 let peerip = line [ 2 ] ;
18171810 let peerport = '' ;
1818- let peeraddress = line [ 2 ] . split ( ':' ) ;
1811+ const peeraddress = line [ 2 ] . split ( ':' ) ;
18191812 if ( peeraddress . length > 1 ) {
18201813 peerport = peeraddress [ peeraddress . length - 1 ] ;
18211814 peeraddress . pop ( ) ;
18221815 peerip = peeraddress . join ( ':' ) ;
18231816 }
18241817 peerip = peerip . replace ( / \[ / g, '' ) . replace ( / \] / g, '' ) ;
1825- let pid = util . toInt ( line [ 4 ] ) ;
1818+ const pid = util . toInt ( line [ 4 ] ) ;
18261819 let connstate = line [ 3 ] ;
18271820 if ( connstate === 'HERGESTELLT' ) {
18281821 connstate = 'ESTABLISHED' ;
@@ -1901,7 +1894,7 @@ function networkGatewayDefault(callback) {
19011894 process . nextTick ( ( ) => {
19021895 let result = '' ;
19031896 if ( _linux || _freebsd || _openbsd || _netbsd ) {
1904- let cmd = 'ip route get 1' ;
1897+ const cmd = 'ip route get 1' ;
19051898 try {
19061899 exec ( cmd , { maxBuffer : 1024 * 102400 } , ( error , stdout ) => {
19071900 if ( ! error ) {
0 commit comments