Yomguithereal / mnemonist

Curated collection of data structures for the JavaScript/TypeScript language.
https://yomguithereal.github.io/mnemonist
MIT License
2.24k stars 92 forks source link

Fix BiMap and InverseMap `get` type to allow `undefined` return #205

Closed rubenferreira97 closed 1 year ago

rubenferreira97 commented 1 year ago

BiMap and InverseMap were wrongly typed.

Example:

import { BiMap } from 'mnemonist';

const a = new BiMap<string, string>();
a.set('a', 'b');
console.log(a.get('b')); // undefined
console.log(a.inverse.get('a')); // undefined
Yomguithereal commented 1 year ago

Thanks @rubenferreira97 merging right now.

Yomguithereal commented 1 year ago

Now published in v0.39.4