Universal DevTools Kit SDK / @u-devtools/utils-node / safeResolve
Function: safeResolve()
safeResolve(
root,targetPath):string
Defined in: path.ts:27
Safely resolves a file path relative to a root directory. Throws an error if the resolved path is outside the root directory.
Parameters
| Parameter | Type | Description |
|---|---|---|
root | string | The root directory path |
targetPath | string | The target path (relative or absolute) |
Returns
string
The resolved absolute path
Throws
Error if the path is outside the root directory