Function: normalize()
ts
function normalize(path): string;Normalize a file system path by removing any unnecessary "." and ".." segments and resolving any directory separators to match the host operating system.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | The file system path to be normalized. |
Returns
string
The normalized path.
Example
ts
normalize('/users/john/../jane/./docs/') // => '/users/jane/docs/'Since
1.0.0