apostrophe-caches-redis
Advanced tools
Comparing version 2.1.2 to 2.1.3
# Changelog | ||
* 2.1.2 fixes a bug where `ensureIndexes()` in `apostrophe-caches` was attempting to create new indexes where mongo was not being used. | ||
## 2.1.3 (2020-09-09) | ||
- Updates `mocha` and `apostrophe` for security vulnerabilities. | ||
- Adds ESLint to the test script. | ||
* 2.1.1: `apos.destroy` now closes the Redis connection, for compatibility with | ||
## 2.1.2 | ||
- fixes a bug where `ensureIndexes()` in `apostrophe-caches` was attempting to create new indexes where mongo was not being used. | ||
## 2.1.1: | ||
- `apos.destroy` now closes the Redis connection, for compatibility with | ||
`apostrophe-monitor` and `apostrophe-multisite`. Corrections were made to the | ||
@@ -11,2 +17,3 @@ unit tests for promises (the actual implementation code for promises was fine). | ||
* 2.1.0: promise support. The `get`, `set` and `clear` methods of caches now return promises if no callback is given, matching the behavior of Apostrophe's core cache. | ||
## 2.1.0: | ||
- promise support. The `get`, `set` and `clear` methods of caches now return promises if no callback is given, matching the behavior of Apostrophe's core cache. |
@@ -5,3 +5,3 @@ // TODO: | ||
var redis = require("redis"); | ||
var redis = require('redis'); | ||
var Promise = require('bluebird'); | ||
@@ -36,3 +36,3 @@ | ||
return callback(null); | ||
} | ||
}; | ||
@@ -89,3 +89,3 @@ self.constructCache = function(name) { | ||
} else if (arguments.length === 3) { | ||
if (typeof(lifetime) === 'function') { | ||
if (typeof (lifetime) === 'function') { | ||
callback = lifetime; | ||
@@ -92,0 +92,0 @@ lifetime = 0; |
{ | ||
"name": "apostrophe-caches-redis", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"description": "Redis-based cache for the Apostrophe CMS", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha test/test.js" | ||
"test": "mocha test/test.js && eslint ." | ||
}, | ||
@@ -18,3 +18,3 @@ "repository": { | ||
], | ||
"author": "P'unk Avenue LLC", | ||
"author": "Apostrophe Technologies", | ||
"license": "MIT", | ||
@@ -30,5 +30,7 @@ "bugs": { | ||
"devDependencies": { | ||
"apostrophe": "^2.75.1", | ||
"mocha": "^5.0.0" | ||
"apostrophe": "^2.97.1", | ||
"eslint": "^7.8.1", | ||
"eslint-config-apostrophe": "^3.4.0", | ||
"mocha": "^8.1.3" | ||
} | ||
} |
{ | ||
"Server error, please try again.": "Server error, please try again." | ||
"Server error, please try again.": "Server error, please try again.", | ||
"An error has occurred": "An error has occurred", | ||
"An error has occurred. We're working on it. We apologize for the inconvenience.": "An error has occurred. We're working on it. We apologize for the inconvenience." | ||
} |
@@ -152,17 +152,17 @@ var assert = require('assert'); | ||
return cache1.get(1000) | ||
.then(function(val) { | ||
assert(val === 1000); | ||
}); | ||
.then(function(val) { | ||
assert(val === 1000); | ||
}); | ||
}); | ||
it('can retrieve key from cache 2 with promises', function() { | ||
return cache2.get(3000) | ||
.then(function(val) { | ||
assert(val === 3000); | ||
}); | ||
.then(function(val) { | ||
assert(val === 3000); | ||
}); | ||
}); | ||
it('cannot retrieve cache 2 key from key 1 (namespacing) with promises', function() { | ||
return cache1.get(3000) | ||
.then(function(val) { | ||
assert(!val); | ||
}); | ||
.then(function(val) { | ||
assert(!val); | ||
}); | ||
}); | ||
@@ -174,11 +174,11 @@ it('can clear a cache with promises', function() { | ||
return cache1.get(1000) | ||
.then(function(val) { | ||
assert(!val); | ||
}); | ||
.then(function(val) { | ||
assert(!val); | ||
}); | ||
}); | ||
it('can fetch a key from an uncleared cache with promises', function() { | ||
return cache2.get(3000) | ||
.then(function(val) { | ||
assert(val === 3000); | ||
}); | ||
.then(function(val) { | ||
assert(val === 3000); | ||
}); | ||
}); | ||
@@ -196,10 +196,9 @@ it('can store a key with a 1-second timeout with promises', function() { | ||
return Promise.delay(2000) | ||
.then(function() { | ||
return cache1.get('timeout') | ||
}) | ||
.then(function(val) { | ||
assert(!val); | ||
}); | ||
.then(function() { | ||
return cache1.get('timeout'); | ||
}) | ||
.then(function(val) { | ||
assert(!val); | ||
}); | ||
}); | ||
}); | ||
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
14156
7
340
4