(content)
| 1357 | |
| 1358 | // Domain-Set |
| 1359 | function Domain2Rule(content) { |
| 1360 | var cnt = content.split("\n"); |
| 1361 | var RuleK = ["//", "#", ";","["] |
| 1362 | var nlist = [] |
| 1363 | for (var i = 0; i< cnt.length; i++) { |
| 1364 | cc = cnt[i].trim(); |
| 1365 | const RuleCheck = (item) => cc.indexOf(item) != -1; //无视注释行 |
| 1366 | if(!RuleK.some(RuleCheck) && cc) { |
| 1367 | if (cc[0] == "."){ |
| 1368 | nlist.push("host-suffix, " + cc.slice(1 , cc.length) ) |
| 1369 | } else { |
| 1370 | nlist.push("host, " + cc ) |
| 1371 | } |
| 1372 | } |
| 1373 | } |
| 1374 | return nlist.join("\n") |
| 1375 | } |
| 1376 | // filter 正则指定替换 regex1@policy1+regex2@policy2 |
| 1377 | function policy_sets(cnt,para) { |
| 1378 | pcnt = para.split("+") |
no test coverage detected
searching dependent graphs…