Resolve filePath relative to rootPath and return a clean unix-style relative path, or null if the file is outside the root.
filePath
rootPath
null
.
..
path.resolve
./
Already-resolved absolute root directory.
Absolute or relative file path to normalize.
Clean unix relative path (e.g. "src/index.ts"), or null.
"src/index.ts"
Resolve
filePathrelative torootPathand return a clean unix-style relative path, ornullif the file is outside the root..and..segments viapath.resolve../.nullfor paths that resolve outsiderootPath.nullfor empty strings.