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

Function operator

Sub-Store/Script/OldRname.js:46–117  ·  view source on GitHub ↗
(y)

Source from the content-addressed store, hash-verified

44const nameblnx = /(高倍|(?!1)2+(x|倍)|ˣ²|ˣ³|ˣ⁴|ˣ⁵|ˣ¹⁰)/i;
45const namenx = /(高倍|(?!1)(0\.|\d)+(x|倍)|ˣ²|ˣ³|ˣ⁴|ˣ⁵|ˣ¹⁰)/i;
46function operator(y) {
47 y.forEach((e) => {
48 Object.keys(rurekey).forEach((ikey) => {
49 e.name = e.name.replace(rurekey[ikey], ikey);
50 });
51 });
52 if (inname !== "") {
53 var inputList = gl(inname);
54 } else {
55 const inn = y.slice(0, 10).map((proxy) => gReg(proxy.name)).reduce((counts, region) => {
56 counts[region] = (counts[region] || 0) + 1;
57 return counts;
58 }, {});
59 const rein = Object.entries(inn);
60 rein.sort((a, b) => b[1] - a[1]);
61 const regss = rein[0][0];
62 var inputList = gl(regss);
63 }
64 var outputList = gl($arguments["out"]);
65 var ik = inputList.reduce((acc, curr, index) => {
66 acc[curr] = [outputList[index], 0];return acc;
67 }, {});
68 if(clear){y = y.filter(res => !nameclear.test(res.name))}
69 if(nx){y = y.filter(res => !res.name.match(namenx))}
70 if(blnx){y = y.filter(res => res.name.match(nameblnx))}
71 const delFgf = [];
72 const newPr = [];
73 y.forEach((res) => {
74 let isFgf = false;
75 const ikey=[]
76 if (!nf) {ikey.push(jcname)}
77 for (const elem of Object.keys(ik)) {
78 if (res.name.indexOf(elem) !== -1) {
79 if (!isFgf) {
80 isFgf = true;
81 ik[elem][1] += 1;
82 let namekey = nf ? jcname + FGF : "";
83 if (addflag) {
84 ikey.push(gF(us[Object.keys(ik).indexOf(elem)]) +FGF+ namekey + ik[elem][0]);
85 } else {
86 ikey.push(ik[elem][0]);
87 }
88 if (bl) {
89 regexArray.forEach((regex, index) => {
90 if (regex.test(res.name)) {
91 ikey.splice(2, 0, valueArray[index]);}});
92 const match = res.name.match(/(倍率\D?((\d\.)?\d+)\D?)|((\d\.)?\d+)(倍|X|x|×)/);
93 if (match) {
94 const rev = match[0].match(/(\d[\d.]*)/)[0];
95 if (rev !== '1') {
96 const newValue = rev + "×";
97 ikey.push(newValue);}}
98 }
99 }
100 }
101 }
102 if (isFgf) {
103 const kb = ikey.filter(item => item.trim() !== '');

Callers

nothing calls this directly

Calls 9

gRegFunction · 0.85
gFFunction · 0.85
glFunction · 0.70
jxhFunction · 0.70
onePFunction · 0.70
fampxFunction · 0.70
pushMethod · 0.45
indexOfMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected