mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-13 13:11:03 +00:00
Update hosts.js
This commit is contained in:
parent
9d1e7d202e
commit
1ef81ad19a
|
@ -12,9 +12,9 @@ exports.getHosts = function() {
|
||||||
var fileContent = FILE.readFile(filePath, "utf-8");
|
var fileContent = FILE.readFile(filePath, "utf-8");
|
||||||
|
|
||||||
var lines = fileContent.split(/[\r\n]+/g).filter(function(s) {
|
var lines = fileContent.split(/[\r\n]+/g).filter(function(s) {
|
||||||
return !(s.indexOf('#') == 0)
|
return !(s.indexOf(' #') == 0)
|
||||||
}).map(function(s) {
|
}).map(function(s) {
|
||||||
var pos = s.indexOf('#');
|
var pos = s.indexOf(' #');
|
||||||
if(pos > -1) {
|
if(pos > -1) {
|
||||||
return s.substring(pos).replace(/\s\s/g, ' ');
|
return s.substring(pos).replace(/\s\s/g, ' ');
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user