all files / lib/templates/ BaseTemplate.js

100% Statements 0/0
100% Branches 0/0
100% Functions 0/0
100% Lines 0/0
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16                               
class BaseTemplate {
  constructor(elements) {
    if (!Array.isArray(elements)) {
      throw new Error('elements must be an array.');
    }
 
    if (elements.length > 10) {
      throw new Error('You cannot have more than 10 elements in the template.');
    }
 
    this.elements = elements;
  }
}
 
export default BaseTemplate;