UNPKG

ioredis-mock

Version:

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

12 lines (11 loc) 305 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.llen = llen; function llen(key) { if (this.data.has(key) && !(this.data.get(key) instanceof Array)) { throw new Error("Key " + key + " does not contain a list"); } return (this.data.get(key) || []).length; }