Skip to content

Commit

Permalink
Remove unused escapeHTML function
Browse files Browse the repository at this point in the history
  • Loading branch information
nas-tabchiche committed Jun 11, 2024
1 parent 93cc133 commit b3f646b
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions frontend/src/lib/utils/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export function formatStringToDate(inputString: string, locale: string = 'en') {
export function formatStringToDate(inputString: string, locale = 'en') {
const date = new Date(inputString);
return date.toLocaleDateString(locale, {
year: 'numeric',
Expand All @@ -7,19 +7,6 @@ export function formatStringToDate(inputString: string, locale: string = 'en') {
});
}

export const escapeHTML = (str: string) =>
str.replace(
/[&<>'"]/g,
(tag) =>
({
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
"'": '&#39;',
'"': '&quot;'
}[tag] || tag)
);

export const isURL = (url: string) => {
try {
new URL(url);
Expand Down

0 comments on commit b3f646b

Please sign in to comment.