MCPcopy
hub / github.com/mafintosh/why-is-node-running / formatFilePath

Function formatFilePath

index.js:92–97  ·  view source on GitHub ↗
(filePath)

Source from the content-addressed store, hash-verified

90}
91
92function formatFilePath (filePath) {
93 const absolutePath = normalizeFilePath(filePath)
94 const relativePath = relative(process.cwd(), absolutePath)
95
96 return relativePath.startsWith('..') ? absolutePath : relativePath
97}
98
99function normalizeFilePath (filePath) {
100 return filePath.startsWith('file://') ? fileURLToPath(filePath) : filePath

Callers 1

formatLocationFunction · 0.85

Calls 1

normalizeFilePathFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…