All files / src/models Clause.js

0% Statements 0/11
0% Branches 0/8
0% Functions 0/1
0% Lines 0/11
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26                                                   
function Clause( { type, exprs, opts, fragments, conformFn, generateFn } ) {
 
  this.type = type;
 
  if ( opts ) {
    this.opts = opts;
  }
 
  if ( conformFn ) {
    this.conform = conformFn;
  }
 
  if ( generateFn ) {
    this.generate = generateFn;
  }
 
  if ( !exprs ) {
    throw new Error( 'Expressions are required when constructing a clause.' );
  }
 
  this.exprs = exprs;
}
 
 
module.exports = Clause;