MCPcopy Index your code
hub / github.com/Moli-X/Resources / Domain2Rule

Function Domain2Rule

Script/Parser.js:1359–1375  ·  view source on GitHub ↗
(content)

Source from the content-addressed store, hash-verified

1357
1358// Domain-Set
1359function 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
1377function policy_sets(cnt,para) {
1378 pcnt = para.split("+")

Callers 1

Type_CheckFunction · 0.85

Calls 2

pushMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…