canonicalize function

String canonicalize(
  1. String path
)

Canonicalizes path.

This function implements the behavior of canonicalize from package:path. However, it does not change the ASCII case of the path. See https://github.com/dart-lang/path/issues/102.

Implementation

String canonicalize(String path) {
  return p.normalize(p.absolute(path)).replaceAll(r'\', '/');
}