New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

cashbox

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cashbox - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

test/cashbox.tagging.test.js

21

lib/cashbox.js

@@ -179,20 +179,7 @@ var extend = require('deap/shallow'),

if(!tags) return undefined;
if(tags instanceof Array) return tags;
if(typeof tags == 'string') return [tags];
tags = (tags instanceof Array) ? tags : [tags];
var rTags = [];
for(var key in tags) {
rTags.push([key, tags[key]].join(':'));
}
return Array.prototype.concat.apply(
[],
Object.keys(tags).map(function(name) {
var values = (tags[name] instanceof Array) ? tags[name] : [tags[name]];
return values.map(function(value) {
return [name, value].join(':');
});
})
);
return tags
.map(function(tag) { return typeof tag === 'string' ? tag : undefined; })
.filter(function(tag) { return tag !== undefined; });
}

@@ -199,0 +186,0 @@

@@ -104,3 +104,3 @@

return value && value.data;
return value && value.data && JSON.parse(value.data);
}

@@ -121,3 +121,3 @@

expire: expire,
data: value
data: JSON.stringify(value)
};

@@ -124,0 +124,0 @@ }

{
"name": "cashbox",
"version": "0.2.0",
"version": "0.2.1",
"description": "javascript cache library with configurable storage",

@@ -38,2 +38,3 @@ "main": "index.js",

"devDependencies": {
"async": "~0.2.9",
"mocha": "~1.9.0",

@@ -40,0 +41,0 @@ "chai": "~1.6.0"

@@ -123,3 +123,3 @@ var assert = require('chai').assert,

load: function(key, cb) {
cb(null, value, { test : 1 });
cb(null, value, 'test=1');
},

@@ -131,3 +131,3 @@ done: function(err, v) {

setTimeout(function() {
cache.getKeys({ test : 1 }, function(err, keys) {
cache.getKeys('test=1', function(err, keys) {
assert.equal(keys[0], key);

@@ -308,3 +308,3 @@ done();

it('should accept an object with tagging capabilities (as an object)', function(done) {
it('should accept an object with tagging capabilities (as an array)', function(done) {
var cache = new Cache();

@@ -319,3 +319,3 @@

[value1, value2],
[{ test : 1 }, { test : 2 }]
['test=1', 'test=2']
);

@@ -330,3 +330,3 @@ },

setTimeout(function() {
cache.getKeys({ test : 2 }, function(err, keys) {
cache.getKeys('test=2', function(err, keys) {
assert.equal(keys[0], key2);

@@ -333,0 +333,0 @@ done();

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