util: introduce `util.types.is[…]` type checks
Provide public APIs for native typechecking that is actually useful. The motivation for this is providing alternatives to userland modules that would currently rely on process.binding('util')
.
This is based off the list in v8.h
, with things that have better JS equivalents removed; I’m happy to bikeshed this list.
Also, for context, previous efforts:
- @jasnell’s https://github.com/jasnell/proposal-istypes
- @evanlucas’s https://github.com/nodejs/node-eps/pull/44
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines
Affected core subsystem(s)
util