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

Function appendRuntimeHintFlags

src/replay/script-utils.ts:97–126  ·  view source on GitHub ↗
(
  parts: string[],
  flags:
    | Pick<SessionAction, 'flags'>['flags']
    | {
        platform?: 'ios' | 'android';
        metroHost?: string;
        metroPort?: number;
        bundleUrl?: string;
        launchUrl?: string;
      }
    | undefined,
)

Source from the content-addressed store, hash-verified

95}
96
97export function appendRuntimeHintFlags(
98 parts: string[],
99 flags:
100 | Pick<SessionAction, 'flags'>['flags']
101 | {
102 platform?: 'ios' | 'android';
103 metroHost?: string;
104 metroPort?: number;
105 bundleUrl?: string;
106 launchUrl?: string;
107 }
108 | undefined,
109): void {
110 if (!flags) return;
111 if (flags.platform === 'ios' || flags.platform === 'android') {
112 parts.push('--platform', flags.platform);
113 }
114 if (typeof flags.metroHost === 'string' && flags.metroHost.length > 0) {
115 parts.push('--metro-host', formatScriptArgQuoteIfNeeded(flags.metroHost));
116 }
117 if (typeof flags.metroPort === 'number') {
118 parts.push('--metro-port', String(flags.metroPort));
119 }
120 if (typeof flags.bundleUrl === 'string' && flags.bundleUrl.length > 0) {
121 parts.push('--bundle-url', formatScriptArgQuoteIfNeeded(flags.bundleUrl));
122 }
123 if (typeof flags.launchUrl === 'string' && flags.launchUrl.length > 0) {
124 parts.push('--launch-url', formatScriptArgQuoteIfNeeded(flags.launchUrl));
125 }
126}
127
128export function appendRecordActionScriptArgs(parts: string[], action: SessionAction): void {
129 const [subcommand, ...rest] = action.positionals ?? [];

Callers 2

Calls 2

pushMethod · 0.80

Tested by

no test coverage detected