numeric-id-map
Data structure that maps entries to numeric ids
npm install numeric-id-map
Usage
var map =var ids =// map an entry to a numeric idvar id = ids// remove an id and get the data back// the id will be reused for another entryvar entry = map
API
var ids = map()
Create a new instance
id = ids.add(entry)
Map an entry to a numberic id.
entry = ids.remove(id)
Remove an id and return the previously mapped entry. After removing the id might be reused in the future.
entry = ids.get(id)
Lookup a mapped entry by it's id without removing it
License
MIT