MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / dirname

Function dirname

packages/core/src/utils/path.ts:184–200  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

182
183/** JSDoc */
184export function dirname(path: string): string {
185 const result = splitPath(path);
186 const root = result[0] || '';
187 let dir = result[1];
188
189 if (!root && !dir) {
190 // No dirname whatsoever
191 return '.';
192 }
193
194 if (dir) {
195 // It has a dirname, strip trailing slash
196 dir = dir.slice(0, dir.length - 1);
197 }
198
199 return root + dir;
200}
201
202/** JSDoc */
203export function basename(path: string, ext?: string): string {

Callers 15

path.test.tsFile · 0.90
vite.config.tsFile · 0.90
appRootFromErrorStackFunction · 0.90
takeHeapSnapshotMethod · 0.90
eslint.config.mjsFile · 0.90
global-setup.mjsFile · 0.90
eslint.config.mjsFile · 0.90
global-setup.mjsFile · 0.90
global-setup.mjsFile · 0.90
global-setup.mjsFile · 0.90

Calls 2

sliceMethod · 0.80
splitPathFunction · 0.70

Tested by 1

getDiagnosticsForFixtureFunction · 0.68