@silverwind/ioredis-mock
Version:
This library emulates ioredis by performing all operations in-memory.
16 lines (13 loc) • 364 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.incrbyfloat = incrbyfloat;
function incrbyfloat(key, increment) {
if (!this.data.has(key)) {
this.data.set(key, '0');
}
const curVal = parseFloat(this.data.get(key));
this.data.set(key, (curVal + parseFloat(increment)).toString());
return this.data.get(key);
}