MCPcopy Index your code
hub / github.com/promptfoo/promptfoo / normalizeFilePath

Function normalizeFilePath

src/util/functions/loadFunction.ts:94–99  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

92const WIN32_DRIVE_PREFIX = /^\/[A-Za-z]:[\\/]/;
93
94function normalizeFilePath(filePath: string): string {
95 if (process.platform === 'win32' && WIN32_DRIVE_PREFIX.test(filePath)) {
96 return filePath.slice(1);
97 }
98 return filePath;
99}
100
101/**
102 * Extracts the file path and function name from a file:// URL

Callers 1

parseFileUrlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…