All files / src/objects program.ts

87.5% Statements 14/16
83.33% Branches 5/6
85.71% Functions 6/7
87.5% Lines 14/16

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 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 461x     1x 4532x     7224x       1778x 1778x     1778x                 85x             5036x 5036x       1376x 930x 930x     1376x        
import {ABAPObject} from "./_abap_object";
import {ABAPFile} from "../abap/abap_file";
 
export class Program extends ABAPObject {
  private isIncludeValue: boolean | undefined = undefined;
 
  public getType(): string {
    return "PROG";
  }
 
  public getSequencedFiles(): readonly ABAPFile[] {
    const main = this.getMainABAPFile();
    Iif (main === undefined) {
      return [];
    }
    return [main];
  }
 
  public getDescription(): string | undefined {
    // todo
    return undefined;
  }
 
  public getAllowedNaming() {
    return {
      maxLength: 40,
      allowNamespace: true,
    };
  }
 
  public setDirty(): void {
    this.isIncludeValue = undefined;
    super.setDirty();
  }
 
  public isInclude(): boolean {
    if (this.isIncludeValue === undefined) {
      const file = this.getXMLFile();
      this.isIncludeValue = file ? file.getRaw().includes("<SUBC>I</SUBC>") : false;
    }
 
    return this.isIncludeValue;
  }
 
}