mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-01 05:29:29 +00:00
11 lines
323 B
TypeScript
11 lines
323 B
TypeScript
export const escape = (str: string): string => {
|
|
try {
|
|
return str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|
|
} catch (ee: any) {
|
|
console.error(ee)
|
|
}
|
|
return str
|
|
}
|
|
|
|
export const unescape = (str: string): string => str.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>')
|