mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
13 lines
241 B
TypeScript
13 lines
241 B
TypeScript
// ensure that path always starts with /
|
|
export default function formatFilePath(path: string) {
|
|
if (path[0] === '.' && path[1] === '/') {
|
|
return path.slice(1);
|
|
}
|
|
|
|
if (path[0] === '/') {
|
|
return path;
|
|
}
|
|
|
|
return '/' + path;
|
|
}
|