MCPcopy
hub / github.com/vuejs/composition-api / mockReactivityDeep

Function mockReactivityDeep

src/reactivity/reactive.ts:141–159  ·  view source on GitHub ↗
(obj: any, seen = new Set())

Source from the content-addressed store, hash-verified

139 * Mock __ob__ for object recursively
140 */
141export function mockReactivityDeep(obj: any, seen = new Set()) {
142 if (seen.has(obj) || hasOwn(obj, '__ob__') || !Object.isExtensible(obj))
143 return
144
145 def(obj, '__ob__', mockObserver(obj))
146 seen.add(obj)
147
148 for (const key of Object.keys(obj)) {
149 const value = obj[key]
150 if (
151 !(isPlainObject(value) || isArray(value)) ||
152 isRaw(value) ||
153 !Object.isExtensible(value)
154 ) {
155 continue
156 }
157 mockReactivityDeep(value, seen)
158 }
159}
160
161function mockObserver(value: any = {}): any {
162 return {

Callers 2

ssrMockReactivityFunction · 0.90
observeFunction · 0.85

Calls 6

hasOwnFunction · 0.90
defFunction · 0.90
isPlainObjectFunction · 0.90
isArrayFunction · 0.90
mockObserverFunction · 0.85
isRawFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…