JSDoc
(filename: string)
| 54 | const splitPathRe = /^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/; |
| 55 | /** JSDoc */ |
| 56 | function 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 |