MCPcopy Index your code
hub / github.com/callstack/agent-device / appendScriptSeriesFlags

Function appendScriptSeriesFlags

src/replay/script-utils.ts:67–95  ·  view source on GitHub ↗
(
  parts: string[],
  action: Pick<SessionAction, 'command' | 'flags'>,
)

Source from the content-addressed store, hash-verified

65
66// fallow-ignore-next-line complexity
67export function appendScriptSeriesFlags(
68 parts: string[],
69 action: Pick<SessionAction, 'command' | 'flags'>,
70): void {
71 const flags = action.flags ?? {};
72 if (isClickLikeCommand(action.command)) {
73 if (typeof flags.count === 'number') parts.push('--count', String(flags.count));
74 if (typeof flags.intervalMs === 'number') parts.push('--interval-ms', String(flags.intervalMs));
75 if (typeof flags.holdMs === 'number') parts.push('--hold-ms', String(flags.holdMs));
76 if (typeof flags.jitterPx === 'number') parts.push('--jitter-px', String(flags.jitterPx));
77 if (flags.doubleTap === true) parts.push('--double-tap');
78 const clickButton = flags.clickButton;
79 if (clickButton && clickButton !== 'primary') {
80 parts.push('--button', clickButton);
81 }
82 return;
83 }
84 if (action.command === 'swipe') {
85 if (typeof flags.count === 'number') parts.push('--count', String(flags.count));
86 if (typeof flags.pauseMs === 'number') parts.push('--pause-ms', String(flags.pauseMs));
87 if (flags.pattern === 'one-way' || flags.pattern === 'ping-pong') {
88 parts.push('--pattern', flags.pattern);
89 }
90 return;
91 }
92 if (isTypingCommand(action.command) && typeof flags.delayMs === 'number') {
93 parts.push('--delay-ms', String(flags.delayMs));
94 }
95}
96
97export function appendRuntimeHintFlags(
98 parts: string[],

Callers 3

formatFillActionLineFunction · 0.90

Calls 3

isClickLikeCommandFunction · 0.85
isTypingCommandFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected