Skip to content

Build your personal knowledge base with Trilium Notes

Merge pull request #873 from pano9000/refactor_use_Set

Elian Doran2556d51870d3
diff --cc src/services/utils.ts
index b4155bc33f,867e6d659a..040cefc026
--- a/src/services/utils.ts
+++ b/src/services/utils.ts
@@@ -158,16 -158,16 +158,16 @@@ const STRING_MIME_TYPES = new Set(
"application/json",
"application/x-sql",
"image/svg+xml"
- ];
+ ]);
-function isStringNote(type: string | undefined, mime: string) {
+export function isStringNote(type: string | undefined, mime: string) {
// render and book are string note in the sense that they are expected to contain empty string
return (type && ["text", "code", "relationMap", "search", "render", "book", "mermaid", "canvas"].includes(type))
|| mime.startsWith('text/')
- || STRING_MIME_TYPES.includes(mime);
+ || STRING_MIME_TYPES.has(mime);
}
-function quoteRegex(url: string) {
+export function quoteRegex(url: string) {
return url.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&');
}