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

Function operator

Sub-Store/Script/Rename.js:149–180  ·  view source on GitHub ↗
(proxies)

Source from the content-addressed store, hash-verified

147
148// 主函数
149function operator(proxies) {
150 proxies.map((res) => {
151 const resultArray = [airport];
152 var matched = false
153 for (const elem of Object.keys(countries)) {
154 if (simplify(res.name).indexOf(elem) !== -1) {
155 countries[elem][1] += 1;
156 if (!autofill) {
157 resultArray.push(countries[elem][0], countries[elem][1]);
158 } else {
159 resultArray.push(countries[elem][0], countries[elem][1].toString().padStart(autofill, '0'));
160 }
161 // console.log(resultArray);
162 matched = true
163 break;
164 };
165 };
166 if (!matched) {
167 resultArray.push(res.name);
168 };
169 Object.keys(others).forEach((elem, index) => {
170 if (simplify(res.name).indexOf(elem) !== -1) {
171 resultArray.splice(2, 0, others[elem]);
172 }
173 });
174 res.name = resultArray.join(' ');
175 });
176 if ($arguments.del1) {
177 proxies = stripOnes(proxies);
178 };
179 return proxies;
180}

Callers

nothing calls this directly

Calls 6

simplifyFunction · 0.70
stripOnesFunction · 0.70
indexOfMethod · 0.45
pushMethod · 0.45
toStringMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected