update:部分样式优化
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Storage metadata keeps workspace files under
|
||||
* `workspace/<owner-user-id>/<logical-path>`. That owner segment is an
|
||||
* implementation detail and should never be presented as part of a script's
|
||||
* user-facing path.
|
||||
*/
|
||||
export function displayScriptPath(relativePath: string): string {
|
||||
const normalized = relativePath.replaceAll("\\", "/");
|
||||
const parts = normalized.split("/");
|
||||
|
||||
if (parts[0] === "workspace" && parts[1] && parts.length > 2) {
|
||||
return parts.slice(2).join("/");
|
||||
}
|
||||
|
||||
return normalized;
|
||||
}
|
||||
Reference in New Issue
Block a user