/opt/canhelp/node_modules/ioredis/built
NameSizeModeActions
cluster/-0755rm
connectors/-0755rm
constants/-0755rm
errors/-0755rm
redis/-0755rm
utils/-0755rm
autoPipelining.d.ts6250644editdlrm
autoPipelining.js68170644editdlrm
Command.d.ts53260644editdlrm
Command.js149730644editdlrm
DataHandler.d.ts11700644editdlrm
DataHandler.js84680644editdlrm
index.d.ts13730644editdlrm
index.js25700644editdlrm
Pipeline.d.ts8380644editdlrm
Pipeline.js129900644editdlrm
Redis.d.ts82430644editdlrm
Redis.js283020644editdlrm
ScanStream.d.ts5690644editdlrm
ScanStream.js14540644editdlrm
Script.d.ts3760644editdlrm
Script.js25540644editdlrm
SubscriptionSet.d.ts4840644editdlrm
SubscriptionSet.js10120644editdlrm
transaction.d.ts4470644editdlrm
transaction.js37480644editdlrm
types.d.ts9460644editdlrm
types.js770644editdlrm
Edit: /opt/canhelp/node_modules/ioredis/built/Script.js (2554B)
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const crypto_1 = require("crypto"); const Command_1 = require("./Command"); const standard_as_callback_1 = require("standard-as-callback"); class Script { constructor(lua, numberOfKeys = null, keyPrefix = "", readOnly = false) { this.lua = lua; this.numberOfKeys = numberOfKeys; this.keyPrefix = keyPrefix; this.readOnly = readOnly; this.sha = (0, crypto_1.createHash)("sha1").update(lua).digest("hex"); const sha = this.sha; const socketHasScriptLoaded = new WeakSet(); this.Command = class CustomScriptCommand extends Command_1.default { toWritable(socket) { const origReject = this.reject; this.reject = (err) => { if (err.message.indexOf("NOSCRIPT") !== -1) { socketHasScriptLoaded.delete(socket); } origReject.call(this, err); }; if (!socketHasScriptLoaded.has(socket)) { socketHasScriptLoaded.add(socket); this.name = "eval"; this.args[0] = lua; } else if (this.name === "eval") { this.name = "evalsha"; this.args[0] = sha; } return super.toWritable(socket); } }; } execute(container, args, options, callback) { if (typeof this.numberOfKeys === "number") { args.unshift(this.numberOfKeys); } if (this.keyPrefix) { options.keyPrefix = this.keyPrefix; } if (this.readOnly) { options.readOnly = true; } const evalsha = new this.Command("evalsha", [this.sha, ...args], options); evalsha.promise = evalsha.promise.catch((err) => { if (err.message.indexOf("NOSCRIPT") === -1) { throw err; } // Resend the same custom evalsha command that gets transformed // to an eval in case it's not loaded yet on the connection. const resend = new this.Command("evalsha", [this.sha, ...args], options); const client = container.isPipeline ? container.redis : container; return client.sendCommand(resend); }); (0, standard_as_callback_1.default)(evalsha.promise, callback); return container.sendCommand(evalsha); } } exports.default = Script;