calckey/packages/client/src/scripts/safe-uri-decode.ts

8 lines
124 B
TypeScript

export function safeURIDecode(str: string): string {
try {
return decodeURIComponent(str);
} catch {
return str;
}
}