I'm writing the equivalent of Node's inspect function. I need it to properly inspect promises. E.g.: > inspect(Promise.resolve(5)) "Promise { 5 }" and > inspect(new Promise(resolve => undefined)) "Promise { <pending> }". How do I do it? I absolutely cannot call `.then`.
I assume you'll need to do something like this (but with a different implementation): https://twitter.com/arcanis/status/1235571321263845376?s=21 …https://twitter.com/arcanis/status/1235571321263845376 …