MCPcopy
hub / github.com/ocsjs/ocsjs / titleTransform

Function titleTransform

packages/scripts/src/projects/icve.ts:770–783  ·  view source on GitHub ↗
(titles: (HTMLElement | undefined)[])

Source from the content-addressed store, hash-verified

768 console.log({ answererWrappers, period, thread });
769
770 const titleTransform = (titles: (HTMLElement | undefined)[]) => {
771 return titles
772 .filter((t) => t?.innerText)
773 .map((t) => {
774 if (t) {
775 const title = t.cloneNode(true) as HTMLElement;
776 title.querySelector('[name*="questionIndex"]')?.remove();
777 title.querySelector('.q_score')?.remove();
778 return title.innerText.trim().replace(/^、/, '') || '';
779 }
780 return '';
781 })
782 .join(',');
783 };
784
785 const workResults: SimplifyWorkResult[] = [];
786 let totalQuestionCount = 0;

Callers 2

workFunction · 0.70
aiWorkFunction · 0.70

Calls 1

Tested by

no test coverage detected