From d71e127828f7d9bc29c2d6f1e47b7dd435b24920 Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Fri, 31 Jan 2025 23:32:44 +0100 Subject: [PATCH] refactor(server/utils): re-export escape/unescape instead of wrapping them in function -> since the functions did not do *anything* other than calling the escape/unescape module -> let's just re-export them directly --- src/services/utils.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/services/utils.ts b/src/services/utils.ts index bc35fe10f..ba9751965 100644 --- a/src/services/utils.ts +++ b/src/services/utils.ts @@ -81,13 +81,9 @@ export function sanitizeSqlIdentifier(str: string) { return str.replace(/[^A-Za-z0-9_]/g, ""); } -export function escapeHtml(str: string) { - return escape(str); -} +export const escapeHtml = escape; -export function unescapeHtml(str: string) { - return unescape(str); -} +export const unescapeHtml = unescape; export function toObject(array: T[], fn: (item: T) => [K, V]): Record { const obj: Record = {} as Record; // TODO: unsafe?