If you don't want to use lodash The object.assign({},val) method is OK. But if the val contains nested objects they will be proxified. So it has to be done recursively like that:
function unproxify(val) {
if (val instanceof Array) return val.map(unproxify)
if (val instanceof Object) return Object.fromEntries(Object.entries(Object.assign({},val)).map(([k,v])=>[k,unproxify(v)]))
return val
}
In fact it is a deep clone function. I think that it does not work if val contains Map objects but you can modify the function for that following the same logic.
If you want to unproxify a Vue3 proxy, Vue3 provides a function : toRaw