(value, fallback = null)
| 334 | } |
| 335 | |
| 336 | function normalizeAutoStepDelaySeconds(value, fallback = null) { |
| 337 | const rawValue = String(value ?? '').trim(); |
| 338 | if (!rawValue) { |
| 339 | return fallback; |
| 340 | } |
| 341 | |
| 342 | const numeric = Number(rawValue); |
| 343 | if (!Number.isFinite(numeric)) { |
| 344 | return fallback; |
| 345 | } |
| 346 | |
| 347 | return Math.min( |
| 348 | AUTO_STEP_DELAY_MAX_ALLOWED_SECONDS, |
| 349 | Math.max(AUTO_STEP_DELAY_MIN_ALLOWED_SECONDS, Math.floor(numeric)) |
| 350 | ); |
| 351 | } |
| 352 | |
| 353 | function resolveLegacyAutoStepDelaySeconds(input = {}) { |
| 354 | const hasLegacyMin = input.autoStepRandomDelayMinSeconds !== undefined; |
no outgoing calls
no test coverage detected