MCPcopy
hub / github.com/directus/directus / pathToRelativeUrl

Function pathToRelativeUrl

packages/utils/node/path-to-relative-url.ts:3–5  ·  view source on GitHub ↗
(filePath: string, root = '.')

Source from the content-addressed store, hash-verified

1import path from 'path';
2
3export function pathToRelativeUrl(filePath: string, root = '.'): string {
4 return path.relative(root, filePath).split(path.sep).join(path.posix.sep);
5}

Callers 8

addFunction · 0.90
toConvertSourceUrlFunction · 0.90
generateBundleEntrypointFunction · 0.90
loadConfigFunction · 0.90
importFileUrlFunction · 0.90
initializeWatcherMethod · 0.90

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected