mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
server-ts: Port services/search/expressions/is_hidden
This commit is contained in:
parent
35886c3b00
commit
acb31b621f
@ -1,13 +1,14 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
const Expression = require('./expression');
|
import Expression = require('./expression');
|
||||||
const NoteSet = require('../note_set');
|
import NoteSet = require('../note_set');
|
||||||
|
import SearchContext = require('../search_context');
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Note is hidden when all its note paths start in hidden subtree (i.e., the note is not cloned into visible tree)
|
* Note is hidden when all its note paths start in hidden subtree (i.e., the note is not cloned into visible tree)
|
||||||
*/
|
*/
|
||||||
class IsHiddenExp extends Expression {
|
class IsHiddenExp extends Expression {
|
||||||
execute(inputNoteSet, executionContext, searchContext) {
|
execute(inputNoteSet: NoteSet, executionContext: {}, searchContext: SearchContext) {
|
||||||
const resultNoteSet = new NoteSet();
|
const resultNoteSet = new NoteSet();
|
||||||
|
|
||||||
for (const note of inputNoteSet.notes) {
|
for (const note of inputNoteSet.notes) {
|
||||||
@ -20,4 +21,4 @@ class IsHiddenExp extends Expression {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = IsHiddenExp;
|
export = IsHiddenExp;
|
@ -19,7 +19,7 @@ const buildComparator = require('./build_comparator.js');
|
|||||||
const ValueExtractor = require('../value_extractor');
|
const ValueExtractor = require('../value_extractor');
|
||||||
const utils = require('../../utils');
|
const utils = require('../../utils');
|
||||||
const TrueExp = require('../expressions/true');
|
const TrueExp = require('../expressions/true');
|
||||||
const IsHiddenExp = require('../expressions/is_hidden.js');
|
const IsHiddenExp = require('../expressions/is_hidden');
|
||||||
|
|
||||||
function getFulltext(tokens, searchContext) {
|
function getFulltext(tokens, searchContext) {
|
||||||
tokens = tokens.map(t => utils.removeDiacritic(t.token));
|
tokens = tokens.map(t => utils.removeDiacritic(t.token));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user