Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hashmap-native

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hashmap-native - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

package.json
{
"name": "hashmap-native",
"version": "0.0.2",
"version": "0.0.3",
"description": "Native hashmap for Node.js",

@@ -5,0 +5,0 @@ "main": "./index.js",

@@ -17,15 +17,15 @@ 'use strict';

].forEach(function (it) {
var keyType = it.keyType;
var valueType = it.valueType;
var keys = data[it.keyType];
var values = data[it.valueType];
suite('hashmap-' + keyType + '-' + valueType, function() {
suite('hashmap-' + it.keyType + '-' + it.valueType, function() {
var map;
setup(function() {
map = new HashMap[keyType][valueType]();
map = new HashMap[it.keyType][it.valueType]();
});
test('put(), get(), contains()', function () {
var key = data[keyType][0];
var value = data[valueType][0];
var key = keys[0];
var value = values[0];

@@ -40,8 +40,8 @@ // put new element

// test missing element
assert(!map.contains(data[keyType][1]));
assert(!map.contains(keys[1]));
});
test('remove()', function () {
var key = data[keyType][0];
var value = data[valueType][0];
var key = keys[0];
var value = values[0];

@@ -56,7 +56,7 @@ map.put(key, value);

test('size()', function () {
var key1 = data[keyType][0];
var value1 = data[valueType][0];
var key1 = keys[0];
var value1 = values[0];
var key2 = data[keyType][1];
var value2 = data[valueType][1];
var key2 = keys[1];
var value2 = values[1];

@@ -73,4 +73,4 @@ assert(map.size() === 0);

test('clear()', function () {
var key = data[keyType][0];
var value = data[valueType][0];
var key = keys[0];
var value = values[0];

@@ -87,4 +87,4 @@ assert(map.size() === 0);

test('empty()', function () {
var key = data[keyType][0];
var value = data[valueType][0];
var key = keys[0];
var value = values[0];

@@ -96,3 +96,26 @@ assert(map.empty());

});
test('iterator()', function () {
var tuple1 = [keys[0], values[0]];
var tuple2 = [keys[1], values[1]];
var entry;
map.put(tuple1[0], tuple1[1]);
map.put(tuple2[0], tuple2[1]);
var it = map.iterator();
assert(it.hasNext());
entry = it.next();
assert(keys.indexOf(entry[0]) !== -1);
assert(values.indexOf(entry[1]) !== -1);
assert(it.hasNext());
entry = it.next();
assert(keys.indexOf(entry[0]) !== -1);
assert(values.indexOf(entry[1]) !== -1);
assert(!it.hasNext());
});
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc