- fs-tree: requireAbsolute 改用 path.isAbsolute(win32 UNC 放行、C:foo 仍拒); 目录列表仅对 symlink 行 stat 一次,暴露 isSymlink/broken,目录软链接可展开 - html-route: UNC 路径经 '//' 标记编码往返;标记仅在 Windows 风格会话启用, POSIX '//' 绝对路径不再被误判(平台守卫) - client: isAbsolutePath/isWindowsStylePath 镜像 + resolveSidebarPath 识别 UNC, htmlUrl 以会话 cwd 形态传递平台信号;FsEntry 增加 isSymlink/broken - explorer: 软链接行链接徽标、悬空链接标红 + tooltip(issue #65) - 测试: tests/platform.ts 守卫助手;win32 专属用例改为 skipIf 可见跳过, 补 POSIX 反向分支与 UNC 矩阵;新增 fs-tree-symlink.spec
14 lines
565 B
TypeScript
14 lines
565 B
TypeScript
/**
|
|
* Shared platform guards for tests. Use vitest's `describe.skipIf` /
|
|
* `it.skipIf` with these so platform-specific cases are REPORTED as skipped
|
|
* on other hosts instead of silently passing through an inline `if` — and
|
|
* so the opposite branch (e.g. POSIX rejecting drive paths) is always
|
|
* asserted on the matching host.
|
|
*/
|
|
|
|
/** True when running on Windows (drive letters / UNC path semantics apply). */
|
|
export const isWin32 = process.platform === 'win32'
|
|
|
|
/** True on every non-Windows host (POSIX path semantics). */
|
|
export const isPosix = !isWin32
|