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

Function isParentDirectory

packages/vite/src/node/utils.ts:256–262  ·  view source on GitHub ↗
(dir: string, file: string)

Source from the content-addressed store, hash-verified

254 * @returns true if dir is a parent of file
255 */
256export function isParentDirectory(dir: string, file: string): boolean {
257 dir = withTrailingSlash(dir)
258 return (
259 file.startsWith(dir) ||
260 (isCaseInsensitiveFS && file.toLowerCase().startsWith(dir.toLowerCase()))
261 )
262}
263
264/**
265 * Check if 2 file name are identical

Callers 8

resolveConfigFunction · 0.90
injectSourcesContentFunction · 0.90
resolveServerOptionsFunction · 0.90
isFileInTargetPathFunction · 0.90
indexHtmlMiddlewareFunction · 0.90
handlerFunction · 0.90
utils.spec.tsFile · 0.90

Calls 1

withTrailingSlashFunction · 0.90

Tested by

no test coverage detected