All files / src/asn1 ASN1Module.ts

90% Statements 9/10
50% Branches 1/2
100% Functions 4/4
88.88% Lines 8/9

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21    1x 6x 6x 6x       124x       440x 23x     23x      
import {ASN1Assignment} from './ASN1Assignment';
 
export class ASN1Module {
  assignments: ASN1Assignment[] = [];
  constructor(public name: string) {
    this.assignments = [];
  }
 
  addAssignment(type: ASN1Assignment) {
    this.assignments.push(type);
  }
 
  getAssignment(name: string) {
    const assignment = this.assignments.find(a => a.name === name);
    Iif (!assignment) {
      throw new Error(`Assignment (type) not found: ${name}`);
    }
    return assignment;
  }
}