Closed staltz closed 3 years ago
@arj03 Updated PR
There is still the fullMentions!, is that because of typescript?
fullMentions!
with !
at the end means "ignore TypeScript errors". Basically, TypeScript by default will think that fullMentions
is undefined, and we're "casting it" to defined here, telling the compiler that "trust me, at this point, I know it's defined".
Similar to that, there is ?.
which I really like. It should be landing in a future version of JS: https://github.com/tc39/proposal-optional-chaining
Example: setTimeout(later, 1000)?.unref()
would work in browsers
Update: correction: setTimeout(later, 1000).unref?.()
The diff is quite easy to read now. Looks good, funny the require was missing in the README before :)
Thanks for the review
@arj03 This module also has no tests, so I'd need a careful review. :pray: