Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
sofisl committed Sep 14, 2024
1 parent dae1b3e commit f204288
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions src/enum.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ function Enum(name, values, options, comment, comments, valuesOptions) {
*/
this.valuesOptions = valuesOptions;

/**
* Values features, if any
* @type {Object<string, Object<string, *>>|undefined}
*/
this._valuesFeatures = {};

/**
Expand Down Expand Up @@ -151,16 +155,7 @@ Enum.prototype.add = function add(name, id, comment, options) {
this.valuesOptions = {};
this.valuesOptions[name] = options || null;

// console.log(options)
// if (/features/.test(options)) {
// var features = Object.keys(this.valuesOptions).find(x => {return x.hasOwnProperty("features")});
// this._valuesFeatures[name] = features ?? {};
// console.log(this._valuesFeatures[name])
// }

console.log(this.valuesOptions)
for (var key in this.valuesOptions) {
console.log(this.valuesOptions[key])
var features = Array.isArray(this.valuesOptions) ? this.valuesOptions[key].find(x => {return x.hasOwnProperty("features")}) : this.valuesOptions[key] === "features";
if (features) {
if (!this._valuesFeatures) {
Expand All @@ -171,9 +166,6 @@ Enum.prototype.add = function add(name, id, comment, options) {
}
}


// console.log(this.valuesOptions)

this.comments[name] = comment || null;
return this;
};
Expand Down

0 comments on commit f204288

Please sign in to comment.