ioredis-mock
Advanced tools
Comparing version 5.7.0 to 5.8.0
@@ -12,6 +12,12 @@ "use strict"; | ||
var _sha = _interopRequireDefault(require("../commands-utils/sha1")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function evaluate(script, numberOfKeys, ...args) { | ||
// store sha1 and the script itself for `evalsha` function | ||
const scriptSha = (0, _sha.default)(script); | ||
this.shaScripts[scriptSha] = script; // evaluate | ||
return (0, _command.default)((0, _defineCommand.customCommand)(numberOfKeys, script).bind(this), '', this)(...args); | ||
} |
@@ -202,2 +202,15 @@ "use strict"; | ||
var _evalsha = require("./evalsha"); | ||
Object.keys(_evalsha).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _evalsha[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function () { | ||
return _evalsha[key]; | ||
} | ||
}); | ||
}); | ||
var _exists = require("./exists"); | ||
@@ -204,0 +217,0 @@ |
@@ -58,4 +58,6 @@ "use strict"; | ||
this.subscriberMode = false; | ||
this.customCommands = {}; // eslint-disable-next-line prefer-object-spread | ||
this.customCommands = {}; // a mapping of sha1<string>:script<string>, used by evalsha command | ||
this.shaScripts = {}; // eslint-disable-next-line prefer-object-spread | ||
const optionsWithDefault = Object.assign({}, defaultOptions, options); | ||
@@ -62,0 +64,0 @@ this.expires = (0, _expires.default)(optionsWithDefault.keyPrefix); |
@@ -128,3 +128,3 @@ { | ||
"runkitExampleFilename": "example.js", | ||
"version": "5.7.0" | ||
"version": "5.8.0" | ||
} |
Sorry, the diff of this file is too big to display
509162
164
16344