mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
better handling of incorrect operators
This commit is contained in:
parent
34f07b4376
commit
876e6caa23
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "trilium",
|
||||
"version": "0.55.1",
|
||||
"version": "0.56.0-beta",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "trilium",
|
||||
"version": "0.55.1",
|
||||
"version": "0.56.0-beta",
|
||||
"hasInstallScript": true,
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
|
@ -21,9 +21,9 @@
|
||||
"build-frontend-docs": "rm -r ./docs/frontend_api && ./node_modules/.bin/jsdoc -c jsdoc-conf.json -d ./docs/frontend_api src/public/app/entities/*.js src/public/app/services/frontend_script_api.js src/public/app/widgets/collapsible_widget.js",
|
||||
"build-docs": "npm run build-backend-docs && npm run build-frontend-docs",
|
||||
"webpack": "npx webpack -c webpack-desktop.config.js && npx webpack -c webpack-mobile.config.js && npx webpack -c webpack-setup.config.js",
|
||||
"test": "jasmine",
|
||||
"test-jasmine": "jasmine",
|
||||
"test-es6": "node -r esm spec-es6/attribute_parser.spec.js ",
|
||||
"test-all": "npm run test && npm run test-es6",
|
||||
"test": "npm run test-jasmine && npm run test-es6",
|
||||
"postinstall": "rimraf ./node_modules/canvas"
|
||||
},
|
||||
"dependencies": {
|
||||
|
@ -39,12 +39,25 @@ function getFulltext(tokens, searchContext) {
|
||||
}
|
||||
}
|
||||
|
||||
const OPERATORS = [
|
||||
"=",
|
||||
"!=",
|
||||
"*=*",
|
||||
"*=",
|
||||
"=*",
|
||||
">",
|
||||
">=",
|
||||
"<",
|
||||
"<=",
|
||||
"%="
|
||||
];
|
||||
|
||||
function isOperator(token) {
|
||||
if (Array.isArray(token)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return token.token.match(/^[!=<>*%]+$/);
|
||||
return OPERATORS.includes(token.token);
|
||||
}
|
||||
|
||||
function getExpression(tokens, searchContext, level = 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user