MCPcopy Create free account
hub / github.com/ZToolsCenter/ZTools / decodeFileUrlToPath

Function decodeFileUrlToPath

src/main/utils/common.ts:57–68  ·  view source on GitHub ↗
(fileUrl: string)

Source from the content-addressed store, hash-verified

55}
56
57export function decodeFileUrlToPath(fileUrl: string): string {
58 try {
59 return fileURLToPath(fileUrl)
60 } catch {
61 const fallbackPath = fileUrl.replace(/^file:\/\/\//, '').replace(/\//g, '\\')
62 try {
63 return decodeURIComponent(fallbackPath)
64 } catch {
65 return fallbackPath
66 }
67 }
68}
69
70/**
71 * 根据窗口类名与 hwnd 读取 Explorer 当前目录。

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected