Atom

path.normalize()

Normalizes separators and dot segments.

Signature

path.normalize(value[, style])

Parameters

Text path plus optional style.

Returns

String.

Behavior

Cancels parent segments where possible and keeps the root semantics.

Errors

Malformed path or style.

Example

Atom
use path
assert(path.normalize('/tmp/a/../b', 'unix') == '/tmp/b')