MCPcopy
hub / github.com/zh-lx/code-inspector / normalizePath

Function normalizePath

packages/core/src/shared/utils.ts:42–51  ·  view source on GitHub ↗
(filepath: string)

Source from the content-addressed store, hash-verified

40}
41
42export function normalizePath(filepath: string) {
43 let normalizedPath = path.normalize(filepath);
44
45 // Convert Windows path separators to Mac path separators
46 if (process.platform === 'win32') {
47 normalizedPath = normalizedPath.replace(/\\/g, '/');
48 }
49
50 return normalizedPath;
51}
52
53export function isAstroToolbarFile(file: string) {
54 const normalizedFile = normalizePath(file).replace(/\0/g, '__x00__');

Callers 12

MakoCodeInspectorPluginFunction · 0.90
isTargetFileToInjectFunction · 0.90
recordInjectToFunction · 0.90
getCodeWithWebComponentFunction · 0.90
getNodeFilePathFunction · 0.90
loadFunction · 0.90
transformFunction · 0.90
WebpackCodeInjectLoaderFunction · 0.90
convertToAbsolutePathFunction · 0.90
isAstroToolbarFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected