resolvePathFromProjectRoot function

  1. @visibleForTesting
String resolvePathFromProjectRoot({
  1. required String projectRoot,
  2. required String path,
})

Resolves path relative to projectRoot, or returns the normalized path when it is absolute.

Implementation

@visibleForTesting
String resolvePathFromProjectRoot({
  required String projectRoot,
  required String path,
}) {
  if (p.isAbsolute(path)) {
    return p.normalize(path);
  }
  return p.normalize(p.join(projectRoot, path));
}