UNPKG

@silverwind/ioredis-mock

Version:

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

13 lines (11 loc) 266 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getset = getset; function getset(key, val) { const old = this.data.has(key) ? this.data.get(key) : null; this.data.set(key, val); this.expires.delete(key); return old; }