MCPcopy
hub / github.com/esm-dev/esm.sh / relPath

Function relPath

server/utils.go:108–114  ·  view source on GitHub ↗

relPath returns a relative path from the base path to the target path.

(basePath, targetPath string)

Source from the content-addressed store, hash-verified

106
107// relPath returns a relative path from the base path to the target path.
108func relPath(basePath, targetPath string) (string, error) {
109 rp, err := filepath.Rel(basePath, targetPath)
110 if err == nil && !isRelPathSpecifier(rp) {
111 rp = "./" + rp
112 }
113 return rp, err
114}
115
116// findFiles returns a list of files in the given directory.
117func findFiles(root string, dir string, filter func(filename string) bool) ([]string, error) {

Callers 2

resolveExternalModuleMethod · 0.85
transformDTSFunction · 0.85

Calls 1

isRelPathSpecifierFunction · 0.70

Tested by

no test coverage detected