* Whether `child` is `parent` or lies under it, compared exactly as given. * * A root (`C:\`, `\\server\share\`, `/`) already ends with its separator, so * none is added to it. Adding one made `C:\\` the prefix, which no path under * the root starts with, so a project at a drive root indexed not
(child: string, parent: string)
| 91 | * the root starts with, so a project at a drive root indexed nothing (#415). |
| 92 | */ |
| 93 | function isSameOrUnder(child: string, parent: string): boolean { |
| 94 | if (child === parent) return true; |
| 95 | return child.startsWith(parent.endsWith(path.sep) ? parent : parent + path.sep); |
| 96 | } |
| 97 | |
| 98 | /** |
| 99 | * Whether `child` is `parent` itself or sits underneath it. Case-insensitive on |
no outgoing calls
no test coverage detected