UNPKG

ioredis-mock

Version:

This library emulates ioredis by performing all operations in-memory.

12 lines (11 loc) 254 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.decr = decr; function decr(key) { var curVal = Number(this.data.get(key)); var nextVal = curVal - 1; this.data.set(key, nextVal.toString()); return nextVal; }