UNPKG

redis-type

Version:
31 lines (30 loc) 889 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Base = void 0; var Base = /** @class */ (function () { function Base(client, key, useJSON) { if (useJSON === void 0) { useJSON = false; } this.client = client; this.key = key; this.useJSON = useJSON; } /** * Call a Redis method (bind current storage key) */ Base.prototype.call = function (method) { var args = []; for (var _i = 1; _i < arguments.length; _i++) { args[_i - 1] = arguments[_i]; } // @ts-ignore return this.client[method].bind(this.client, this.key); }; /** * Completely removes the key from storage using `DEL this.key` */ Base.prototype.removeKey = function () { return this.client.DEL(this.key); }; return Base; }()); exports.Base = Base;