( realRoot: string, candidate: string, pathModule: path.PlatformPath )
| 273 | } |
| 274 | |
| 275 | function isPathWithinRoot( |
| 276 | realRoot: string, |
| 277 | candidate: string, |
| 278 | pathModule: path.PlatformPath |
| 279 | ): boolean { |
| 280 | const relative = pathModule.relative(realRoot, candidate); |
| 281 | return relative === "" || (!relative.startsWith("..") && !pathModule.isAbsolute(relative)); |
| 282 | } |
| 283 | |
| 284 | /** |
| 285 | * Stable project identity for memory scope contexts ("" disables project |
no test coverage detected