UNPKG

ram64

Version:

Multi-threaded 64bit memory cache database inspired by redis-like features

22 lines (21 loc) 692 B
"use strict"; exports.fn = void 0; var _getWithOptions = require("./getWithOptions"); var _functions = require("../functions"); var _setWithOptions = require("./setWithOptions"); const fn = (opts)=>{ const obj = (0, _getWithOptions).fn(opts); const fn1 = (0, _functions).get(opts.args?.fnId); if (!fn1) throw new Error(`Function ${opts.args?.fnId} not found`); const fnResult = fn1.fn(obj, opts.args?.params); const newObj = typeof fnResult === 'object' && 'value' in fnResult ? fnResult : { value: fnResult }; (0, _setWithOptions).fn({ ...opts, args: newObj }); return newObj; }; exports.fn = fn; //# sourceMappingURL=setFn.js.map