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

Function basename

packages/core/src/utils/path.ts:203–209  ·  view source on GitHub ↗
(path: string, ext?: string)

Source from the content-addressed store, hash-verified

201
202/** JSDoc */
203export function basename(path: string, ext?: string): string {
204 let f = splitPath(path)[2] || '';
205 if (ext && f.slice(ext.length * -1) === ext) {
206 f = f.slice(0, f.length - ext.length);
207 }
208 return f;
209}

Callers 13

path.test.tsFile · 0.90
generateIterateeFunction · 0.90
rewriteFramesIterateeFunction · 0.90
prepareTmpDirFunction · 0.90
testFunction · 0.85
testFunction · 0.85
testFunction · 0.85
testFunction · 0.85
testFunction · 0.85
testFunction · 0.85
testFunction · 0.85

Calls 2

sliceMethod · 0.80
splitPathFunction · 0.70

Tested by 8

testFunction · 0.68
testFunction · 0.68
testFunction · 0.68
testFunction · 0.68
testFunction · 0.68
testFunction · 0.68
testFunction · 0.68
testFunction · 0.68