parseOptions(options) {
      const output = [];
      const optionList = Object.keys(this.graphOptionsObject);

      if (typeof options === "string" && options.toUpperCase().trim() === "ALL") {
        return Object.values(this.graphOptionsObject);
      }
      if (typeof options === "object") {
        options.forEach((item) => {
          const arr = item.trim().split("|").map(a => a.trim());
          const key = arr[0].toUpperCase();

          if (arr.length === 1) {
            if (optionList.includes(key)) {
              output.push(this.graphOptionsObject[key]);
            }
          } else if (arr.length > 1) {
            if (optionList.includes(key)) {
              const val = Object.assign({}, this.graphOptionsObject[key]);
              val.label = arr[1];
              output.push(val);
            }
          }
        });

        return output;
      }

      return Object.values(this.graphOptionsObject);
    }
/**
     * Parse the array of supplied dropdown options and return a dropdown option object.
     * @param {Array<String> | String} options Array of options to parse.
     * @returns {Array<Object>}
     */
Parse the array of supplied dropdown options and return a dropdown option object.
@param {Array | String} options Array of options to parse.
@returns {Array}
Parse the array of supplied dropdown options and return a dropdown option object . @param { Array | String } options Array of options to parse . @returns { Array }
parseOptions(options) {
      const output = [];
      const optionList = Object.keys(this.graphOptionsObject);
      if (typeof options === "string" && options.toUpperCase().trim() === "ALL") {
        return Object.values(this.graphOptionsObject);
      }
      if (typeof options === "object") {
        options.forEach((item) => {
          const arr = item.trim().split("|").map(a => a.trim());
          const key = arr[0].toUpperCase();
          if (arr.length === 1) {
            if (optionList.includes(key)) {
              output.push(this.graphOptionsObject[key]);
            }
          } else if (arr.length > 1) {
            if (optionList.includes(key)) {
              const val = Object.assign({}, this.graphOptionsObject[key]);
              val.label = arr[1];
              output.push(val);
            }
          }
        });
        return output;
      }
      return Object.values(this.graphOptionsObject);
    }
parseOptions ( options ) { const output = [ ] ; const optionList = Object . keys ( this . graphOptionsObject ) ; if ( typeof options === "string" && options . toUpperCase ( ) . trim ( ) === "ALL" ) { return Object . values ( this . graphOptionsObject ) ; } if ( typeof options === "object" ) { options . forEach ( ( item ) => { const arr = item . trim ( ) . split ( "|" ) . map ( a => a . trim ( ) ) ; const key = arr [ 0 ] . toUpperCase ( ) ; if ( arr . length === 1 ) { if ( optionList . includes ( key ) ) { output . push ( this . graphOptionsObject [ key ] ) ; } } else if ( arr . length > 1 ) { if ( optionList . includes ( key ) ) { const val = Object . assign ( { } , this . graphOptionsObject [ key ] ) ; val . label = arr [ 1 ] ; output . push ( val ) ; } } } ) ; return output ; } return Object . values ( this . graphOptionsObject ) ; }
Parse the array of supplied dropdown options and return a dropdown option object.
Parse the array of supplied dropdown options and return a dropdown option object .