Merge remote-tracking branch 'origin/develop' into feature/investigate_tests

This commit is contained in:
Elian Doran 2024-07-16 18:33:55 +03:00
commit e89faf6786
No known key found for this signature in database
2 changed files with 8 additions and 8 deletions

View File

@ -1,4 +1,4 @@
const utils = require("./utils.js"); import utils from "./utils.js";
function lex(str) { function lex(str) {
str = str.trim(); str = str.trim();
@ -121,7 +121,7 @@ function parse(tokens, str, allowEmptyRelations = false) {
const attrs = []; const attrs = [];
function context(i) { function context(i) {
let {startIndex, endIndex} = tokens[i]; let { startIndex, endIndex } = tokens[i];
startIndex = Math.max(0, startIndex - 20); startIndex = Math.max(0, startIndex - 20);
endIndex = Math.min(str.length, endIndex + 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++) { for (let i = 0; i < tokens.length; i++) {
const {text, startIndex} = tokens[i]; const { text, startIndex } = tokens[i];
function isInheritable() { function isInheritable() {
if (tokens.length > i + 3 if (tokens.length > i + 3
@ -222,7 +222,7 @@ function lexAndParse(str, allowEmptyRelations = false) {
return parse(tokens, str, allowEmptyRelations); return parse(tokens, str, allowEmptyRelations);
} }
module.exports = { export default {
lex, lex,
parse, parse,
lexAndParse lexAndParse

View File

@ -371,10 +371,10 @@ function escapeRegExp(str) {
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
} }
function areObjectsEqual () { function areObjectsEqual() {
let i, l, leftChain, rightChain; let i, l, leftChain, rightChain;
function compare2Objects (x, y) { function compare2Objects(x, y) {
let p; let p;
// remember that NaN === NaN returns false // remember that NaN === NaN returns false
@ -449,7 +449,7 @@ function areObjectsEqual () {
leftChain.push(x); leftChain.push(x);
rightChain.push(y); rightChain.push(y);
if (!compare2Objects (x[p], y[p])) { if (!compare2Objects(x[p], y[p])) {
return false; return false;
} }
@ -505,7 +505,7 @@ function createImageSrcUrl(note) {
return `api/images/${note.noteId}/${encodeURIComponent(note.title)}?timestamp=${Date.now()}`; return `api/images/${note.noteId}/${encodeURIComponent(note.title)}?timestamp=${Date.now()}`;
} }
module.exports = { export default {
reloadFrontendApp, reloadFrontendApp,
parseDate, parseDate,
formatDateISO, formatDateISO,