Personally I hate it to check if something is in a map, and if not add an object. So, I always write this small snippet,
I decided to make a repo out of it.
A simple example;
``typescript
import {WeakMapExt} from "map-ext";
type EventHandler = (...[]) => any;
const eventStore = new WeakMapExt``
esm - commonjs
Since this package is so small it supports both esm and commonjs