Skip to content

Commit

Permalink
refactor(frontend): tidy decode helper
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Mar 12, 2024
1 parent bf82e78 commit 3c69a88
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/frontend/src/helpers/decode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import { log } from './log';
* @returns - Decoded string.
*/
export function decode(text: string) {
if (typeof text !== 'string') {
log.error(`Invalid string: ${text}`);
if (typeof text === 'string') {
return text.replaceAll('&gt;', '>').replaceAll('&lt;', '<');
}
return text.replaceAll('&gt;', '>').replaceAll('&lt;', '<');
log.error(`Invalid string: ${text}`);
return text;
}

0 comments on commit 3c69a88

Please sign in to comment.