systeminformation
Advanced tools
Comparing version 3.11.0 to 3.11.1
@@ -92,2 +92,3 @@ # Changelog | ||
| -------------- | -------------- | -------- | | ||
| 3.11.1 | 2016-11-16 | fixed small bug in blockDevices | | ||
| 3.11.0 | 2016-11-15 | blockDevices for OSX and extended blockDevices | | ||
@@ -94,0 +95,0 @@ | 3.10.2 | 2016-11-14 | bug fix fsSize on OSX | |
@@ -76,6 +76,6 @@ 'use strict'; | ||
function parseBytes(s) { | ||
return parseInt(s.substr(s.indexOf(' (')+2, s.indexOf(' Bytes)')-10)) | ||
return parseInt(s.substr(s.indexOf(' (') + 2, s.indexOf(' Bytes)') - 10)) | ||
} | ||
function parseDevices (lines) { | ||
function parseDevices(lines) { | ||
let devices = []; | ||
@@ -90,16 +90,16 @@ let i = 0; | ||
if (parts.length > 1) { | ||
if (!devices[i]) devices[i] = { | ||
name: '', | ||
identifier: '', | ||
type: 'disk', | ||
fstype: '', | ||
mount: '', | ||
size: 0, | ||
physical: 'HDD', | ||
uuid: '', | ||
label: '', | ||
model: '', | ||
serial: '', | ||
protocol: '' | ||
}; | ||
if (!devices[i]) devices[i] = { | ||
name: '', | ||
identifier: '', | ||
type: 'disk', | ||
fstype: '', | ||
mount: '', | ||
size: 0, | ||
physical: 'HDD', | ||
uuid: '', | ||
label: '', | ||
model: '', | ||
serial: '', | ||
protocol: '' | ||
}; | ||
parts[0] = parts[0].trim().toUpperCase().replace(/ +/g, ''); | ||
@@ -128,12 +128,12 @@ parts[1] = parts[1].trim(); | ||
function fromTo(header, label) { | ||
let from = header.indexOf(label); | ||
let to = from + label.length; | ||
for (let i = to; i < header.length && header[i] == ' '; i++) { | ||
to = i | ||
} | ||
console.log(label + ' - ' + from + ' ' + to); | ||
return { | ||
from: from, | ||
to: to | ||
} | ||
let from = header.indexOf(label); | ||
let to = from + label.length; | ||
for (let i = to; i < header.length && header[i] == ' '; i++) { | ||
to = i | ||
} | ||
console.log(label + ' - ' + from + ' ' + to); | ||
return { | ||
from: from, | ||
to: to | ||
} | ||
} | ||
@@ -165,4 +165,4 @@ function blockDevices(callback) { | ||
if (orgline.substr(header.indexOf('MOUNTPOINT'), 1) == ' ') { orgline = orgline.substr(0, header.indexOf('MOUNTPOINT')) + '-' + orgline.substr(header.indexOf('MOUNTPOINT') + 1, 1000)} | ||
if (orgline.substr(header.indexOf('UUID'), 1) == ' ') { orgline = orgline.substr(0, header.indexOf('UUID')) + '-' + orgline.substr(header.indexOf('UUID') + 1, 1000)} | ||
if (orgline.substr(header.indexOf('TRAN'), 1) == ' ') { orgline = orgline.substr(0, header.indexOf('TRAN')) + '-' + orgline.substr(header.indexOf('TRAN') + 1, 1000)} | ||
if (orgline.substr(header.indexOf('UUID'), 1) == ' ') { orgline = orgline.substr(0, header.indexOf('UUID')) + '-' + orgline.substr(header.indexOf('UUID') + 1, 1000)} | ||
if (orgline.substr(header.indexOf('TRAN'), 1) == ' ') { orgline = orgline.substr(0, header.indexOf('TRAN')) + '-' + orgline.substr(header.indexOf('TRAN') + 1, 1000)} | ||
let line = orgline.replace(/[├─│└]+/g, ""); | ||
@@ -177,7 +177,7 @@ line = line.replace(/ +/g, " ").trim().split(' '); | ||
'physical': (line[1] == 'disk' ? (line[6] == '0' ? 'SSD' : 'HDD') : (line[1] == 'rom' ? 'CD/DVD' : '')), | ||
'uuid': (line[5] == '-' ? '' : line[5]), | ||
'label': orgline.substring(ft_label.from, ft_label.to).trim(), | ||
'model': orgline.substring(ft_model.from, ft_model.to).trim(), | ||
'serial': orgline.substring(ft_serial.from, ft_serial.to).trim(), | ||
'protocol': (line[8] == '-' ? '' : line[8]) | ||
'uuid': (line[5] == '-' ? '' : line[5]), | ||
'label': orgline.substring(ft_label.from, ft_label.to).trim(), | ||
'model': orgline.substring(ft_model.from, ft_model.to).trim(), | ||
'serial': orgline.substring(ft_serial.from, ft_serial.to).trim(), | ||
'protocol': (line[8] == '-' ? '' : line[8]) | ||
}) | ||
@@ -184,0 +184,0 @@ } |
@@ -84,2 +84,3 @@ 'use strict'; | ||
// version date comment | ||
// 3.11.1 2016-11-16 fixed small bug in blockDevices | ||
// 3.11.0 2016-11-15 blockDevices for OSX and extended blockDevices | ||
@@ -86,0 +87,0 @@ // 3.10.2 2016-11-14 bug fix fsSize on OSX |
{ | ||
"name": "systeminformation", | ||
"version": "3.11.0", | ||
"version": "3.11.1", | ||
"description": "Simple system and OS information library", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
164755
3573