lib: add JSDoc typings for util
Ref: https://github.com/nodejs/node/pull/38182 Ref: https://twitter.com/bradleymeck/status/1380643627211354115
Added JSDoc typings to lib/util
. Most of the typings are pretty simple and direct, all the isThing
methods have been typed using type predicates.
callbackify
is a bit complex, for this I used the new Leading Rest elements in tuple types to infer types.
Before:
After:
There are still some errors with checkJs
enabled that I'm not sure how to fix since we are mutating the original type: