normalize function

String normalize(
  1. String path
)

Normalizes path, simplifying it by handling .., and ., and removing redundant path separators whenever possible.

Note that this is not guaranteed to return the same result for two equivalent input paths. For that, see canonicalize. Or, if you're using paths as map keys use equals and hash as the key callbacks.

p.normalize('path/./to/..//file.text'); // -> 'path/file.txt'

Implementation

String normalize(String path) => context.normalize(path);