redis-eval-mock
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -7,2 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.decode = exports.encode = void 0; | ||
// https://www.kyne.com.au/~mark/software/lua-cjson-manual.html | ||
@@ -9,0 +10,0 @@ function encode(value) { |
@@ -7,2 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.unpack_limit = exports.unpack_one = exports.unpack = exports.pack = void 0; | ||
const lua_1 = require("../utility/lua"); | ||
@@ -30,3 +31,3 @@ // The Lua-to-JS string translation appears to truncate at nulls, | ||
const results = mp_unpack_full(this, msgpack, 0, 0); | ||
lua_1.returns(...results.slice(1)); | ||
(0, lua_1.returns)(...results.slice(1)); | ||
} | ||
@@ -36,3 +37,3 @@ exports.unpack = unpack; | ||
const results = mp_unpack_full(this, msgpack, 1, offset); | ||
lua_1.returns(...results.slice(0, 2)); | ||
(0, lua_1.returns)(...results.slice(0, 2)); | ||
} | ||
@@ -42,5 +43,5 @@ exports.unpack_one = unpack_one; | ||
const results = mp_unpack_full(this, msgpack, limit, offset); | ||
lua_1.returns(...results); | ||
(0, lua_1.returns)(...results); | ||
} | ||
exports.unpack_limit = unpack_limit; | ||
//# sourceMappingURL=cmsgpack.js.map |
@@ -7,2 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.status_reply = exports.error_reply = exports.pcall = exports.call = exports.replicate_commands = void 0; | ||
const deasync = require("deasync"); | ||
@@ -20,3 +21,4 @@ const lua_1 = require("../utility/lua"); | ||
// network calls) to execute syncronously | ||
const result = deasync(this[cmd.toLowerCase()].bind(this))(...args); | ||
const command = deasync(this[cmd.toLowerCase()].bind(this)); | ||
const result = command(...args); | ||
return result != null ? result : lua_1.nil; | ||
@@ -23,0 +25,0 @@ } |
@@ -7,2 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.nil = exports.returns = exports.VM = void 0; | ||
const fs = require("fs"); | ||
@@ -9,0 +10,0 @@ const lua_vm_js_1 = require("lua.vm.js"); |
@@ -7,2 +7,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.response = exports.callback = exports.argument = void 0; | ||
// Extract the actual arguments from the supplied arguments | ||
@@ -9,0 +10,0 @@ // https://www.npmjs.com/package/redis#sending-commands |
{ | ||
"name": "redis-eval-mock", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "A mock version of Redis EVAL to test Lua scripts", | ||
@@ -27,5 +27,5 @@ "keywords": [ | ||
"dependencies": { | ||
"deasync": "^0.1.15", | ||
"deasync": "^0.1.24", | ||
"lua.vm.js": "^0.0.1", | ||
"msgpack5": "^4.2.1" | ||
"msgpack5": "^5.3.2" | ||
}, | ||
@@ -36,17 +36,17 @@ "peerDependencies": { | ||
"devDependencies": { | ||
"@princjef/tslint-config": "^2.0.0", | ||
"@types/deasync": "^0.1.0", | ||
"@types/jest": "^24.0.18", | ||
"@types/msgpack5": "^3.4.1", | ||
"@types/node": "^8.10.53", | ||
"@types/redis": "^2.8.13", | ||
"@princjef/tslint-config": "^2.0.1", | ||
"@types/deasync": "^0.1.2", | ||
"@types/jest": "^27.0.3", | ||
"@types/msgpack5": "^3.4.2", | ||
"@types/node": "^12.20.37", | ||
"@types/redis": "^2.8.32", | ||
"@types/redis-mock": "^0.17.0", | ||
"codecov": "^3.5.0", | ||
"jest": "^24.9.0", | ||
"prettier": "^1.18.2", | ||
"pubcop": "^1.0.0", | ||
"codecov": "^3.8.3", | ||
"jest": "^27.4.3", | ||
"prettier": "^2.5.0", | ||
"pubcop": "^1.0.2", | ||
"redis-evalsha": "^1.1.1", | ||
"redis-mock": "^0.46.0", | ||
"tslint": "^5.19.0", | ||
"typescript": "^3.6.2" | ||
"redis-mock": "^0.56.3", | ||
"tslint": "^5.20.1", | ||
"typescript": "^4.5.2" | ||
}, | ||
@@ -53,0 +53,0 @@ "scripts": { |
@@ -29,3 +29,5 @@ # redis-eval-mock | ||
spyOn(redis, 'createClient').and.callFake(() => mockEval(mock.createClient())); | ||
jest.spyOn(redis, 'createClient').mockImplementation(() => | ||
mockEval(mock.createClient()) | ||
); | ||
``` | ||
@@ -32,0 +34,0 @@ |
18921
313
42
+ Addedbase64-js@1.5.1(transitive)
+ Addedbl@4.1.0(transitive)
+ Addedbuffer@5.7.1(transitive)
+ Addedieee754@1.2.1(transitive)
+ Addedmsgpack5@5.3.2(transitive)
+ Addedreadable-stream@3.6.2(transitive)
+ Addedstring_decoder@1.3.0(transitive)
- Removedbl@2.2.1(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedisarray@1.0.0(transitive)
- Removedmsgpack5@4.5.1(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedstring_decoder@1.1.1(transitive)
Updateddeasync@^0.1.24
Updatedmsgpack5@^5.3.2