validateTags()

in src/monitor.ts [109:130]


  validateTags(customTags?: TagOption[]) {
    if (!customTags) {
      return false;
    }
    if (!Array.isArray(customTags)) {
      this.customOptions.customTags = undefined;
      console.error('customTags error');
      return false;
    }
    let isTags = true;
    for (const ele of customTags) {
      if (!(ele && ele.key && ele.value)) {
        isTags = false;
      }
    }
    if (!isTags) {
      this.customOptions.customTags = undefined;
      console.error('customTags error');
      return false;
    }
    return true;
  },