canonicalize method
- String path
Canonicalizes path
.
This is guaranteed to return the same path for two different input paths if and only if both input paths point to the same location. Unlike normalize, it returns absolute paths when possible and canonicalizes ASCII case on Windows.
Note that this does not resolve symlinks.
If you want a map that uses path keys, it's probably more efficient to use a Map with equals and hash specified as the callbacks to use for keys than it is to canonicalize every key.
Implementation
String canonicalize(String path) {
path = absolute(path);
if (style != Style.windows && !_needsNormalization(path)) return path;
final parsed = _parse(path);
parsed.normalize(canonicalize: true);
return parsed.toString();
}