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

Function HostNamecheck

Script/Parser.js:1123–1168  ·  view source on GitHub ↗
(content, parain, paraout)

Source from the content-addressed store, hash-verified

1121
1122// 主机名处理
1123function HostNamecheck(content, parain, paraout) {
1124 var hname = content.replace(/ /g, "").split("=")[1].split(",");
1125 var nname = [];
1126 var dname = []; //删除项
1127 for (var i = 0; i < hname.length; i++) {
1128 dd = hname[i]
1129 const excludehn = (item) => dd.indexOf(item) != -1;
1130 if (paraout && paraout != "") { //存在 out 参数时
1131 if (!paraout.some(excludehn)) { //out 未命中🎯️
1132 if (parain && parain != "") {
1133 if (parain.some(excludehn)) { //Pin 命中🎯️
1134 nname.push(hname[i])
1135 } else {
1136 dname.push(hname[i])
1137 } //Pin 未命中🎯️的记录
1138 } else { nname.push(hname[i]) } //无in 参数
1139 } else { dname.push(hname[i]) } //out 参数命中
1140 } else if (parain && parain != "") { //不存在 out,但有 in 参数时
1141 if (parain.some(excludehn)) { //Pin 命中🎯️
1142 nname.push(hname[i])
1143 } else { dname.push(hname[i]) }
1144 } else {
1145 nname.push(hname[i])
1146 }
1147 } //for j
1148 if (Pntf0 != 0) {
1149 if (paraout || parain) {
1150 var noname = dname.length <= 10 ? emojino[dname.length] : dname.length
1151 var no1name = nname.length <= 10 ? emojino[nname.length] : nname.length
1152 if (parain && no1name != " 0️⃣ ") {
1153 $notify("🤖 " + "重写引用 ➟ " + "⟦" + subtag + "⟧", "⛔️ 筛选参数: " + pfihn + pfohn, "☠️ 主机名 hostname 中已保留以下" + no1name + "个匹配项:" + "\n ⨷ " + nname.join(","), rwhost_link)
1154 } else if (dname.length > 0) {
1155 $notify("🤖 " + "重写引用 ➟ " + "⟦" + subtag + "⟧", "⛔️ 筛选参数: " + pfihn + pfohn, "☠️ 主机名 hostname 中已删除以下" + noname + "个匹配项:" + "\n ⨷ " + dname.join(","), rwhost_link)
1156 }
1157 }
1158 }
1159 if (nname.length == 0) {
1160 $notify("🤖 " + "重写引用 ➟ " + "⟦" + subtag + "⟧", "⛔️ 筛选参数: " + pfihn + pfohn, "⚠️ 主机名 hostname 中剩余 0️⃣ 项, 请检查参数及原始链接", nan_link)
1161 }
1162 if(Preg){ nname = nname.map(Regex).filter(Boolean)
1163 RegCheck(nname, "主机名hostname","regex", Preg) }
1164 if(Pregout){ nname = nname.map(RegexOut).filter(Boolean)
1165 RegCheck(nname, "主机名hostname", "regout", Pregout) }
1166 hname = "hostname=" + nname.join(", ");
1167 return hname
1168}
1169
1170//Rewrite 筛选的函数
1171function Rcheck(content, param) {

Callers 1

Rewrite_FilterFunction · 0.85

Calls 4

RegCheckFunction · 0.85
$notifyFunction · 0.70
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…