Skip to content

Commit fcf13a9

Browse files
committed
refactor: Re-order grouping methods for consistency with sorting
1 parent c31f1c0 commit fcf13a9

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/Query/Filter/Field.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -264,26 +264,6 @@ export abstract class Field {
264264
return false;
265265
}
266266

267-
/**
268-
* Return a function to get a list of a task's group names, for use in grouping by this field's value.
269-
*
270-
* See {@link supportsGrouping} for what to do, to enable support of grouping in a
271-
* particular {@link Field} implementation.
272-
*/
273-
public grouper(): GrouperFunction {
274-
throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`);
275-
}
276-
277-
/**
278-
* Create a {@link Grouper} object for grouping tasks by this field's value.
279-
*
280-
* For now, parsing of `group by` lines is currently done in {@link FilterParser.parseGrouper()}.
281-
* Later, this will probably be moved to the {@link Field} classes.
282-
*/
283-
public createGrouper(reverse: boolean): Grouper {
284-
return new Grouper(this.fieldNameSingular(), this.grouper(), reverse);
285-
}
286-
287267
/**
288268
* Parse a 'group by' line and return a {@link Grouper} object.
289269
*
@@ -365,6 +345,26 @@ export abstract class Field {
365345
return new RegExp(`^group by ${this.fieldNameSingularEscaped()}( reverse)?$`);
366346
}
367347

348+
/**
349+
* Return a function to get a list of a task's group names, for use in grouping by this field's value.
350+
*
351+
* See {@link supportsGrouping} for what to do, to enable support of grouping in a
352+
* particular {@link Field} implementation.
353+
*/
354+
public grouper(): GrouperFunction {
355+
throw Error(`grouper() unimplemented for ${this.fieldNameSingular()}`);
356+
}
357+
358+
/**
359+
* Create a {@link Grouper} object for grouping tasks by this field's value.
360+
*
361+
* For now, parsing of `group by` lines is currently done in {@link FilterParser.parseGrouper()}.
362+
* Later, this will probably be moved to the {@link Field} classes.
363+
*/
364+
public createGrouper(reverse: boolean): Grouper {
365+
return new Grouper(this.fieldNameSingular(), this.grouper(), reverse);
366+
}
367+
368368
/**
369369
* Create a {@link Grouper} object for grouping tasks by this field's value,
370370
* in the standard/normal group order for this field.

0 commit comments

Comments
 (0)