mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
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
This commit is contained in:
parent
72f0de6b78
commit
d71e127828
@ -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<T, K extends string | number | symbol, V>(array: T[], fn: (item: T) => [K, V]): Record<K, V> {
|
||||
const obj: Record<K, V> = {} as Record<K, V>; // TODO: unsafe?
|
||||
|
Loading…
x
Reference in New Issue
Block a user