| 147 | |
| 148 | // 主函数 |
| 149 | function 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 | } |