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

Function compare

services.ts:4296–4443  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4294 options.wrap = 80;
4295 },
4296 compare = function node_apps_validation_compare():void {
4297 const len:number = (raw.length > formatted.length)
4298 ? raw.length
4299 : formatted.length,
4300 sort = function node_apps_validation_compare_sort(a:[string, string], b:[string, string]):number {
4301 if (a[0] > b[0]) {
4302 return 1;
4303 }
4304 return -1;
4305 };
4306 let a:number = 0,
4307 b:number = 0,
4308 missing:number = 0,
4309 filecount:number = 0,
4310 noteslen:number = 0,
4311 notes:string[] = [],
4312 output:string = "";
4313 raw.sort(sort);
4314 formatted.sort(sort);
4315 if (command === "validation") {
4316 console.log("");
4317 }
4318 do {
4319 if (raw[a] === undefined || formatted[a] === undefined) {
4320 if (raw[a] === undefined && formatted[a] !== undefined) {
4321 console.log(`${text.angry}raw directory is missing file:${text.none} ${formatted[a][0]}`);
4322 formatted.splice(a, 1);
4323 } else if (formatted[a] === undefined && raw[a] !== undefined) {
4324 console.log(`${text.angry}formatted directory is missing file:${text.none} ${raw[a][0]}`);
4325 raw.splice(a, 1);
4326 }
4327 } else if (raw[a][0] === formatted[a][0]) {
4328 let value:string = "",
4329 numb:number = 0,
4330 name:string = "";
4331 reset();
4332 notes = raw[a][0].split("_");
4333 noteslen = notes.length;
4334 options.language = notes[2];
4335 options.lexer = notes[1];
4336 options.mode = notes[0];
4337 options.source = raw[a][1];
4338 if (noteslen > 3) {
4339 b = 3;
4340 do {
4341 if (b < noteslen - 2 && notes[b].indexOf("-") < 0 && notes[b + 1].indexOf("-") < 0) {
4342 name = `${notes[b]}_${notes[b + 1]}_${notes[b + 2].replace(".txt", "")}`;
4343 if (name.indexOf("-") > 0) {
4344 name = name.slice(0, name.indexOf("-"));
4345 }
4346 if (options[name] !== undefined) {
4347 notes[b + 2] = `${notes[b]}_${notes[b + 1]}_${notes[b + 2]}`;
4348 b = b + 2;
4349 } else if (b < noteslen - 1 && notes[b].indexOf("-") < 0) {
4350 name = `${notes[b]}_${notes[b + 1].replace(".txt", "")}`;
4351 if (name.indexOf("-") > 0) {
4352 name = name.slice(0, name.indexOf("-"));
4353 }

Callers 1

pusherFunction · 0.70

Calls 2

resetFunction · 0.85
callbackFunction · 0.85

Tested by

no test coverage detected