openbci-archive / OpenBCI_NodeJS

Node.js SDK for the all OpenBCI Biosensor Boards
https://www.npmjs.com/package/openbci
137 stars 52 forks source link

Automate the interpretation of options and defaults #105

Closed baffo32 closed 7 years ago

baffo32 commented 7 years ago

Just a small change intended to ease maintenance.

_options is repurposed to define not only the default options, but also the possible option choices. For options with multiple choices, they are listed in an array. The first item of the array will be used for the default.

The code now enforces the choices and provides the default for all options automatically.

codecov-io commented 7 years ago

Current coverage is 93.65% (diff: 100%)

Merging #105 into 1.4.0 will increase coverage by <.01%

@@              1.4.0       #105   diff @@
==========================================
  Files             4          4          
  Lines          2237       2207    -30   
  Methods         128        128          
  Messages          0          0          
  Branches        494        466    -28   
==========================================
- Hits           2095       2067    -28   
+ Misses          142        140     -2   
  Partials          0          0          

Powered by Codecov. Last update 6b11910...4b5e4ab

andrewjaykeller commented 7 years ago

THIS IS AWESOME!!!!

andrewjaykeller commented 7 years ago

Looks great to me, I'm good to merge this

baffo32 commented 7 years ago

I think it's ready to merge