Socket
Socket
Sign inDemoInstall

hashmap

Package Overview
Dependencies
0
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.1.0

2

bower.json
{
"name": "hashmap",
"version": "1.0.1",
"version": "1.1.0",
"description": "HashMap Class for JavaScript",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/flesler/hashmap",

/**
* HashMap - HashMap Class for JavaScript
* @author Ariel Flesler <aflesler@gmail.com>
* @version 1.0.1
* @version 1.1.0
* Homepage: https://github.com/flesler/hashmap
*/
;(function(exports){
(function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define([], factory);
} else if (typeof exports === 'object') {
// Node js environment
exports.HashMap = factory();
} else {
// Browser globals (this is window)
this.HashMap = factory();
}
}(function () {

@@ -117,4 +128,4 @@ function HashMap() {

exports.HashMap = HashMap;
return HashMap;
})(this.exports || this);
}));
{
"name": "hashmap",
"author": "Ariel Flesler <aflesler@gmail.com>",
"version": "1.0.1",
"version": "1.1.0",
"description": "HashMap Class for JavaScript",

@@ -6,0 +6,0 @@ "keywords": ["hashmap", "map", "object", "array", "associative", "javascript", "nodejs", "node", "browser"],

@@ -28,2 +28,16 @@ # HashMap Class for JavaScript

## HashMap methods
- `get(key:*) : *` returns the value stored for that key.
- `set(key:*, value:*) : void` stores a key-value pair
- `has(key:*) : Boolean` returns whether a key is set on the hashmap
- `remove(key:*) : void` deletes a key-value pair by key
- `type(key:*) : String` returns the data type of the provided key (used internally)
- `keys() : Array<*>` returns an array with all the registered keys
- `values() : Array<*>` returns an array with all the values
- `count() : Number` returns the amount of key-value pairs
- `clear() : void` removes all the key-value pairs on the hashmap
- `hash(key:*) : String` returns the stringified version of a key (used internally)
- `forEach(function(value, key))` iterates the pairs and calls the function for each one
## Examples

@@ -72,3 +86,2 @@

[Check the tests](test/test.js) for some more real code.

@@ -75,0 +88,0 @@ ## LICENSE

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc