* 获取实际使用的配置(基础配置 × 速度比例) * @returns {Object} 计算后的配置对象
()
| 218 | * @returns {Object} 计算后的配置对象 |
| 219 | */ |
| 220 | function getConfig() { |
| 221 | if (!baseConfig) { |
| 222 | baseConfig = getBaseConfig(); |
| 223 | } |
| 224 | |
| 225 | const ratio = getSpeedRatio(); |
| 226 | |
| 227 | return { |
| 228 | scrollInterval: Math.max(80, Math.round(baseConfig.scrollInterval / ratio)), |
| 229 | scrollStep: Math.max(50, Math.round(baseConfig.scrollStep * ratio)), |
| 230 | waitForElement: Math.max(500, Math.round(baseConfig.waitForElement / ratio)), |
| 231 | waitingTime: Math.max(300, Math.round(baseConfig.waitingTime / ratio)) |
| 232 | }; |
| 233 | } |
| 234 | |
| 235 | // 初始化基础配置 |
| 236 | baseConfig = getBaseConfig(); |
no test coverage detected