Have a look at the typescript declaration for Node's util.promisify (sorry on mobile can't find it right now). It's something like 10 lines long and covers only a handful of cases.
It's not something you'd want to find in the middle of your code, yet you may have to if you want to do generic/functional programming in TS.
It's not something you'd want to find in the middle of your code, yet you may have to if you want to do generic/functional programming in TS.