ssbc / ssb-blobs-purge

SSB plugin to automatically remove old and large blobs
MIT License
6 stars 0 forks source link

support ssb-db2 #2

Closed staltz closed 3 years ago

staltz commented 3 years ago

@arj03 This module also has no tests, so I'd need a careful review. :pray:

staltz commented 3 years ago

@arj03 Updated PR

arj03 commented 3 years ago

There is still the fullMentions!, is that because of typescript?

staltz commented 3 years ago

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".

staltz commented 3 years ago

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

staltz commented 3 years ago

Example: setTimeout(later, 1000)?.unref() would work in browsers

Update: correction: setTimeout(later, 1000).unref?.()

arj03 commented 3 years ago

The diff is quite easy to read now. Looks good, funny the require was missing in the README before :)

staltz commented 3 years ago

Thanks for the review