ram64
Version:
Multi-threaded 64bit memory cache database inspired by redis-like features
14 lines (10 loc) • 389 B
text/typescript
import { CommandFn, CommandOptions } from '../../commands';
import { CacheObject } from '../../types';
import { fn as getWithOptions } from './getWithOptions';
import { fn as set } from './set';
export const fn: CommandFn = (opts: CommandOptions): boolean => {
const obj: CacheObject = getWithOptions(opts);
if (obj) return false;
set(opts);
return true;
}