
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
A bidirectional map based on the ES6 Map object containing additional methods to retrive keys by values, delete key-value pairs by values and check the existence of keys by values. The module contains two classes: BiMap
& WeakBiMap
based on Map
& WeakMap
respectively.
npm install --save bim
Same as normal Map
& WeakMap
, plus the getKey
, hasValue
& deleteValue
methods.
import { WeakBiMap } from 'bim'
// create objects to use as keys
const a = {
i: 'foo',
j: 8,
}
const b = {
k: 'bar',
p: 11,
}
// create the bidirectional weak map
const wbm = new WeakBiMap()
wbm.set(a, 5)
wbm.set(b, 6)
wbm.deleteValue(5) // now only has { k: 'bar', p: 11 } => 6
wbm.hasValue(5) // false
const c = {
h: 'quux',
z: 100,
}
wbm.set(c, 7)
wbm.hasValue(7) // true
wbm.getKey(7) // { h: 'quux', z: 100 }
FAQs
A bidirectional map based on the ES6 Map & WeakMap objects
The npm package @risai/bim receives a total of 2 weekly downloads. As such, @risai/bim popularity was classified as not popular.
We found that @risai/bim demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.