MCPcopy Create free account
hub / github.com/LuanRT/YouTube.js / processCommandRuns

Method processCommandRuns

src/parser/classes/misc/Text.ts:177–205  ·  view source on GitHub ↗
(runs: RawRun[], command_runs: CommandRun[], data: AttributedText)

Source from the content-addressed store, hash-verified

175 }
176
177 private static processCommandRuns(runs: RawRun[], command_runs: CommandRun[], data: AttributedText) {
178 for (const command_run of command_runs) {
179 if (command_run.onTap) {
180 const matching_run = findMatchingRun(runs, command_run);
181
182 if (!matching_run) {
183 Log.warn(TAG, 'Unable to find matching run for command run. Skipping...', {
184 command_run,
185 input_data: data,
186 // For performance reasons, web browser consoles only expand an object, when the user clicks on it,
187 // So if we log the original runs object, it might have changed by the time the user looks at it.
188 // Deep clone, so that we log the exact state of the runs at this point.
189 parsed_runs: JSON.parse(JSON.stringify(runs))
190 });
191
192 continue;
193 }
194
195 insertSubRun(runs, matching_run, command_run, {
196 navigationEndpoint: command_run.onTap
197 });
198 } else {
199 Log.debug(TAG, 'Skipping command run as it is missing the "doTap" property.', {
200 command_run,
201 input_data: data
202 });
203 }
204 }
205 }
206
207 private static processAttachmentRuns(runs: RawRun[], attachment_runs: AttachmentRun[], data: AttributedText) {
208 for (const attachment_run of attachment_runs) {

Callers 1

fromAttributedMethod · 0.95

Calls 2

findMatchingRunFunction · 0.85
insertSubRunFunction · 0.85

Tested by

no test coverage detected