MCPcopy
hub / github.com/ollm/OpenComic / lastCompressedFile

Function lastCompressedFile

scripts/file-manager.js:3058–3080  ·  view source on GitHub ↗
(path, index = 0)

Source from the content-addressed store, hash-verified

3056
3057
3058function lastCompressedFile(path, index = 0)
3059{
3060 let segments = splitPath(path);
3061 let len = segments.length;
3062
3063 let newPath = (len > 0) ? (isEmpty(segments[0]) ? '/' : segments[0]) : '';
3064 let numSegments = len + index;
3065
3066 let lastCompressed = false;
3067
3068 for(let i = 1; i < len; i++)
3069 {
3070 newPath = join(newPath, segments[i]);
3071
3072 if(i < numSegments)
3073 {
3074 if(compatible.compressed(newPath))
3075 lastCompressed = newPath;
3076 }
3077 }
3078
3079 return lastCompressed;
3080}
3081
3082function allCompressedFiles(path, index = 0)
3083{

Callers 2

fileFunction · 0.85
fileCompressedFunction · 0.85

Calls 3

splitPathFunction · 0.85
isEmptyFunction · 0.85
joinFunction · 0.85

Tested by

no test coverage detected