All files / output zcl_abapgit_feature.clas.mjs

95.83% Statements 46/48
80% Branches 8/10
66.66% Functions 6/9
95.83% Lines 46/48

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 46 47 481x 1x 1x 1x 1x 1x 1x 1x 1x 3x 3x 3x 3x 3x 3x 1x 3x 3x 3x 1x 7x 7x 1x 86x 86x 86x 86x 86x 86x     86x 86x 86x 86x 86x 86x 86x 86x 86x 86x 86x 86x 86x 86x 1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_feature.clas.abap
class zcl_abapgit_feature {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_FEATURE';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {};
  static METHODS = {"IS_ENABLED": {"visibility": "U", "parameters": {"RV_RUN": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "IV_FEATURE": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}};
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
    };
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async is_enabled(INPUT) {
    return zcl_abapgit_feature.is_enabled(INPUT);
  }
  static async is_enabled(INPUT) {
    let rv_run = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});
    let iv_feature = new abap.types.String({qualifiedName: "STRING"});
    if (INPUT && INPUT.iv_feature) {iv_feature.set(INPUT.iv_feature);}
    let lv_features = new abap.types.String({qualifiedName: "STRING"});
    let lt_features = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE");
    if (abap.compare.eq((await (await abap.Classes['ZCL_ABAPGIT_FACTORY'].get_environment()).get().zif_abapgit_environment$is_merged()), abap.builtin.abap_true)) {
      return rv_run;
    }
    lv_features.set((await (await (await abap.Classes['ZCL_ABAPGIT_PERSIST_FACTORY'].get_settings()).get().zif_abapgit_persist_settings$read()).get().get_experimental_features()));
    abap.statements.condense(lv_features, {nogaps: true});
    rv_run.set(abap.builtin.boolc(abap.compare.eq(lv_features, abap.builtin.abap_true)));
    if (abap.compare.initial(iv_feature) === false) {
      abap.statements.split({source: lv_features, at: abap.CharacterFactory.get(1, ','), table: lt_features});
      abap.statements.readTable(lt_features,{withTableKey: true,
        withKey: (i) => {return abap.compare.eq(i.table_line, iv_feature);},
        withKeyValue: [{key: (i) => {return i.table_line}, value: iv_feature}],
        usesTableLine: true,
        withKeySimple: {"table_line": iv_feature}});
      rv_run.set(abap.builtin.boolc(abap.compare.eq(rv_run, abap.builtin.abap_true) || abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))));
    }
    return rv_run;
  }
}
abap.Classes['ZCL_ABAPGIT_FEATURE'] = zcl_abapgit_feature;
export {zcl_abapgit_feature};