huridocs/uwazi

View on GitHub
app/api/relationships.v2/model/QueryNode.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { NonChainQueryError } from './NonChainQueryErrror';

export abstract class QueryNode {
  protected abstract getChildrenNodes(): QueryNode[];

  validateIsChain() {
    if (this.getChildrenNodes().length > 1) {
      throw new NonChainQueryError();
    }
  }
}