withTrailingSlash() — vite Function Reference
Architecture documentation for the withTrailingSlash() function in utils.ts from the vite codebase.
Entity Profile
Dependency Diagram
graph TD 1a3bec7b_1a11_316f_5831_a0535b829bbf["withTrailingSlash()"] abfc9e70_3c15_b3f0_a595_3cf27afb7e64["utils.ts"] 1a3bec7b_1a11_316f_5831_a0535b829bbf -->|defined in| abfc9e70_3c15_b3f0_a595_3cf27afb7e64 58c4a210_68fe_1b4d_ed49_d59203f97ef1["resolveConfig()"] 58c4a210_68fe_1b4d_ed49_d59203f97ef1 -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf eec82f76_7029_ae97_4449_1665a4f204d8["fileToDevUrl()"] eec82f76_7029_ae97_4449_1665a4f204d8 -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf 1e925d7e_c386_076f_28e6_2f4d5f82fbdd["normalizeResolvedIdToUrl()"] 1e925d7e_c386_076f_28e6_2f4d5f82fbdd -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf a1fc1de5_905b_efe7_d960_3597604fbdfe["importAnalysisPlugin()"] a1fc1de5_905b_efe7_d960_3597604fbdfe -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf 9bace565_4b23_b1e6_8d82_883dae6cfae8["matches()"] 9bace565_4b23_b1e6_8d82_883dae6cfae8 -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf 6c8076cd_ccbd_1423_ce70_db93911678f5["areSeparateFolders()"] 6c8076cd_ccbd_1423_ce70_db93911678f5 -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf 573ab5b5_1ca7_8516_40b9_cab59ab7a7c0["buildReporterPlugin()"] 573ab5b5_1ca7_8516_40b9_cab59ab7a7c0 -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf a2e55a70_b7b6_bce2_e066_aea4c516313e["tryOptimizedResolve()"] a2e55a70_b7b6_bce2_e066_aea4c516313e -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf be351481_35b7_f392_a229_ac14e1fa7efb["checkPublicFile()"] be351481_35b7_f392_a229_ac14e1fa7efb -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf 2ff971ab_04c3_0402_34fc_dc2f5f3103ec["getShortName()"] 2ff971ab_04c3_0402_34fc_dc2f5f3103ec -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf 8f73b680_d5b9_383c_f695_c906b80fb1e6["handleHMRUpdate()"] 8f73b680_d5b9_383c_f695_c906b80fb1e6 -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf 8e6cd7a2_b085_0a8f_7999_c4deeeb6ef5e["baseMiddleware()"] 8e6cd7a2_b085_0a8f_7999_c4deeeb6ef5e -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf 7e76fb1f_0d85_1b5a_15ce_269a9f256af9["serveStaticMiddleware()"] 7e76fb1f_0d85_1b5a_15ce_269a9f256af9 -->|calls| 1a3bec7b_1a11_316f_5831_a0535b829bbf style 1a3bec7b_1a11_316f_5831_a0535b829bbf fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/vite/src/shared/utils.ts lines 48–53
export function withTrailingSlash(path: string): string {
if (path[path.length - 1] !== '/') {
return `${path}/`
}
return path
}
Domain
Subdomains
Defined In
Called By
- areSeparateFolders()
- baseMiddleware()
- buildReporterPlugin()
- checkPublicFile()
- ensureWatchedFile()
- fileToDevUrl()
- getShortName()
- handleHMRUpdate()
- importAnalysisPlugin()
- isParentDirectory()
- matches()
- moduleListContains()
- normalizeResolvedIdToUrl()
- resolveConfig()
- resolveEmptyOutDir()
- serveStaticMiddleware()
- stripBase()
- transformMiddleware()
- tryOptimizedResolve()
Source
Frequently Asked Questions
What does withTrailingSlash() do?
withTrailingSlash() is a function in the vite codebase, defined in packages/vite/src/shared/utils.ts.
Where is withTrailingSlash() defined?
withTrailingSlash() is defined in packages/vite/src/shared/utils.ts at line 48.
What calls withTrailingSlash()?
withTrailingSlash() is called by 19 function(s): areSeparateFolders, baseMiddleware, buildReporterPlugin, checkPublicFile, ensureWatchedFile, fileToDevUrl, getShortName, handleHMRUpdate, and 11 more.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free