Skip to content

Commit

Permalink
refactor: . Inline variables that were used only once
Browse files Browse the repository at this point in the history
  • Loading branch information
claremacrae committed Oct 31, 2024
1 parent 4183a2f commit 48ed4b2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/Query/Explain/Explainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,26 +49,23 @@ export class Explainer {
}

public explainFilters(query: Query) {
const numberOfFilters = query.filters.length;
if (numberOfFilters === 0) {
if (query.filters.length === 0) {
return this.indent('No filters supplied. All tasks will match the query.\n');
}

return query.filters.map((filter) => filter.explainFilterIndented(this.indentation)).join('\n');
}

public explainGroups(query: Query) {
const numberOfGroups = query.grouping.length;
if (numberOfGroups === 0) {
if (query.grouping.length === 0) {
return this.indent('No grouping instructions supplied.\n');
}

return query.grouping.map((group) => this.indentation + group.instruction).join('\n') + '\n';
}

public explainSorters(query: Query) {
const numberOfSorters = query.sorting.length;
if (numberOfSorters === 0) {
if (query.sorting.length === 0) {
return this.indent('No sorting instructions supplied.\n');
}

Expand Down

0 comments on commit 48ed4b2

Please sign in to comment.