import i from"./get.mjs";function s(r,l,t,o){if(!l.length)return t;const[f,...n]=l;let e;return!r&&typeof f=="number"?e=[]:Array.isArray(r)?e=[...r]:e={...r},o&&t===void 0&&n.length===1?delete e[f][n[0]]:e[f]=s(e[f],n,t,o),e}function u(r,l,t,o=!1){return l.length&&o&&t===void 0&&!i(r,l.slice(0,-1))?r:s(r,l,t,o)}export{u as default};
