nit toast

This commit is contained in:
Ruben Fiszel
2024-11-11 17:48:09 +01:00
parent 768ce7171b
commit a7ef75a417

View File

@@ -1,8 +1,8 @@
//regex that match path starting with u/ or f/ and with at least 2 /
const pathRegex = /\b(u|f)\/[^\/\s]+\/[^\/\s]+\b/g
export function processMessage(message: string): string {
return message.replaceAll(pathRegex, (path) => {
export function processMessage(message: string | undefined): string {
return (message ?? 'Error without message').replaceAll(pathRegex, (path) => {
return `<span class="bg-surface-secondary p-1 text-xs font-mono whitespace-nowrap rounded-md">${path}</span>`
})
}