Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
This project provides a HashMap
class that works both on NodeJS and the browser.
HashMap instances store key/value pairs allowing keys of any type.
Unlike regular objects, keys won't not be stringified. For example numbers and strings won't be mixed, you can pass Date
's, RegExp
's, DOM Elements, anything! (even null
and undefined
)
Assume this for all examples below
var map = new HashMap();
If you're using this within Node, you first need to import the class
var HashMap = require('hashmap').HashMap;
map.set("some_key", "some value");
map.get("some_key"); // --> "some value"
map.set("1", "string one");
map.set(1, "number one");
map.get("1"); // --> "string one"
A regular Object
used as a map would yield "number one"
var key = {};
var key2 = {};
map.set(key, 123);
map.set(key2, 321);
map.get(key); // --> 123
A regular Object
used as a map would yield 321
map.set(1, "test 1");
map.set(2, "test 2");
map.set(3, "test 3");
map.forEach(function(value, key) {
console.log(key + " : " + value);
});
Check the tests for some more real code.
This project is in early development, so any feedback/changes are specially appreciated.
Object.defineProperty
doesn't exist maybe use a different hashing approach for this case like Array.indexOf
1.0.0
FAQs
HashMap Class for JavaScript
The npm package hashmap receives a total of 10,421 weekly downloads. As such, hashmap popularity was classified as popular.
We found that hashmap 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.