Skip to content

Commit

Permalink
client: Fix regression (front end no longer loading)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Jul 16, 2024
1 parent eff6ca3 commit 66108c1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/public/app/services/attribute_parser.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const utils = require("./utils.js");
import utils from "./utils.js";

function lex(str) {
str = str.trim();
Expand Down Expand Up @@ -121,15 +121,15 @@ 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);

return `"${startIndex !== 0 ? "..." : ""}${str.substr(startIndex, endIndex - startIndex)}${endIndex !== str.length ? "..." : ""}"`;
}

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
Expand Down Expand Up @@ -222,7 +222,7 @@ function lexAndParse(str, allowEmptyRelations = false) {
return parse(tokens, str, allowEmptyRelations);
}

module.exports = {
export default {
lex,
parse,
lexAndParse
Expand Down
8 changes: 4 additions & 4 deletions src/public/app/services/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 66108c1

Please sign in to comment.