record-cache
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -12,3 +12,3 @@ var EMPTY = [] | ||
var k = toString(record) | ||
var r = this.map.get(record) | ||
var r = this.map.get(k) | ||
if (r) return false | ||
@@ -24,3 +24,3 @@ | ||
var k = toString(record) | ||
var r = this.map.get(record) | ||
var r = this.map.get(k) | ||
if (!r) return false | ||
@@ -27,0 +27,0 @@ |
{ | ||
"name": "record-cache", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Cache optimised for record like things", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
20
test.js
@@ -166,1 +166,21 @@ var tape = require('tape') | ||
}) | ||
tape('add dedups buffers', function (t) { | ||
var rc = recordCache() | ||
rc.add('hello', Buffer.from('world')) | ||
rc.add('hello', Buffer.from('world')) | ||
t.same(rc.get('hello'), [Buffer.from('world')]) | ||
t.end() | ||
}) | ||
tape('add and remove buffer', function (t) { | ||
var rc = recordCache() | ||
rc.add('hello', Buffer.from('world')) | ||
rc.remove('hello', Buffer.from('world')) | ||
t.same(rc.get('hello'), []) | ||
t.end() | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11285
289