mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-30 03:32:26 +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, "");
|
return str.replace(/[^A-Za-z0-9_]/g, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
export function escapeHtml(str: string) {
|
export const escapeHtml = escape;
|
||||||
return escape(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function unescapeHtml(str: string) {
|
export const unescapeHtml = unescape;
|
||||||
return unescape(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function toObject<T, K extends string | number | symbol, V>(array: T[], fn: (item: T) => [K, V]): Record<K, V> {
|
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?
|
const obj: Record<K, V> = {} as Record<K, V>; // TODO: unsafe?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user