mauriciosantos / Buckets-JS

A complete, fully tested and documented data structure library written in pure JavaScript.
MIT License
1.25k stars 112 forks source link

fix missing check for undefined in multidictionary and add test #17

Closed tgrohens closed 6 years ago

tgrohens commented 6 years ago

Hi Mauricio,

I found a bug in the remove function in multidictionary.js. The description states that if a key is missing, remove should return false. It actually doesn't make that check, and so calls buckets.remove on an undefined array, which raises an error.

I added a test that triggers this behavior, as well as a possible fix, in the pull request.

Cheers, Théotime

mauriciosantos commented 6 years ago

Thanks!