MCPcopy Create free account
hub / github.com/Moli-X/Resources / Scheck

Function Scheck

Script/Parser.js:1838–1854  ·  view source on GitHub ↗
(content, param)

Source from the content-addressed store, hash-verified

1836
1837// 判断节点过滤的函数
1838function Scheck(content, param) {
1839 name = content.replace(/tag\s*\=/g,"tag=").split("tag=")[1].toUpperCase()
1840 param = param ? param.map(Dot2) : param // 对符号.的特殊处理
1841 if (param) {
1842 var flag = 0;
1843 for (var i = 0; i < param.length; i++) {
1844 var params = param[i].split(".").map(ToDot);
1845 const checkpara = (item) => name.indexOf(item.toUpperCase()) != -1;
1846 if (params.every(checkpara)) {
1847 flag = 1
1848 }
1849 }//for
1850 return flag
1851 } else { //if param
1852 return 2
1853 }
1854}
1855
1856//节点过滤,使用+连接多个关键词(逻辑"或"):in 为保留,out 为排除, "与"逻辑请用符号"."连接
1857function Filter(servers, Pin, Pout) {

Callers 1

FilterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected