Skip to content

Commit fd62837

Browse files
authored
Merge branch 'master' into master
2 parents e87a4a6 + a0b2bfb commit fd62837

2 files changed

Lines changed: 9 additions & 9 deletions

File tree

_src/lib/node_cache.coffee

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ module.exports = class NodeCache extends EventEmitter
77
super()
88

99
@_initErrors()
10+
1011
# container for cached data
1112
@data = {}
1213

@@ -36,7 +37,7 @@ module.exports = class NodeCache extends EventEmitter
3637

3738
# generate functions with callbacks (legacy)
3839
if (@options.enableLegacyCallbacks)
39-
console.warn("WARNING! Callback legacy support will drop in node-cache v6.x")
40+
console.warn("WARNING! node-cache legacy callback support will drop in v6.x")
4041
[
4142
"get",
4243
"mget",
@@ -49,16 +50,16 @@ module.exports = class NodeCache extends EventEmitter
4950
].forEach((methodKey) =>
5051
# reference real function
5152
oldMethod = @[methodKey]
52-
@[methodKey] = (...args, cb) =>
53+
@[methodKey] = (args..., cb) ->
5354
# return a callback if cb is defined and a function
5455
if (typeof cb is "function")
5556
try
56-
res = oldMethod(...args)
57+
res = oldMethod(args...)
5758
cb(null, res)
5859
catch err
5960
cb(err)
6061
else
61-
return oldMethod(...args, cb)
62+
return oldMethod(args..., cb)
6263
return
6364
return
6465
)
@@ -601,8 +602,7 @@ module.exports = class NodeCache extends EventEmitter
601602

602603
return
603604

604-
createErrorMessage: (errMsg) => (args) =>
605-
return errMsg.replace("__key", args.type);
605+
createErrorMessage: (errMsg) -> (args) -> errMsg.replace("__key", args.type)
606606

607607
_ERRORS:
608608
"ENOTFOUND": "Key `__key` not found"

_src/test/mocha_test.coffee

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ describe "`#{pkg.name}@#{pkg.version}` on `node@#{process.version}`", () ->
775775
return
776776

777777
it "try to mget with a single key", () ->
778-
(() => localCache.mget(state.getKeys[0])).should.throw({
778+
(() -> localCache.mget(state.getKeys[0])).should.throw({
779779
name: "EKEYSTYPE",
780780
message: "The keys argument has to be an array."
781781
})
@@ -784,7 +784,7 @@ describe "`#{pkg.name}@#{pkg.version}` on `node@#{process.version}`", () ->
784784

785785
it "mget the sub-list", () ->
786786
state.prediction.should.eql localCache.mget state.getKeys
787-
state.n++;
787+
state.n++
788788
return
789789

790790
it "delete keys in the sub-list", () ->
@@ -818,7 +818,7 @@ describe "`#{pkg.name}@#{pkg.version}` on `node@#{process.version}`", () ->
818818
state.keys = [state.key1, state.key2, state.key3, state.key4, state.key5]
819819
return
820820

821-
describe "has validates expired ttl", () ->
821+
describe "has validates expired ttl", () ->
822822
it "set a key with ttl", () ->
823823
true.should.eql localCacheTTL.set state.key6, state.val, 0.7
824824
return

0 commit comments

Comments
 (0)