hashmap
Advanced tools
Comparing version 1.0.1 to 1.1.0
{ | ||
"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 |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
8812
133
114
0