(_path: string, parentName: string)
| 14 | export const containsChild = (_path: string, child: string) => fs.existsSync(path.join(_path, child)) |
| 15 | |
| 16 | export const findDirectoryInTree = (_path: string, parentName: string) => { |
| 17 | const parents = getDir(_path).split(path.sep); |
| 18 | const indexOfParent = parents.lastIndexOf(parentName); |
| 19 | if (indexOfParent < 0) return undefined; |
| 20 | return path.join(path.parse(_path).root, ...parents.slice(0, indexOfParent + 1)); |
| 21 | } |
| 22 | |
| 23 | export const findChild = (_path: string, childOrPossibleChildren: string | string[]): string | undefined => { |
| 24 | if (Array.isArray(childOrPossibleChildren)) { |
no test coverage detected