Skip to content

Commit 81ef629

Browse files
committed
Update all outdated dependencies
1 parent 5776d56 commit 81ef629

File tree

7 files changed

+6449
-3392
lines changed

7 files changed

+6449
-3392
lines changed

.babelrc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
22
"presets": [
33
[
4-
"es2015",
4+
"@babel/env",
55
{
66
"modules": false
77
}
88
]
99
],
1010
"plugins": [
11-
"external-helpers"
11+
"@babel/plugin-external-helpers"
1212
],
1313
"env": {
1414
"test": {
1515
"presets": [
16-
"es2015"
16+
"@babel/env"
1717
],
1818
"plugins": [
19-
"transform-runtime"
19+
"@babel/plugin-transform-runtime"
2020
]
2121
}
2222
}

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ sudo: false
22
language: node_js
33
node_js:
44
- "node"
5-
- "4.2"
5+
- "8.3"
66
script: 'npm run test-cov'
77
services: redis-server

index.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ const redisStore = (...args) => {
77
return {
88
name: 'redis',
99
getClient: () => redisCache,
10-
set: (key, value, options, cb) => (
11-
new Promise((resolve, reject) => {
10+
set: function(key, value, options, cb) {
11+
const self = this;
12+
13+
return new Promise((resolve, reject) => {
1214
if (typeof options === 'function') {
1315
cb = options;
1416
options = {};
@@ -19,6 +21,10 @@ const redisStore = (...args) => {
1921
cb = (err, result) => (err ? reject(err) : resolve(result));
2022
}
2123

24+
if (!self.isCacheableValue(value)) {
25+
return cb(new Error(`"${value}" is not a cacheable value`));
26+
}
27+
2228
const ttl = (options.ttl || options.ttl === 0) ? options.ttl : storeArgs.ttl;
2329
const val = JSON.stringify(value) || '"undefined"';
2430

@@ -28,9 +34,9 @@ const redisStore = (...args) => {
2834
redisCache.set(key, val, handleResponse(cb));
2935
}
3036
})
31-
),
37+
},
3238
mset: function(...args) {
33-
const _this = this;
39+
const self = this;
3440

3541
return new Promise((resolve, reject) => {
3642
let cb;
@@ -65,8 +71,8 @@ const redisStore = (...args) => {
6571
/**
6672
* Make sure the value is cacheable
6773
*/
68-
if (!_this.isCacheableValue(value)) {
69-
return cb(new Error(`value cannot be ${value}`));
74+
if (!self.isCacheableValue(value)) {
75+
return cb(new Error(`"${value}" is not a cacheable value`));
7076
}
7177

7278
value = JSON.stringify(value) || '"undefined"';

0 commit comments

Comments
 (0)