(parent: string, child: string)
| 190 | * Gets whether the child is a subdirectory of its parent. |
| 191 | */ |
| 192 | export const isSubdirectoryOf = (parent: string, child: string) => { |
| 193 | const rel = path.relative(parent, child); |
| 194 | return rel.length && !path.isAbsolute(rel) && !rel.startsWith('..'); |
| 195 | }; |
| 196 | |
| 197 | /** |
| 198 | * Returns whether the path looks like a UNC path. |
no test coverage detected