MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / resolveLegacyAutoStepDelaySeconds

Function resolveLegacyAutoStepDelaySeconds

background.js:353–372  ·  view source on GitHub ↗
(input = {})

Source from the content-addressed store, hash-verified

351}
352
353function resolveLegacyAutoStepDelaySeconds(input = {}) {
354 const hasLegacyMin = input.autoStepRandomDelayMinSeconds !== undefined;
355 const hasLegacyMax = input.autoStepRandomDelayMaxSeconds !== undefined;
356 if (!hasLegacyMin && !hasLegacyMax) {
357 return undefined;
358 }
359
360 const minSeconds = normalizeAutoStepDelaySeconds(input.autoStepRandomDelayMinSeconds, null);
361 const maxSeconds = normalizeAutoStepDelaySeconds(input.autoStepRandomDelayMaxSeconds, null);
362 if (minSeconds === null && maxSeconds === null) {
363 return null;
364 }
365 if (minSeconds === null) {
366 return maxSeconds;
367 }
368 if (maxSeconds === null) {
369 return minSeconds;
370 }
371 return Math.round((minSeconds + maxSeconds) / 2);
372}
373
374function normalizeRunCount(value) {
375 const numeric = Number(value);

Callers 1

Calls 1

Tested by

no test coverage detected