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

Function operator

Sub-Store/Script/Rname.js:145–299  ·  view source on GitHub ↗
(pro)

Source from the content-addressed store, hash-verified

143}
144
145function operator(pro) {
146 const Allmap = {};
147 const outList = getList(outputName);
148 let inputList,
149 retainKey = "";
150 if (inname !== "") {
151 inputList = [getList(inname)];
152 } else {
153 inputList = [ZH, FG, QC, EN];
154 }
155
156 inputList.forEach((arr) => {
157 arr.forEach((value, valueIndex) => {
158 Allmap[value] = outList[valueIndex];
159 });
160 });
161
162 if (clear || nx || blnx || key) {
163 pro = pro.filter((res) => {
164 const resname = res.name;
165 const shouldKeep =
166 !(clear && nameclear.test(resname)) &&
167 !(nx && namenx.test(resname)) &&
168 !(blnx && !nameblnx.test(resname)) &&
169 !(key && !(keya.test(resname) && /2|4|6|7/i.test(resname)));
170 return shouldKeep;
171 });
172 }
173
174 const BLKEYS = BLKEY ? BLKEY.split("+") : "";
175
176 pro.forEach((e) => {
177 let bktf = false, ens = e.name
178 // 预处理 防止预判或遗漏
179 Object.keys(rurekey).forEach((ikey) => {
180 if (rurekey[ikey].test(e.name)) {
181 e.name = e.name.replace(rurekey[ikey], ikey);
182 if (BLKEY) {
183 bktf = true
184 let BLKEY_REPLACE = "",
185 re = false;
186 BLKEYS.forEach((i) => {
187 if (i.includes(">") && ens.includes(i.split(">")[0])) {
188 if (rurekey[ikey].test(i.split(">")[0])) {
189 e.name += " " + i.split(">")[0]
190 }
191 if (i.split(">")[1]) {
192 BLKEY_REPLACE = i.split(">")[1];
193 re = true;
194 }
195 } else {
196 if (ens.includes(i)) {
197 e.name += " " + i
198 }
199 }
200 retainKey = re
201 ? BLKEY_REPLACE
202 : BLKEYS.filter((items) => e.name.includes(items));

Callers

nothing calls this directly

Calls 8

getListFunction · 0.85
ObjKAFunction · 0.85
jxhFunction · 0.70
onePFunction · 0.70
fampxFunction · 0.70
findMethod · 0.45
indexOfMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected