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

Function splitPath

packages/core/src/utils/path.ts:56–62  ·  view source on GitHub ↗

JSDoc

(filename: string)

Source from the content-addressed store, hash-verified

54const splitPathRe = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;
55/** JSDoc */
56function splitPath(filename: string): string[] {
57 // Truncate files names greater than 1024 characters to avoid regex dos
58 // https://github.com/getsentry/sentry-javascript/pull/8737#discussion_r1285719172
59 const truncated = filename.length > 1024 ? `<truncated>${filename.slice(-1024)}` : filename;
60 const parts = splitPathRe.exec(truncated);
61 return parts ? parts.slice(1) : [];
62}
63
64// path.resolve([from ...], to)
65// posix version

Callers 2

dirnameFunction · 0.70
basenameFunction · 0.70

Calls 2

sliceMethod · 0.80
execMethod · 0.80

Tested by

no test coverage detected