If you are using Vue 3 and dealing with Proxies, Vue provides some methods to help with this:
import { isProxy, toRaw } from 'vue';
Using these, you can check if an object is a proxy with isProxy
, for example:
isProxy(reactiveObjectOrArray) ? 'yup' : 'nope'
And you can extract the raw data using toRaw
:
const rawObjectOrArray = toRaw(reactiveObjectOrArray)