Callidon / bloom-filters

JS implementation of probabilistic data structures: Bloom Filter (and its derived), HyperLogLog, Count-Min Sketch, Top-K and MinHash
https://callidon.github.io/bloom-filters/
MIT License
369 stars 42 forks source link

Better types definitions to avoid casting as unknown #22

Closed folkvir closed 3 years ago

folkvir commented 3 years ago

In the title, related to #20

Allows to do: const b: BloomFilter = BloomFilter.fromJSON(bloomJSON) as BloomFilter Instead of doing this ...: const b: BloomFilter = BloomFilter.fromJSON(bloomJSON) as unknown as BloomFilter

Edit: see https://github.com/Callidon/bloom-filters/issues/20#issuecomment-799799655