UNPKG

ioredis-mock

Version:

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

15 lines (12 loc) 221 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.setnx = setnx; function setnx(key, val) { if (!this.data.has(key)) { this.data.set(key, val); return 1; } return 0; }