MCPcopy
hub / github.com/vitejs/vite / joinUrlSegments

Function joinUrlSegments

packages/plugin-legacy/src/index.ts:90–101  ·  view source on GitHub ↗
(a: string, b: string)

Source from the content-addressed store, hash-verified

88 : config.base
89}
90function joinUrlSegments(a: string, b: string): string {
91 if (!a || !b) {
92 return a || b || ''
93 }
94 if (a.endsWith('/')) {
95 a = a.substring(0, a.length - 1)
96 }
97 if (b[0] !== '/') {
98 b = '/' + b
99 }
100 return a + b
101}
102
103function toAssetPathFromHtml(
104 filename: string,

Callers 1

toOutputFilePathInHtmlFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected