UNPKG

redis-typescript

Version:

redis client for node.js with typescript and async

77 lines 2.73 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const base_1 = require("../core/base"); var MethodSet; (function (MethodSet) { MethodSet["sadd"] = "SADD"; MethodSet["scard"] = "SCARD"; MethodSet["sdiff"] = "SDIFF"; MethodSet["sdiffstore"] = "SDIFFSTORE"; MethodSet["sinter"] = "SINTER"; MethodSet["sinterstore"] = "SINTERSTORE"; MethodSet["sismember"] = "SISMEMBER"; MethodSet["smembers"] = "SMEMBERS"; MethodSet["smove"] = "SMOVE"; MethodSet["spop"] = "SPOP"; MethodSet["srandmember"] = "SRANDMEMBER"; MethodSet["srem"] = "SREM"; MethodSet["sscan"] = "SSCAN"; MethodSet["sunion"] = "SUNION"; MethodSet["sunionstore"] = "SUNIONSTORE"; })(MethodSet || (MethodSet = {})); class RedisSet extends base_1.Base { sadd(key, member, ...members) { return this.command(MethodSet.sadd, key, member, ...members); } scard(key) { return this.command(MethodSet.scard, key); } sdiff(key, anotherkey, ...keys) { return this.command(MethodSet.sdiff, key, anotherkey, ...keys); } sdiffstore(destination, key, anotherkey, ...keys) { return this.command(MethodSet.sdiffstore, destination, key, anotherkey, ...keys); } sinter(key, anotherkey, ...keys) { return this.command(MethodSet.sinter, key, anotherkey, ...keys); } sinterstore(destination, key, anotherkey, ...keys) { return this.command(MethodSet.sinterstore, destination, key, anotherkey, ...keys); } sismember(key, member) { return this.command(MethodSet.sismember, key, member); } smembers(key) { return this.command(MethodSet.smembers, key); } smove(source, destination, member) { return this.command(MethodSet.smove, source, destination, member); } spop(key, count) { if (typeof count === "number") { return this.command(MethodSet.spop, key, count); } else { return this.command(MethodSet.spop, key); } } srandmember(key, count) { if (typeof count === "number") { return this.command(MethodSet.srandmember, key, count); } else { return this.command(MethodSet.srandmember, key); } } srem(key, member, ...members) { return this.command(MethodSet.srem, key, member, ...members); } sunion(key, anotherkey, ...keys) { return this.command(MethodSet.sunion, key, anotherkey, ...keys); } sunionstore(destination, key, anotherkey, ...keys) { return this.command(MethodSet.sunionstore, destination, key, anotherkey, ...keys); } } exports.RedisSet = RedisSet; //# sourceMappingURL=set.js.map