(path, index = 0, checkDirectory = true)
| 3026 | } |
| 3027 | |
| 3028 | function firstCompressedFile(path, index = 0, checkDirectory = true) |
| 3029 | { |
| 3030 | let segments = splitPath(path); |
| 3031 | let len = segments.length; |
| 3032 | |
| 3033 | let newPath = (len > 0) ? (isEmpty(segments[0]) ? '/' : segments[0]) : ''; |
| 3034 | let numSegments = len + index; |
| 3035 | |
| 3036 | let _isServer = isServer(path); |
| 3037 | |
| 3038 | for(let i = 1; i < len; i++) |
| 3039 | { |
| 3040 | newPath = join(newPath, segments[i]); |
| 3041 | |
| 3042 | if(i < numSegments) |
| 3043 | { |
| 3044 | if(compatible.compressed(newPath) && (!checkDirectory || _isServer || !fs.existsSync(newPath) || !fs.statSync(newPath).isDirectory())) |
| 3045 | return newPath; |
| 3046 | } |
| 3047 | } |
| 3048 | |
| 3049 | return newPath; |
| 3050 | } |
| 3051 | |
| 3052 | function firstCompressedFileRealPath(path, index = 0) |
| 3053 | { |
no test coverage detected