@@ -47,6 +47,7 @@ import {
4747 createMSet ,
4848 createPExpire ,
4949 createPExpireAt ,
50+ createPersist ,
5051 createPttl ,
5152 createRPop ,
5253 createRPush ,
@@ -1176,7 +1177,7 @@ export class BaseClient {
11761177 * Both `start` and `end` are zero-based indexes with 0 being the element with the lowest score.
11771178 * These indexes can be negative numbers, where they indicate offsets starting at the element with the highest score.
11781179 * See https://redis.io/commands/zremrangebyrank/ for more details.
1179- *
1180+ *
11801181 * @param key - The key of the sorted set.
11811182 * @param start - The starting point of the range.
11821183 * @param end - The end of the range.
@@ -1185,7 +1186,11 @@ export class BaseClient {
11851186 * If `end` exceeds the actual end of the sorted set, the range will stop at the actual end of the sorted set.
11861187 * If `key` does not exist 0 will be returned.
11871188 */
1188- public zremRangeByRank ( key : string , start : number , end : number ) : Promise < number > {
1189+ public zremRangeByRank (
1190+ key : string ,
1191+ start : number ,
1192+ end : number ,
1193+ ) : Promise < number > {
11891194 return this . createWritePromise ( createZremRangeByRank ( key , start , end ) ) ;
11901195 }
11911196
@@ -1212,6 +1217,17 @@ export class BaseClient {
12121217 return this . createWritePromise ( createLindex ( key , index ) ) ;
12131218 }
12141219
1220+ /** Remove the existing timeout on `key`, turning the key from volatile (a key with an expire set) to
1221+ * persistent (a key that will never expire as no timeout is associated).
1222+ * See https://redis.io/commands/persist/ for more details.
1223+ *
1224+ * @param key - The key to remove the existing timeout on.
1225+ * @returns `false` if `key` does not exist or does not have an associated timeout, `true` if the timeout has been removed.
1226+ */
1227+ public persist ( key : string ) : Promise < boolean > {
1228+ return this . createWritePromise ( createPersist ( key ) ) ;
1229+ }
1230+
12151231 /**
12161232 * @internal
12171233 */
0 commit comments