strong-map
Version:
[](https://img.shields.io/npm/l/strong-map.svg) [](https://travis-ci.org/jorma16/strong-map) [ • 431 B
JavaScript
const fns = require('./utils/fn');
class StrongMap extends Map {
get(...args) {
const [k] = args;
if (k instanceof Object) {
const key = [...this.keys()].find((k2) => fns.equals(k, k2));
return super.get(key);
}
return super.get(...args);
}
getTruthyKeys() {
return [...this.entries()]
.filter(([, allowed]) => allowed)
.map(([key]) => key);
}
}
module.exports = StrongMap;