MCPcopy Index your code
hub / github.com/prettydiff/prettydiff / summary

Function summary

api/mode.ts:617–649  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

615 }
616 },
617 summary = function mode_summary():void {
618 const keys:string[] = Object.keys(lexers),
619 len:number = keys.length,
620 output:string[] = [],
621 lex:string[] = [];
622 let a:number = 0,
623 lextest:boolean = false;
624 output.push(`<div id="prettydiff_summary"><h1>Pretty Diff - Summary</h1>`);
625 output.push("<p>This is the count of identified differences starting with visual differences colored in the document first.</p><ul>");
626 output.push(`<li>Deletions - <strong>${lexers.del}</strong></li>`);
627 output.push(`<li>Insertions - <strong>${lexers.insert}</strong></li>`);
628 output.push(`<li>Replacements - <strong>${lexers.replace}</strong></li>`);
629 output.push("</ul>");
630 if (len > 3) {
631 lexers.del = 0;
632 lexers.insert = 0;
633 lexers.replace = 0;
634 lex.push("<hr/><p>This list of differences is not visible in the rendered HTML.</p><ul>");
635 do {
636 if (lexers[keys[a]] > 0) {
637 lextest = true;
638 lex.push(`<li>${keys[a]} - ${lexers[keys[a]]}</li>`);
639 }
640 a = a + 1;
641 } while (a < len);
642 lex.push("</ul>");
643 }
644 if (lextest === true) {
645 output.push(lex.join(""));
646 }
647 output.push("</div>");
648 options.parsed.token[body] = `${options.parsed.token[body]} ${output.join("")}`;
649 };
650 let diff_parsed:data,
651 json:any,
652 a:number = 0,

Callers 1

modeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected