-
-
Notifications
You must be signed in to change notification settings - Fork 222
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
Flatten options #508
Flatten options #508
Conversation
boopathi
commented
Apr 19, 2017
•
edited
Loading
edited
- Removes Option Manager
- Flattens options - having a tree of options is complex for the user as well as handling it
- Now every plugin gets its own option name and it can be toggled or passed its own options
Codecov Report
@@ Coverage Diff @@
## master #508 +/- ##
==========================================
+ Coverage 82.64% 83.06% +0.41%
==========================================
Files 35 34 -1
Lines 2633 2521 -112
Branches 924 896 -28
==========================================
- Hits 2176 2094 -82
+ Misses 279 255 -24
+ Partials 178 172 -6
Continue to review full report at Codecov.
|
proxy("keepFnName", [optionsMap.mangle, optionsMap.deadcode]), | ||
// validate options | ||
const validOptions = [...PLUGINS.map(p => p[0]), ...Object.keys(PROXIES)]; | ||
for (let name in opts) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of
instead of in
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The accessor is opts[name]
and opts
is user passed. So better to validate all that we access instead of just accessing the own properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright.
Looks much cleaner and easier to validate/handle. |