normalize
Import from @varavel/vdl-plugin-sdk/utils/paths.
function normalize(path): string;
Normalizes a path by collapsing redundant separators and dot segments.
This is helpful when plugin code receives mixed Windows and POSIX-style path input and needs a single predictable format.
Parameters
| Parameter | Type | Description |
|---|---|---|
path | string | Path to normalize. |
Returns
string
The normalized path using / separators.
Example
normalize("generated\\models/../types/user.ts");
// returns "generated/types/user.ts"
See
Powered by pathe (MIT License): https://github.com/unjs/pathe