Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit flag value #80

Open
Exelord opened this issue Mar 18, 2019 · 0 comments
Open

Explicit flag value #80

Exelord opened this issue Mar 18, 2019 · 0 comments

Comments

@Exelord
Copy link

Exelord commented Mar 18, 2019

We should check explicitly for a true value as a condition to turn ON the flags.
In case if someone will use strings based value "false", "true" eg using dotEnv settings (which does not support boolean values) the addon will gonna interpret "false" as true which is not expected.

_featureIsEnabled(feature) {
let normalizeFeature = this._normalizeFlag(feature);
return this._flags[normalizeFeature] || false;
},

As the best solution, we should parse the flag value (in case of string) and look for

  • true
  • false
  • 0
  • 1

Or as a minimum, we should check explicitly if the value === true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant