(uri)
| 12 | export { clearHighlightCache, sanitize }; |
| 13 | |
| 14 | export function getFilename(uri) { |
| 15 | if (!uri) return ""; |
| 16 | try { |
| 17 | const decoded = decodeURIComponent(uri); |
| 18 | const parts = decoded.split("/").filter(Boolean); |
| 19 | return parts.pop() || ""; |
| 20 | } catch { |
| 21 | const parts = uri.split("/").filter(Boolean); |
| 22 | return parts.pop() || ""; |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | export function escapeRegExp(string) { |
| 27 | return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); |