normalizeSourcePathInput function

String? normalizeSourcePathInput(
  1. String repoRoot,
  2. String? rawPath, {
  3. String? canonicalRoot,
})

Normalizes a raw sourceFile path—including file:// URIs inside repoRoot, package:<pkg>/<path> URIs, org-dartlang-app:/// URIs, or repository-relative paths—into a clean POSIX path strictly confined within repoRoot.

Returns null if rawPath is empty or attempts to escape repoRoot.

Implementation

String? normalizeSourcePathInput(
  String repoRoot,
  String? rawPath, {
  String? canonicalRoot,
}) => _normalizeSourceInputDetailed(
  canonicalRoot: canonicalRoot ?? _canonicalizeRepoRoot(repoRoot),
  rawPath: rawPath,
).relPath;