Skip to content

Build your personal knowledge base with Trilium Notes

client: Fix regression (front end no longer loading)

Elian Doran66108c1067da
diff --git a/src/public/app/services/attribute_parser.js b/src/public/app/services/attribute_parser.js
index 863e5f5324..fc032a252e 100644
--- a/src/public/app/services/attribute_parser.js
+++ b/src/public/app/services/attribute_parser.js
@@ -1,4 +1,4 @@
-const utils = require("./utils.js");
+import utils from "./utils.js";
function lex(str) {
str = str.trim();
@@ -121,7 +121,7 @@ function parse(tokens, str, allowEmptyRelations = false) {
const attrs = [];
function context(i) {
- let {startIndex, endIndex} = tokens[i];
+ let { startIndex, endIndex } = tokens[i];
startIndex = Math.max(0, startIndex - 20);
endIndex = Math.min(str.length, endIndex + 20);
@@ -129,7 +129,7 @@ function parse(tokens, str, allowEmptyRelations = false) {
}
for (let i = 0; i < tokens.length; i++) {
- const {text, startIndex} = tokens[i];
+ const { text, startIndex } = tokens[i];
function isInheritable() {
if (tokens.length > i + 3
@@ -222,7 +222,7 @@ function lexAndParse(str, allowEmptyRelations = false) {
return parse(tokens, str, allowEmptyRelations);
}
-module.exports = {
+export default {
lex,
parse,
lexAndParse
diff --git a/src/public/app/services/utils.js b/src/public/app/services/utils.js
index 3b0d650c04..9e17f1c38b 100644
--- a/src/public/app/services/utils.js
+++ b/src/public/app/services/utils.js
@@ -371,10 +371,10 @@ function escapeRegExp(str) {
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
}
-function areObjectsEqual () {
+function areObjectsEqual() {
let i, l, leftChain, rightChain;
- function compare2Objects (x, y) {
+ function compare2Objects(x, y) {
let p;
// remember that NaN === NaN returns false
@@ -449,7 +449,7 @@ function areObjectsEqual () {
leftChain.push(x);
rightChain.push(y);
- if (!compare2Objects (x[p], y[p])) {
+ if (!compare2Objects(x[p], y[p])) {
return false;
}
@@ -505,7 +505,7 @@ function createImageSrcUrl(note) {
return `api/images/${note.noteId}/${encodeURIComponent(note.title)}?timestamp=${Date.now()}`;
}
-module.exports = {
+export default {
reloadFrontendApp,
parseDate,
formatDateISO,