
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
mixedtuplemap
Advanced tools
A memory-efficient Map which accepts multiple objects as a key. This lib is one of the several possible cache for memoize-immutable, but it can suit other use-cases as it implements a usual Map API.
npm install --save MixedTupleMap
This lib has no dependency, but requires a native implementation of WeakMap.
var MixedTupleMap = require('MixedTupleMap');
var cache = new MixedTupleMap();
var keyPart1 = {};
var keyPart2 = 'yolo';
var keyPart3 = [];
var value = {any: 'thing'};
// Note that following keyPart tuples are wrapped in new arrays that are !==
// (otherwise a WeakMap would have been enough).
cache.set([keyPart1, keyPart2, keyPart3], value);
cache.has([keyPart1, keyPart2, keyPart3]) === true;
cache.get([keyPart1, keyPart2, keyPart3]) === value;
This map is the best alternative to a WeakMap, when you need keys composed
of multiple parts that mix primitive and non-primitive types. Note shouldn't be used if ALL parts
of the key are likely to have primitive types
(number
, string
, boolean
, undefined
or even null
).
MPL-2.0
FAQs
A memory-efficient Map which accepts multiple objects as a key.
The npm package mixedtuplemap receives a total of 1,644 weekly downloads. As such, mixedtuplemap popularity was classified as popular.
We found that mixedtuplemap 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
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.