UNPKG

ram64

Version:

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

21 lines (20 loc) 587 B
"use strict"; exports.fn = void 0; var _get = require("./get"); var _set = require("./set"); const fn = (opts)=>{ const oldValue = (0, _get).fn(opts); const oldStr = typeof oldValue === 'string' ? oldValue : ''; const firstPart = oldStr.substring(0, opts.args?.offset ?? 0); const secondPart = oldStr.substring(opts.args?.offset ?? 0); const value = firstPart + (opts.args?.value ?? '') + secondPart; (0, _set).fn({ ...opts, args: { value } }); return value; }; exports.fn = fn; //# sourceMappingURL=strSetRange.js.map