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

Function isBareRelative

packages/vite/src/node/server/middlewares/indexHtml.ts:126–128  ·  view source on GitHub ↗
(url: string)

Source from the content-addressed store, hash-verified

124const wordCharRE = /\w/
125
126function isBareRelative(url: string) {
127 return wordCharRE.test(url[0]) && !url.includes(':')
128}
129
130function getHtmlDirnameForRelativeUrl(htmlPath: string): string {
131 return htmlPath.endsWith('/') ? htmlPath : path.posix.dirname(htmlPath)

Callers 1

replacerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected