Skip to content
This repository has been archived by the owner on Sep 19, 2023. It is now read-only.

Commit

Permalink
Min/Max: removes dead code
Browse files Browse the repository at this point in the history
BaseAggregator.extractValue raises if the term is not a literal
  • Loading branch information
Tpt authored and rubensworks committed May 23, 2022
1 parent d04f8a0 commit 969819a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions lib/aggregators/Max.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ interface IExtremeState {
export class Max extends BaseAggregator<IExtremeState> {
public init(start: RDF.Term): IExtremeState {
const { value } = this.extractValue(start);
if (start.termType === 'Literal') {
return { extremeValue: value, term: start };
}
throw new Error('Term should be a literal');
return { extremeValue: value, term: <RDF.Literal>start };
}

public put(state: IExtremeState, term: RDF.Term): IExtremeState {
Expand Down
5 changes: 1 addition & 4 deletions lib/aggregators/Min.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@ interface IExtremeState {
export class Min extends BaseAggregator<IExtremeState> {
public init(start: RDF.Term): IExtremeState {
const { value } = this.extractValue(start);
if (start.termType === 'Literal') {
return { extremeValue: value, term: start };
}
throw new Error('Term should be a literal');
return { extremeValue: value, term: <RDF.Literal>start };
}

public put(state: IExtremeState, term: RDF.Term): IExtremeState {
Expand Down

0 comments on commit 969819a

Please sign in to comment.