MCPcopy
hub / github.com/evanw/esbuild / join

Method join

internal/fs/filepath.go:516–526  ·  view source on GitHub ↗

Join joins any number of path elements into a single path, separating them with an OS specific Separator. Empty elements are ignored. The result is Cleaned. However, if the argument list is empty or all its elements are empty, Join returns an empty string. On Windows, the result will only be a UNC p

(elem []string)

Source from the content-addressed store, hash-verified

514// On Windows, the result will only be a UNC path if the first
515// non-empty element is a UNC path.
516func (fp goFilepath) join(elem []string) string {
517 for i, e := range elem {
518 if e != "" {
519 if fp.isWindows {
520 return fp.joinNonEmpty(elem[i:])
521 }
522 return fp.clean(strings.Join(elem[i:], string(fp.pathSeparator)))
523 }
524 }
525 return ""
526}
527
528// joinNonEmpty is like join, but it assumes that the first element is non-empty.
529func (fp goFilepath) joinNonEmpty(elem []string) string {

Callers 15

absMethod · 0.95
esbuildCommandAndArgsFunction · 0.80
randomFileNameFunction · 0.80
node-install.tsFile · 0.80
installUsingNPMFunction · 0.80
removeRecursiveFunction · 0.80
maybeOptimizePackageFunction · 0.80
pkgForSomeOtherPlatformFunction · 0.80
downloadedBinPathFunction · 0.80
generateBinPathFunction · 0.80

Calls 3

joinNonEmptyMethod · 0.95
cleanMethod · 0.95
JoinMethod · 0.65

Tested by 2

testFunction · 0.64
testFunction · 0.64