(filePath: string)
| 147 | }; |
| 148 | |
| 149 | export function splitFilePath(filePath: string): SplitFilePath { |
| 150 | const file = path.basename(filePath); |
| 151 | const folders: string[] = []; |
| 152 | // eslint-disable-next-line functional/no-loop-statements |
| 153 | for ( |
| 154 | // eslint-disable-next-line functional/no-let |
| 155 | let dirPath = path.dirname(filePath); |
| 156 | path.dirname(dirPath) !== dirPath; |
| 157 | dirPath = path.dirname(dirPath) |
| 158 | ) { |
| 159 | // eslint-disable-next-line functional/immutable-data |
| 160 | folders.unshift(path.basename(dirPath)); |
| 161 | } |
| 162 | return { folders, file }; |
| 163 | } |
| 164 | |
| 165 | export function truncatePaths(paths: string[]): string[] { |
| 166 | const segmentedPaths = paths |
no outgoing calls
no test coverage detected