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

Function sanitize

services.ts:3481–3504  ·  view source on GitHub ↗
(item_type:"source"|"diff", string_purge:string)

Source from the content-addressed store, hash-verified

3479
3480 if (options.read_method === "subdirectory") {
3481 const sanitize = function node_apps_readmethod_resolve_stat_resolveItem_callbackDiff_sanitize(item_type:"source"|"diff", string_purge:string):void {
3482 const arrays = function node_apps_readmethod_resolve_stat_resolveItem_callbackDiff_sanitize_arrays(arr:string[]):void {
3483 let c:number = 0,
3484 d:number = -1,
3485 flen:number = arr.length;
3486 if (flen < 1) {
3487 return;
3488 }
3489 do {
3490 if (d < 0 && arr[c].indexOf(string_purge) === 0) {
3491 d = c;
3492 } else if (d > -1 && arr[c].indexOf(string_purge) !== 0) {
3493 arr.splice(d, c - d);
3494 return;
3495 }
3496 c = c + 1;
3497 } while (c < flen);
3498 if (d > 0) {
3499 arr.splice(d, c - d);
3500 }
3501 };
3502 arrays(files[item_type]);
3503 arrays(links[item_type]);
3504 };
3505 // File systems are tree structures, so this loop normalizes artificats against changes to directory structures.
3506 // If a directory is removed then indicate such without listing its thousands of descendant artifacts.
3507 do {

Callers 1

callback_diffFunction · 0.70

Calls 1

arraysFunction · 0.85

Tested by

no test coverage detected