From 0f7f0ceedcf1ff8cdc8429f9388ae96e6e3acff1 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 18 Feb 2024 01:18:20 +0200 Subject: [PATCH] server-ts: Port services/search/expressions/parent_of --- .../expressions/{parent_of.js => parent_of.ts} | 13 ++++++++----- src/services/search/services/parse.js | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) rename src/services/search/expressions/{parent_of.js => parent_of.ts} (68%) diff --git a/src/services/search/expressions/parent_of.js b/src/services/search/expressions/parent_of.ts similarity index 68% rename from src/services/search/expressions/parent_of.js rename to src/services/search/expressions/parent_of.ts index 9a474ed40..bd7b9d304 100644 --- a/src/services/search/expressions/parent_of.js +++ b/src/services/search/expressions/parent_of.ts @@ -1,16 +1,19 @@ "use strict"; -const Expression = require('./expression'); -const NoteSet = require('../note_set'); +import Expression = require('./expression'); +import NoteSet = require('../note_set'); +import SearchContext = require('../search_context'); class ParentOfExp extends Expression { - constructor(subExpression) { + private subExpression: Expression; + + constructor(subExpression: Expression) { super(); this.subExpression = subExpression; } - execute(inputNoteSet, executionContext, searchContext) { + execute(inputNoteSet: NoteSet, executionContext: {}, searchContext: SearchContext) { const subInputNoteSet = new NoteSet(); for (const note of inputNoteSet.notes) { @@ -33,4 +36,4 @@ class ParentOfExp extends Expression { } } -module.exports = ParentOfExp; +export = ParentOfExp; diff --git a/src/services/search/services/parse.js b/src/services/search/services/parse.js index eb6c03000..28d6b6afe 100644 --- a/src/services/search/services/parse.js +++ b/src/services/search/services/parse.js @@ -6,7 +6,7 @@ const OrExp = require('../expressions/or'); const NotExp = require('../expressions/not'); const ChildOfExp = require('../expressions/child_of'); const DescendantOfExp = require('../expressions/descendant_of'); -const ParentOfExp = require('../expressions/parent_of.js'); +const ParentOfExp = require('../expressions/parent_of'); const RelationWhereExp = require('../expressions/relation_where.js'); const PropertyComparisonExp = require('../expressions/property_comparison.js'); const AttributeExistsExp = require('../expressions/attribute_exists');