errors: add ERR_INVALID_OPT_TYPE and support options in validators.js
Description in the commit messages.
Also, I considered adding helper functions like validateBufferOpt
to avoid having to write an object with type: 'option'
every time, WDYT?
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added (do we have a doc for validators.js?) -
commit message follows commit guidelines
/cc @BridgeAR